From 3a9cf3a57d0670524548acf54e226e848f73438d Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 21 Aug 2023 13:15:03 +0200 Subject: [PATCH 01/94] feat: initial support for gov v3 --- .../{ => govv2}/abis/AaveGovernanceV2.ts | 2 +- .../abis/ArbitrumBridgeExecutor.ts | 0 src/simulate/{ => govv2}/abis/ArcTimelock.ts | 0 src/simulate/{ => govv2}/abis/Executor.ts | 0 .../{ => govv2}/abis/MetisBridgeExecutor.ts | 0 .../abis/OptimismBridgeExecutor.ts | 0 .../{ => govv2}/abis/PolygonBridgeExecutor.ts | 0 src/simulate/{ => govv2}/networks/arbitrum.ts | 0 src/simulate/{ => govv2}/networks/base.ts | 0 src/simulate/{ => govv2}/networks/commonL2.ts | 0 src/simulate/{ => govv2}/networks/mainnet.ts | 0 src/simulate/{ => govv2}/networks/metis.ts | 0 src/simulate/{ => govv2}/networks/optimism.ts | 0 src/simulate/{ => govv2}/networks/polygon.ts | 0 src/simulate/{ => govv2}/networks/types.ts | 0 src/simulate/{ => govv2}/simulate.ts | 4 +- .../govv3/abis/PayloadsControllerExtended.ts | 414 ++++++++++++++++++ src/simulate/govv3/payloadsController.ts | 46 ++ src/utils/logs.ts | 2 +- 19 files changed, 464 insertions(+), 4 deletions(-) rename src/simulate/{ => govv2}/abis/AaveGovernanceV2.ts (99%) rename src/simulate/{ => govv2}/abis/ArbitrumBridgeExecutor.ts (100%) rename src/simulate/{ => govv2}/abis/ArcTimelock.ts (100%) rename src/simulate/{ => govv2}/abis/Executor.ts (100%) rename src/simulate/{ => govv2}/abis/MetisBridgeExecutor.ts (100%) rename src/simulate/{ => govv2}/abis/OptimismBridgeExecutor.ts (100%) rename src/simulate/{ => govv2}/abis/PolygonBridgeExecutor.ts (100%) rename src/simulate/{ => govv2}/networks/arbitrum.ts (100%) rename src/simulate/{ => govv2}/networks/base.ts (100%) rename src/simulate/{ => govv2}/networks/commonL2.ts (100%) rename src/simulate/{ => govv2}/networks/mainnet.ts (100%) rename src/simulate/{ => govv2}/networks/metis.ts (100%) rename src/simulate/{ => govv2}/networks/optimism.ts (100%) rename src/simulate/{ => govv2}/networks/polygon.ts (100%) rename src/simulate/{ => govv2}/networks/types.ts (100%) rename src/simulate/{ => govv2}/simulate.ts (94%) create mode 100644 src/simulate/govv3/abis/PayloadsControllerExtended.ts create mode 100644 src/simulate/govv3/payloadsController.ts diff --git a/src/simulate/abis/AaveGovernanceV2.ts b/src/simulate/govv2/abis/AaveGovernanceV2.ts similarity index 99% rename from src/simulate/abis/AaveGovernanceV2.ts rename to src/simulate/govv2/abis/AaveGovernanceV2.ts index 88d9e12..d6c6610 100644 --- a/src/simulate/abis/AaveGovernanceV2.ts +++ b/src/simulate/govv2/abis/AaveGovernanceV2.ts @@ -1,6 +1,6 @@ import { Address, Hex, fromHex, pad, toHex } from 'viem'; import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; -import { getSolidityStorageSlotUint } from '../../utils/storageSlots'; +import { getSolidityStorageSlotUint } from '../../../utils/storageSlots'; export const AAVE_GOVERNANCE_V2_ABI = [ { diff --git a/src/simulate/abis/ArbitrumBridgeExecutor.ts b/src/simulate/govv2/abis/ArbitrumBridgeExecutor.ts similarity index 100% rename from src/simulate/abis/ArbitrumBridgeExecutor.ts rename to src/simulate/govv2/abis/ArbitrumBridgeExecutor.ts diff --git a/src/simulate/abis/ArcTimelock.ts b/src/simulate/govv2/abis/ArcTimelock.ts similarity index 100% rename from src/simulate/abis/ArcTimelock.ts rename to src/simulate/govv2/abis/ArcTimelock.ts diff --git a/src/simulate/abis/Executor.ts b/src/simulate/govv2/abis/Executor.ts similarity index 100% rename from src/simulate/abis/Executor.ts rename to src/simulate/govv2/abis/Executor.ts diff --git a/src/simulate/abis/MetisBridgeExecutor.ts b/src/simulate/govv2/abis/MetisBridgeExecutor.ts similarity index 100% rename from src/simulate/abis/MetisBridgeExecutor.ts rename to src/simulate/govv2/abis/MetisBridgeExecutor.ts diff --git a/src/simulate/abis/OptimismBridgeExecutor.ts b/src/simulate/govv2/abis/OptimismBridgeExecutor.ts similarity index 100% rename from src/simulate/abis/OptimismBridgeExecutor.ts rename to src/simulate/govv2/abis/OptimismBridgeExecutor.ts diff --git a/src/simulate/abis/PolygonBridgeExecutor.ts b/src/simulate/govv2/abis/PolygonBridgeExecutor.ts similarity index 100% rename from src/simulate/abis/PolygonBridgeExecutor.ts rename to src/simulate/govv2/abis/PolygonBridgeExecutor.ts diff --git a/src/simulate/networks/arbitrum.ts b/src/simulate/govv2/networks/arbitrum.ts similarity index 100% rename from src/simulate/networks/arbitrum.ts rename to src/simulate/govv2/networks/arbitrum.ts diff --git a/src/simulate/networks/base.ts b/src/simulate/govv2/networks/base.ts similarity index 100% rename from src/simulate/networks/base.ts rename to src/simulate/govv2/networks/base.ts diff --git a/src/simulate/networks/commonL2.ts b/src/simulate/govv2/networks/commonL2.ts similarity index 100% rename from src/simulate/networks/commonL2.ts rename to src/simulate/govv2/networks/commonL2.ts diff --git a/src/simulate/networks/mainnet.ts b/src/simulate/govv2/networks/mainnet.ts similarity index 100% rename from src/simulate/networks/mainnet.ts rename to src/simulate/govv2/networks/mainnet.ts diff --git a/src/simulate/networks/metis.ts b/src/simulate/govv2/networks/metis.ts similarity index 100% rename from src/simulate/networks/metis.ts rename to src/simulate/govv2/networks/metis.ts diff --git a/src/simulate/networks/optimism.ts b/src/simulate/govv2/networks/optimism.ts similarity index 100% rename from src/simulate/networks/optimism.ts rename to src/simulate/govv2/networks/optimism.ts diff --git a/src/simulate/networks/polygon.ts b/src/simulate/govv2/networks/polygon.ts similarity index 100% rename from src/simulate/networks/polygon.ts rename to src/simulate/govv2/networks/polygon.ts diff --git a/src/simulate/networks/types.ts b/src/simulate/govv2/networks/types.ts similarity index 100% rename from src/simulate/networks/types.ts rename to src/simulate/govv2/networks/types.ts diff --git a/src/simulate/simulate.ts b/src/simulate/govv2/simulate.ts similarity index 94% rename from src/simulate/simulate.ts rename to src/simulate/govv2/simulate.ts index cff0741..f325376 100644 --- a/src/simulate/simulate.ts +++ b/src/simulate/govv2/simulate.ts @@ -1,5 +1,5 @@ -import { logError, logInfo, logSuccess } from '../utils/logger'; -import { TenderlySimulationResponse } from '../utils/tenderlyClient'; +import { logError, logInfo, logSuccess } from '../../utils/logger'; +import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; import { arbitrum } from './networks/arbitrum'; import { arc, mainnet } from './networks/mainnet'; import { optimism } from './networks/optimism'; diff --git a/src/simulate/govv3/abis/PayloadsControllerExtended.ts b/src/simulate/govv3/abis/PayloadsControllerExtended.ts new file mode 100644 index 0000000..87b5f18 --- /dev/null +++ b/src/simulate/govv3/abis/PayloadsControllerExtended.ts @@ -0,0 +1,414 @@ +export const PAYLOADS_CONTROLLER_EXTENDED_ABI = [ + { + inputs: [ + { internalType: 'address', name: 'crossChainController', type: 'address' }, + { internalType: 'address', name: 'messageOriginator', type: 'address' }, + { internalType: 'uint256', name: 'originChainId', type: 'uint256' }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'caller', type: 'address' }, + { indexed: true, internalType: 'address', name: 'token', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'ERC20Rescued', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { indexed: true, internalType: 'address', name: 'executor', type: 'address' }, + { indexed: false, internalType: 'uint40', name: 'delay', type: 'uint40' }, + ], + name: 'ExecutorSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: 'address', name: 'oldGuardian', type: 'address' }, + { indexed: false, internalType: 'address', name: 'newGuardian', type: 'address' }, + ], + name: 'GuardianUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: 'uint8', name: 'version', type: 'uint8' }], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'caller', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'NativeTokensRescued', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' }, + { indexed: true, internalType: 'address', name: 'newOwner', type: 'address' }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: 'uint40', name: 'payloadId', type: 'uint40' }], + name: 'PayloadCancelled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'uint40', name: 'payloadId', type: 'uint40' }, + { indexed: true, internalType: 'address', name: 'creator', type: 'address' }, + { + components: [ + { internalType: 'address', name: 'target', type: 'address' }, + { internalType: 'bool', name: 'withDelegateCall', type: 'bool' }, + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'string', name: 'signature', type: 'string' }, + { internalType: 'bytes', name: 'callData', type: 'bytes' }, + ], + indexed: false, + internalType: 'struct IPayloadsControllerCore.ExecutionAction[]', + name: 'actions', + type: 'tuple[]', + }, + { + indexed: true, + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'maximumAccessLevelRequired', + type: 'uint8', + }, + ], + name: 'PayloadCreated', + type: 'event', + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: 'uint40', name: 'payloadId', type: 'uint40' }], + name: 'PayloadExecuted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'originSender', type: 'address' }, + { indexed: true, internalType: 'uint256', name: 'originChainId', type: 'uint256' }, + { indexed: true, internalType: 'bool', name: 'delivered', type: 'bool' }, + { indexed: false, internalType: 'bytes', name: 'message', type: 'bytes' }, + { indexed: false, internalType: 'bytes', name: 'reason', type: 'bytes' }, + ], + name: 'PayloadExecutionMessageReceived', + type: 'event', + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: 'uint40', name: 'payloadId', type: 'uint40' }], + name: 'PayloadQueued', + type: 'event', + }, + { + inputs: [], + name: 'CROSS_CHAIN_CONTROLLER', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'EXPIRATION_DELAY', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'GRACE_PERIOD', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MAX_EXECUTION_DELAY', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'MESSAGE_ORIGINATOR', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MIN_EXECUTION_DELAY', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'ORIGIN_CHAIN_ID', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint40', name: 'payloadId', type: 'uint40' }], + name: 'cancelPayload', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'address', name: 'target', type: 'address' }, + { internalType: 'bool', name: 'withDelegateCall', type: 'bool' }, + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'string', name: 'signature', type: 'string' }, + { internalType: 'bytes', name: 'callData', type: 'bytes' }, + ], + internalType: 'struct IPayloadsControllerCore.ExecutionAction[]', + name: 'actions', + type: 'tuple[]', + }, + ], + name: 'createPayload', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: 'message', type: 'bytes' }], + name: 'decodeMessage', + outputs: [ + { internalType: 'uint40', name: '', type: 'uint40' }, + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: '', type: 'uint8' }, + { internalType: 'uint40', name: '', type: 'uint40' }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'emergencyEtherTransfer', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'erc20Token', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'emergencyTokenTransfer', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint40', name: 'payloadId', type: 'uint40' }], + name: 'executePayload', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [{ internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessControl', type: 'uint8' }], + name: 'getExecutorSettingsByAccessControl', + outputs: [ + { + components: [ + { internalType: 'address', name: 'executor', type: 'address' }, + { internalType: 'uint40', name: 'delay', type: 'uint40' }, + ], + internalType: 'struct IPayloadsControllerCore.ExecutorConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint40', name: 'payloadId', type: 'uint40' }], + name: 'getPayloadById', + outputs: [ + { + components: [ + { internalType: 'address', name: 'creator', type: 'address' }, + { + internalType: 'enum PayloadsControllerUtils.AccessControl', + name: 'maximumAccessLevelRequired', + type: 'uint8', + }, + { internalType: 'enum IPayloadsControllerCore.PayloadState', name: 'state', type: 'uint8' }, + { internalType: 'uint40', name: 'createdAt', type: 'uint40' }, + { internalType: 'uint40', name: 'queuedAt', type: 'uint40' }, + { internalType: 'uint40', name: 'executedAt', type: 'uint40' }, + { internalType: 'uint40', name: 'cancelledAt', type: 'uint40' }, + { internalType: 'uint40', name: 'expirationTime', type: 'uint40' }, + { internalType: 'uint40', name: 'delay', type: 'uint40' }, + { internalType: 'uint40', name: 'gracePeriod', type: 'uint40' }, + { + components: [ + { internalType: 'address', name: 'target', type: 'address' }, + { internalType: 'bool', name: 'withDelegateCall', type: 'bool' }, + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'string', name: 'signature', type: 'string' }, + { internalType: 'bytes', name: 'callData', type: 'bytes' }, + ], + internalType: 'struct IPayloadsControllerCore.ExecutionAction[]', + name: 'actions', + type: 'tuple[]', + }, + ], + internalType: 'struct IPayloadsControllerCore.Payload', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint40', name: 'payloadId', type: 'uint40' }], + name: 'getPayloadState', + outputs: [{ internalType: 'enum IPayloadsControllerCore.PayloadState', name: '', type: 'uint8' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPayloadsCount', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'guardian', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'guardian', type: 'address' }, + { + components: [ + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { + components: [ + { internalType: 'address', name: 'executor', type: 'address' }, + { internalType: 'uint40', name: 'delay', type: 'uint40' }, + ], + internalType: 'struct IPayloadsControllerCore.ExecutorConfig', + name: 'executorConfig', + type: 'tuple', + }, + ], + internalType: 'struct IPayloadsControllerCore.UpdateExecutorInput[]', + name: 'executors', + type: 'tuple[]', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'originSender', type: 'address' }, + { internalType: 'uint256', name: 'originChainId', type: 'uint256' }, + { internalType: 'bytes', name: 'message', type: 'bytes' }, + ], + name: 'receiveCrossChainMessage', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function' }, + { + inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { + components: [ + { internalType: 'address', name: 'executor', type: 'address' }, + { internalType: 'uint40', name: 'delay', type: 'uint40' }, + ], + internalType: 'struct IPayloadsControllerCore.ExecutorConfig', + name: 'executorConfig', + type: 'tuple', + }, + ], + internalType: 'struct IPayloadsControllerCore.UpdateExecutorInput[]', + name: 'executors', + type: 'tuple[]', + }, + ], + name: 'updateExecutors', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'newGuardian', type: 'address' }], + name: 'updateGuardian', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'whoCanRescue', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { stateMutability: 'payable', type: 'receive' }, +] as const; diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts new file mode 100644 index 0000000..3a855a5 --- /dev/null +++ b/src/simulate/govv3/payloadsController.ts @@ -0,0 +1,46 @@ +import { Hex, PublicClient, getContract } from 'viem'; +import { PAYLOADS_CONTROLLER_EXTENDED_ABI } from './abis/PayloadsControllerExtended'; +import { getLogs } from '../../utils/logs'; +import { FilterLogWithTimestamp } from '../govv2/networks/types'; + +interface PayloadsController { + // cache created / queued / Executed logs + cacheLogs: () => Promise<{ + createdLogs: Array>; + queuedLogs: Array>; + executedLogs: Array>; + }>; +} + +const getPayloadsController = (address: Hex, publicClient: PublicClient): PayloadsController => { + const controllerContract = getContract({ abi: PAYLOADS_CONTROLLER_EXTENDED_ABI, address, publicClient }); + return { + cacheLogs: async () => { + const createdLogs = await getLogs(publicClient, (fromBLock, toBlock) => { + return controllerContract.createEventFilter.PayloadCreated( + {}, + { + fromBlock: fromBLock, + toBlock: toBlock, + } + ); + }); + const queuedLogs = await getLogs(publicClient, (fromBLock, toBlock) => { + return controllerContract.createEventFilter.PayloadQueued({ + fromBlock: fromBLock, + toBlock: toBlock, + }); + }); + const executedLogs = await getLogs(publicClient, (fromBLock, toBlock) => { + return controllerContract.createEventFilter.PayloadExecuted({ + fromBlock: fromBLock, + toBlock: toBlock, + }); + }); + return { createdLogs, queuedLogs, executedLogs }; + }, + create: () => {}, + queue: () => {}, + execute: () => {}, + }; +}; diff --git a/src/utils/logs.ts b/src/utils/logs.ts index 4449627..b16bcbd 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -3,7 +3,7 @@ import type { Abi } from 'abitype'; import fs from 'fs'; import path from 'path'; import { logInfo } from './logger'; -import { FilterLogWithTimestamp } from '../simulate/networks/types'; +import { FilterLogWithTimestamp } from '../simulate/govv2/networks/types'; /** * Fetches the logs and stores them in a cache folder. From 1cf6a033655d06195da6f9ac96d56188657f6e8c Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 21 Aug 2023 17:41:51 +0200 Subject: [PATCH 02/94] feat: gov v3 adjustments --- package.json | 4 +- src/cli.ts | 2 + src/commands/fork.ts | 20 +- src/commands/simulate-proposal-v3.ts | 12 + src/commands/simulate-proposal.ts | 2 +- src/index.ts | 4 +- src/simulate/govv2/networks/arbitrum.ts | 6 +- src/simulate/govv2/networks/base.ts | 6 +- src/simulate/govv2/networks/commonL2.ts | 6 +- src/simulate/govv2/networks/mainnet.ts | 10 +- src/simulate/govv2/networks/metis.ts | 6 +- src/simulate/govv2/networks/optimism.ts | 6 +- src/simulate/govv2/networks/polygon.ts | 6 +- src/simulate/govv2/networks/types.ts | 2 +- src/simulate/govv3/abis/GovernanceExtended.ts | 494 ++++++++++++++++++ src/simulate/govv3/governance.ts | 97 ++++ src/simulate/govv3/payloadsController.ts | 10 +- src/simulate/govv3/simulate.ts | 19 + types.d.ts | 2 + yarn.lock | 8 +- 20 files changed, 675 insertions(+), 47 deletions(-) create mode 100644 src/commands/simulate-proposal-v3.ts create mode 100644 src/simulate/govv3/abis/GovernanceExtended.ts create mode 100644 src/simulate/govv3/governance.ts create mode 100644 src/simulate/govv3/simulate.ts diff --git a/package.json b/package.json index 7e8bc34..cad88e0 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, - "types": "./dist/AaveAddressBook.d.cts", + "types": "./dist/index.d.cts", "default": "./dist/index.cjs" } }, @@ -52,7 +52,7 @@ "access": "public" }, "dependencies": { - "@bgd-labs/aave-address-book": "^1.33.0", + "@bgd-labs/aave-address-book": "1.33.1-e5554f111c11be63c08c5861c43bb27567e806a4.0", "bs58": "^5.0.0", "chalk": "^4.1.2", "dotenv": "^16.3.1", diff --git a/src/cli.ts b/src/cli.ts index 11fa034..332e444 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -5,6 +5,7 @@ import { hideBin } from 'yargs/helpers'; import * as ipfsCmd from './commands/ipfs-upload'; import * as diffSnapshot from './commands/diff-snaphots'; import * as simulateProposal from './commands/simulate-proposal'; +import * as simulateProposalV3 from './commands/simulate-proposal-v3'; import * as fork from './commands/fork'; yargs(hideBin(process.argv)) @@ -12,4 +13,5 @@ yargs(hideBin(process.argv)) .command(diffSnapshot) .command(simulateProposal) .command(fork) + .command(simulateProposalV3) .demandCommand().argv; diff --git a/src/commands/fork.ts b/src/commands/fork.ts index 8f0318b..08a8aa1 100644 --- a/src/commands/fork.ts +++ b/src/commands/fork.ts @@ -3,18 +3,18 @@ import { getProposalStateById, getTenderlyActionSetCreationPayload, getTenderlyActionSetExecutionPayload, -} from '../simulate/networks/commonL2'; -import { polygonExecutorContract } from '../simulate/networks/polygon'; +} from '../simulate/govv2/networks/commonL2'; +import { polygonExecutorContract } from '../simulate/govv2/networks/polygon'; import { arbitrumClient, baseClient, optimismClient, polygonClient } from '../utils/rpcClients'; import { tenderly } from '../utils/tenderlyClient'; -import { arbitrumExecutorContract } from '../simulate/networks/arbitrum'; -import { optimismExecutorContract } from '../simulate/networks/optimism'; -import { polygon as modulePolygon } from '../simulate/networks/polygon'; -import { arbitrum as moduleArbitrum } from '../simulate/networks/arbitrum'; -import { optimism as moduleOptimism } from '../simulate/networks/optimism'; -import { base as moduleBase } from '../simulate/networks/base'; -import { ActionSetState } from '../simulate/networks/types'; -import { baseExecutorContract } from '../simulate/networks/base'; +import { arbitrumExecutorContract } from '../simulate/govv2/networks/arbitrum'; +import { optimismExecutorContract } from '../simulate/govv2/networks/optimism'; +import { polygon as modulePolygon } from '../simulate/govv2/networks/polygon'; +import { arbitrum as moduleArbitrum } from '../simulate/govv2/networks/arbitrum'; +import { optimism as moduleOptimism } from '../simulate/govv2/networks/optimism'; +import { base as moduleBase } from '../simulate/govv2/networks/base'; +import { ActionSetState } from '../simulate/govv2/networks/types'; +import { baseExecutorContract } from '../simulate/govv2/networks/base'; export type ForkOptions = { chainId: number; diff --git a/src/commands/simulate-proposal-v3.ts b/src/commands/simulate-proposal-v3.ts new file mode 100644 index 0000000..a35bdcf --- /dev/null +++ b/src/commands/simulate-proposal-v3.ts @@ -0,0 +1,12 @@ +import { simulateProposal } from '../simulate/govv3/simulate'; + +export const command = 'simulate-proposal-v3 [proposalId]'; + +export const describe = 'simulates a aave v3 governance proposal'; + +export const handler = async function (argv) { + if (!argv.proposalId) throw new Error('proposalId is required'); + const proposalId = BigInt(argv.proposalId); + const result = await simulateProposal(proposalId); + // console.log(result); +}; diff --git a/src/commands/simulate-proposal.ts b/src/commands/simulate-proposal.ts index 0aafc30..fc531db 100644 --- a/src/commands/simulate-proposal.ts +++ b/src/commands/simulate-proposal.ts @@ -1,4 +1,4 @@ -import { simulateProposal } from '../simulate/simulate'; +import { simulateProposal } from '../simulate/govv2/simulate'; export const command = 'simulate-proposal [proposalId]'; diff --git a/src/index.ts b/src/index.ts index 9d20056..433e755 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ export * from './reports/diff-reports'; -export { simulateProposal } from './simulate/simulate'; +export { simulateProposal } from './simulate/govv2/simulate'; export * from './utils/tenderlyClient'; -export * from './simulate/networks/types'; +export * from './simulate/govv2/networks/types'; diff --git a/src/simulate/govv2/networks/arbitrum.ts b/src/simulate/govv2/networks/arbitrum.ts index 692f21b..3416c06 100644 --- a/src/simulate/govv2/networks/arbitrum.ts +++ b/src/simulate/govv2/networks/arbitrum.ts @@ -2,9 +2,9 @@ import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; import { ActionSetState, L2NetworkModule } from './types'; import { getContract } from 'viem'; import { ARBITRUM_BRIDGE_EXECUTOR_ABI, ARBITRUM_BRIDGE_EXECUTOR_START_BLOCK } from '../abis/ArbitrumBridgeExecutor'; -import { arbitrumClient } from '../../utils/rpcClients'; -import { getLogs } from '../../utils/logs'; -import { Trace, tenderly } from '../../utils/tenderlyClient'; +import { arbitrumClient } from '../../../utils/rpcClients'; +import { getLogs } from '../../../utils/logs'; +import { Trace, tenderly } from '../../../utils/tenderlyClient'; import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; const ARBITRUM_INBOX = '0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f'; // TODO: should probably be on address-book diff --git a/src/simulate/govv2/networks/base.ts b/src/simulate/govv2/networks/base.ts index 87cf2b3..512003f 100644 --- a/src/simulate/govv2/networks/base.ts +++ b/src/simulate/govv2/networks/base.ts @@ -2,9 +2,9 @@ import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; import { ActionSetState, L2NetworkModule } from './types'; import { getContract } from 'viem'; import { OPTIMISM_BRIDGE_EXECUTOR_ABI } from '../abis/OptimismBridgeExecutor'; -import { baseClient } from '../../utils/rpcClients'; -import { getLogs } from '../../utils/logs'; -import { Trace, tenderly } from '../../utils/tenderlyClient'; +import { baseClient } from '../../../utils/rpcClients'; +import { getLogs } from '../../../utils/logs'; +import { Trace, tenderly } from '../../../utils/tenderlyClient'; import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; const BASE_L1_CROSS_DOMAIN_MESSENGER = '0x866E82a600A1414e583f7F13623F1aC5d58b0Afa'; diff --git a/src/simulate/govv2/networks/commonL2.ts b/src/simulate/govv2/networks/commonL2.ts index dfa5fbe..d8dd1d6 100644 --- a/src/simulate/govv2/networks/commonL2.ts +++ b/src/simulate/govv2/networks/commonL2.ts @@ -12,14 +12,14 @@ import { pad, toHex, } from 'viem'; -import { Trace, tenderly } from '../../utils/tenderlyClient'; -import { EOA } from '../../utils/constants'; +import { Trace, tenderly } from '../../../utils/tenderlyClient'; +import { EOA } from '../../../utils/constants'; import { getBytesValue, getDynamicArraySlot, getSolidityStorageSlotBytes, getSolidityStorageSlotUint, -} from '../../utils/storageSlots'; +} from '../../../utils/storageSlots'; import { ActionSetState, FilterLogWithTimestamp, FormattedArgs } from './types'; /** diff --git a/src/simulate/govv2/networks/mainnet.ts b/src/simulate/govv2/networks/mainnet.ts index 53c8d6e..b8c250a 100644 --- a/src/simulate/govv2/networks/mainnet.ts +++ b/src/simulate/govv2/networks/mainnet.ts @@ -12,17 +12,17 @@ import { parseEther, toHex, } from 'viem'; -import { mainnetClient } from '../../utils/rpcClients'; -import { getLogs } from '../../utils/logs'; -import { Trace, tenderly } from '../../utils/tenderlyClient'; -import { EOA } from '../../utils/constants'; +import { mainnetClient } from '../../../utils/rpcClients'; +import { getLogs } from '../../../utils/logs'; +import { Trace, tenderly } from '../../../utils/tenderlyClient'; +import { EOA } from '../../../utils/constants'; import { AAVE_GOVERNANCE_V2_ABI, AAVE_GOVERNANCE_V2_START_BLOCK, getAaveGovernanceV2Slots, } from '../abis/AaveGovernanceV2'; import { EXECUTOR_ABI } from '../abis/Executor'; -import { getSolidityStorageSlotBytes } from '../../utils/storageSlots'; +import { getSolidityStorageSlotBytes } from '../../../utils/storageSlots'; import { ARC_TIMELOCK_ABI } from '../abis/ArcTimelock'; import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; diff --git a/src/simulate/govv2/networks/metis.ts b/src/simulate/govv2/networks/metis.ts index 0725d73..96723ec 100644 --- a/src/simulate/govv2/networks/metis.ts +++ b/src/simulate/govv2/networks/metis.ts @@ -2,9 +2,9 @@ import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; import { L2NetworkModule } from './types'; import { getContract } from 'viem'; import { METIS_BRIDGE_EXECUTOR_START_BLOCK, METIS_BRIDGE_EXECUTOR_ABI } from '../abis/MetisBridgeExecutor'; -import { metisClient } from '../../utils/rpcClients'; -import { getLogs } from '../../utils/logs'; -import { Trace } from '../../utils/tenderlyClient'; +import { metisClient } from '../../../utils/rpcClients'; +import { getLogs } from '../../../utils/logs'; +import { Trace } from '../../../utils/tenderlyClient'; import { getProposalState } from './commonL2'; import { OPTIMISM_BRIDGE_EXECUTOR_ABI } from '../abis/OptimismBridgeExecutor'; diff --git a/src/simulate/govv2/networks/optimism.ts b/src/simulate/govv2/networks/optimism.ts index 49e8b20..811c728 100644 --- a/src/simulate/govv2/networks/optimism.ts +++ b/src/simulate/govv2/networks/optimism.ts @@ -2,9 +2,9 @@ import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; import { ActionSetState, L2NetworkModule } from './types'; import { getContract } from 'viem'; import { OPTIMISM_BRIDGE_EXECUTOR_ABI, OPTIMISM_BRIDGE_EXECUTOR_START_BLOCK } from '../abis/OptimismBridgeExecutor'; -import { mainnetClient, optimismClient } from '../../utils/rpcClients'; -import { getLogs } from '../../utils/logs'; -import { Trace, tenderly } from '../../utils/tenderlyClient'; +import { mainnetClient, optimismClient } from '../../../utils/rpcClients'; +import { getLogs } from '../../../utils/logs'; +import { Trace, tenderly } from '../../../utils/tenderlyClient'; import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; const OPTIMISM_L1_CROSS_COMAIN_MESSENGER = '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1'; diff --git a/src/simulate/govv2/networks/polygon.ts b/src/simulate/govv2/networks/polygon.ts index cb16d14..42e8113 100644 --- a/src/simulate/govv2/networks/polygon.ts +++ b/src/simulate/govv2/networks/polygon.ts @@ -1,9 +1,9 @@ import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; import { ActionSetState, L2NetworkModule } from './types'; import { decodeAbiParameters, getContract } from 'viem'; -import { polygonClient } from '../../utils/rpcClients'; -import { getLogs } from '../../utils/logs'; -import { Trace, tenderly } from '../../utils/tenderlyClient'; +import { polygonClient } from '../../../utils/rpcClients'; +import { getLogs } from '../../../utils/logs'; +import { Trace, tenderly } from '../../../utils/tenderlyClient'; import { POLYGON_BRIDGE_EXECUTOR_ABI, POLYGON_BRIDGE_EXECUTOR_START_BLOCK } from '../abis/PolygonBridgeExecutor'; import { formatArgs, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; diff --git a/src/simulate/govv2/networks/types.ts b/src/simulate/govv2/networks/types.ts index 3fefc50..d3302a6 100644 --- a/src/simulate/govv2/networks/types.ts +++ b/src/simulate/govv2/networks/types.ts @@ -1,5 +1,5 @@ import type { Abi } from 'abitype'; -import { TenderlySimulationResponse, Trace } from '../../utils/tenderlyClient'; +import { TenderlySimulationResponse, Trace } from '../../../utils/tenderlyClient'; import { GetFilterLogsReturnType, Hex, ReadContractReturnType } from 'viem'; import { AAVE_GOVERNANCE_V2_ABI } from '../abis/AaveGovernanceV2'; import { GetProposalStateProps, getProposalState } from './commonL2'; diff --git a/src/simulate/govv3/abis/GovernanceExtended.ts b/src/simulate/govv3/abis/GovernanceExtended.ts new file mode 100644 index 0000000..21add94 --- /dev/null +++ b/src/simulate/govv3/abis/GovernanceExtended.ts @@ -0,0 +1,494 @@ +export const GOVERNANCE_EXTENDED_ABI = [ + { + inputs: [ + { internalType: 'address', name: 'crossChainController', type: 'address' }, + { internalType: 'uint256', name: 'coolDownPeriod', type: 'uint256' }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [{ indexed: true, internalType: 'uint256', name: 'gasLimit', type: 'uint256' }], + name: 'GasLimitUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: 'address', name: 'oldGuardian', type: 'address' }, + { indexed: false, internalType: 'address', name: 'newGuardian', type: 'address' }, + ], + name: 'GuardianUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [{ indexed: false, internalType: 'uint8', name: 'version', type: 'uint8' }], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' }, + { indexed: true, internalType: 'address', name: 'newOwner', type: 'address' }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, + { indexed: false, internalType: 'uint40', name: 'payloadId', type: 'uint40' }, + { indexed: true, internalType: 'address', name: 'payloadsController', type: 'address' }, + { indexed: true, internalType: 'uint256', name: 'chainId', type: 'uint256' }, + { indexed: false, internalType: 'uint256', name: 'payloadNumberOnProposal', type: 'uint256' }, + { indexed: false, internalType: 'uint256', name: 'numberOfPayloadsOnProposal', type: 'uint256' }, + ], + name: 'PayloadSent', + type: 'event', + }, + { + anonymous: false, + inputs: [{ indexed: true, internalType: 'address', name: 'newPowerStrategy', type: 'address' }], + name: 'PowerStrategyUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [{ indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }], + name: 'ProposalCanceled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, + { indexed: true, internalType: 'address', name: 'creator', type: 'address' }, + { indexed: true, internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { indexed: false, internalType: 'bytes32', name: 'ipfsHash', type: 'bytes32' }, + ], + name: 'ProposalCreated', + type: 'event', + }, + { + anonymous: false, + inputs: [{ indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }], + name: 'ProposalExecuted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, + { indexed: false, internalType: 'uint128', name: 'votesFor', type: 'uint128' }, + { indexed: false, internalType: 'uint128', name: 'votesAgainst', type: 'uint128' }, + ], + name: 'ProposalFailed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, + { indexed: false, internalType: 'uint128', name: 'votesFor', type: 'uint128' }, + { indexed: false, internalType: 'uint128', name: 'votesAgainst', type: 'uint128' }, + ], + name: 'ProposalQueued', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, + { indexed: true, internalType: 'address', name: 'voter', type: 'address' }, + { indexed: true, internalType: 'bool', name: 'support', type: 'bool' }, + { + components: [ + { internalType: 'address', name: 'underlyingAsset', type: 'address' }, + { internalType: 'uint128', name: 'slot', type: 'uint128' }, + ], + indexed: false, + internalType: 'struct IVotingMachineWithProofs.VotingAssetWithSlot[]', + name: 'votingAssetsWithSlot', + type: 'tuple[]', + }, + ], + name: 'VoteForwarded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, + { indexed: true, internalType: 'bytes32', name: 'snapshotBlockHash', type: 'bytes32' }, + { indexed: false, internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, + ], + name: 'VotingActivated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { indexed: false, internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, + { indexed: false, internalType: 'uint24', name: 'coolDownBeforeVotingStart', type: 'uint24' }, + { indexed: false, internalType: 'uint256', name: 'quorum', type: 'uint256' }, + { indexed: false, internalType: 'uint256', name: 'differential', type: 'uint256' }, + { indexed: false, internalType: 'uint256', name: 'minPropositionPower', type: 'uint256' }, + ], + name: 'VotingConfigUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'votingPortal', type: 'address' }, + { indexed: true, internalType: 'bool', name: 'approved', type: 'bool' }, + ], + name: 'VotingPortalUpdated', + type: 'event', + }, + { + inputs: [], + name: 'ACHIEVABLE_VOTING_PARTICIPATION', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'COOLDOWN_PERIOD', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'CROSS_CHAIN_CONTROLLER', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MIN_VOTING_DURATION', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'NAME', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PRECISION_DIVIDER', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PROPOSAL_EXPIRATION_TIME', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'VOTING_TOKENS_CAP', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], + name: 'activateVoting', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address[]', name: 'votingPortals', type: 'address[]' }], + name: 'addVotingPortals', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], + name: 'cancelProposal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'uint256', name: 'chain', type: 'uint256' }, + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { internalType: 'address', name: 'payloadsController', type: 'address' }, + { internalType: 'uint40', name: 'payloadId', type: 'uint40' }, + ], + internalType: 'struct PayloadsControllerUtils.Payload[]', + name: 'payloads', + type: 'tuple[]', + }, + { internalType: 'address', name: 'votingPortal', type: 'address' }, + { internalType: 'bytes32', name: 'ipfsHash', type: 'bytes32' }, + ], + name: 'createProposal', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], + name: 'executeProposal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getGasLimit', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPowerStrategy', + outputs: [{ internalType: 'contract IGovernancePowerStrategy', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], + name: 'getProposal', + outputs: [ + { + components: [ + { internalType: 'enum IGovernanceCore.State', name: 'state', type: 'uint8' }, + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { internalType: 'uint40', name: 'creationTime', type: 'uint40' }, + { internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, + { internalType: 'uint40', name: 'votingActivationTime', type: 'uint40' }, + { internalType: 'uint40', name: 'queuingTime', type: 'uint40' }, + { internalType: 'uint40', name: 'cancelTimestamp', type: 'uint40' }, + { internalType: 'address', name: 'creator', type: 'address' }, + { internalType: 'address', name: 'votingPortal', type: 'address' }, + { internalType: 'bytes32', name: 'snapshotBlockHash', type: 'bytes32' }, + { internalType: 'bytes32', name: 'ipfsHash', type: 'bytes32' }, + { internalType: 'uint128', name: 'forVotes', type: 'uint128' }, + { internalType: 'uint128', name: 'againstVotes', type: 'uint128' }, + { + components: [ + { internalType: 'uint256', name: 'chain', type: 'uint256' }, + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { internalType: 'address', name: 'payloadsController', type: 'address' }, + { internalType: 'uint40', name: 'payloadId', type: 'uint40' }, + ], + internalType: 'struct PayloadsControllerUtils.Payload[]', + name: 'payloads', + type: 'tuple[]', + }, + ], + internalType: 'struct IGovernanceCore.Proposal', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], + name: 'getProposalState', + outputs: [{ internalType: 'enum IGovernanceCore.State', name: '', type: 'uint8' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getProposalsCount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }], + name: 'getVotingConfig', + outputs: [ + { + components: [ + { internalType: 'uint24', name: 'coolDownBeforeVotingStart', type: 'uint24' }, + { internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, + { internalType: 'uint56', name: 'quorum', type: 'uint56' }, + { internalType: 'uint56', name: 'differential', type: 'uint56' }, + { internalType: 'uint56', name: 'minPropositionPower', type: 'uint56' }, + ], + internalType: 'struct IGovernanceCore.VotingConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getVotingPortalsCount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'guardian', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'guardian', type: 'address' }, + { internalType: 'contract IGovernancePowerStrategy', name: 'powerStrategy', type: 'address' }, + { + components: [ + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { internalType: 'uint24', name: 'coolDownBeforeVotingStart', type: 'uint24' }, + { internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, + { internalType: 'uint256', name: 'quorum', type: 'uint256' }, + { internalType: 'uint256', name: 'differential', type: 'uint256' }, + { internalType: 'uint256', name: 'minPropositionPower', type: 'uint256' }, + ], + internalType: 'struct IGovernanceCore.SetVotingConfigInput[]', + name: 'votingConfigs', + type: 'tuple[]', + }, + { internalType: 'address[]', name: 'votingPortals', type: 'address[]' }, + { internalType: 'uint256', name: 'gasLimit', type: 'uint256' }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'votingPortal', type: 'address' }], + name: 'isVotingPortalApproved', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, + { internalType: 'uint128', name: 'forVotes', type: 'uint128' }, + { internalType: 'uint128', name: 'againstVotes', type: 'uint128' }, + ], + name: 'queueProposal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address[]', name: 'votingPortals', type: 'address[]' }], + name: 'removeVotingPortals', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function' }, + { + inputs: [{ internalType: 'address', name: 'votingPortal', type: 'address' }], + name: 'rescueVotingPortal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'contract IGovernancePowerStrategy', name: 'powerStrategy', type: 'address' }], + name: 'setPowerStrategy', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, + { internalType: 'uint24', name: 'coolDownBeforeVotingStart', type: 'uint24' }, + { internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, + { internalType: 'uint256', name: 'quorum', type: 'uint256' }, + { internalType: 'uint256', name: 'differential', type: 'uint256' }, + { internalType: 'uint256', name: 'minPropositionPower', type: 'uint256' }, + ], + internalType: 'struct IGovernanceCore.SetVotingConfigInput[]', + name: 'votingConfigs', + type: 'tuple[]', + }, + ], + name: 'setVotingConfigs', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'gasLimit', type: 'uint256' }], + name: 'updateGasLimit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'newGuardian', type: 'address' }], + name: 'updateGuardian', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, + { internalType: 'bool', name: 'support', type: 'bool' }, + { + components: [ + { internalType: 'address', name: 'underlyingAsset', type: 'address' }, + { internalType: 'uint128', name: 'slot', type: 'uint128' }, + ], + internalType: 'struct IVotingMachineWithProofs.VotingAssetWithSlot[]', + name: 'votingAssetsWithSlot', + type: 'tuple[]', + }, + ], + name: 'voteViaPortal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const; diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts new file mode 100644 index 0000000..13f9b8b --- /dev/null +++ b/src/simulate/govv3/governance.ts @@ -0,0 +1,97 @@ +import { ContractFunctionResult, Hex, PublicClient, getContract } from 'viem'; +import { FilterLogWithTimestamp } from '../govv2/networks/types'; +import { GOVERNANCE_EXTENDED_ABI } from './abis/GovernanceExtended'; +import { getLogs } from '../../utils/logs'; + +type CreatedLog = FilterLogWithTimestamp; +type QueuedLog = FilterLogWithTimestamp; +type ExecutedLog = FilterLogWithTimestamp; +type PayloadSentLog = FilterLogWithTimestamp; + +interface Governance { + cacheLogs: () => Promise<{ + createdLogs: Array; + queuedLogs: Array; + executedLogs: Array; + payloadSentLogs: Array; + }>; + getProposal: ( + proposalId: bigint, + logs: Awaited> + ) => Promise<{ + proposal: ContractFunctionResult; + createdLog: CreatedLog; + queuedLog?: QueuedLog; + executedLog?: ExecutedLog; + payloadSentLog: PayloadSentLog[]; + }>; + simulateProposal: any; +} + +export const getGovernance = (address: Hex, publicClient: PublicClient, blockCreated?: bigint): Governance => { + const governanceContract = getContract({ abi: GOVERNANCE_EXTENDED_ABI, address, publicClient }); + + return { + async cacheLogs() { + const createdLogs = await getLogs(publicClient, (fromBlock, toBlock) => { + return governanceContract.createEventFilter.ProposalCreated( + {}, + { + fromBlock: fromBlock || blockCreated, + toBlock, + } + ); + }); + const queuedLogs = await getLogs(publicClient, (fromBlock, toBlock) => { + return governanceContract.createEventFilter.ProposalQueued( + {}, + { + fromBlock: fromBlock || blockCreated, + toBlock, + } + ); + }); + const executedLogs = await getLogs(publicClient, (fromBlock, toBlock) => { + return governanceContract.createEventFilter.ProposalExecuted( + {}, + { + fromBlock: fromBlock || blockCreated, + toBlock, + } + ); + }); + const payloadSentLogs = await getLogs(publicClient, (fromBlock, toBlock) => { + return governanceContract.createEventFilter.PayloadSent( + {}, + { + fromBlock: fromBlock || blockCreated, + toBlock, + } + ); + }); + return { createdLogs, queuedLogs, executedLogs, payloadSentLogs }; + }, + async getProposal(proposalId: bigint, logs: Awaited>) { + const proposal = await governanceContract.read.getProposal([proposalId]); + const createdLog = logs.createdLogs.find((log) => String(log.args.proposalId) === proposalId.toString())!; + const queuedLog = logs.queuedLogs.find((log) => String(log.args.proposalId) === proposalId.toString()); + const executedLog = logs.executedLogs.find((log) => String(log.args.proposalId) === proposalId.toString()); + const payloadSentLog = logs.payloadSentLogs.filter( + (log) => String(log.args.proposalId) === proposalId.toString() + ); + return { proposal, createdLog, queuedLog, executedLog, payloadSentLog }; + }, + // TODO + async simulateProposal() { + // # if executed just replay the txn + // # if queued + // 1. alter storage so it can be executed + // 2. execute + // # if created + // 1. alter storage so it's queued and can be executed + // 2. execute + // # if cancelled + // fork before cancelling & apply same rules as before + }, + }; +}; diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 3a855a5..b8a40a2 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -10,9 +10,13 @@ interface PayloadsController { queuedLogs: Array>; executedLogs: Array>; }>; + // executes an existing payload + simulateExecutionByIdOnTenderly: (id: bigint) => Promise; + // creates and executes a payload + // TODO: not sure yet about types etc } -const getPayloadsController = (address: Hex, publicClient: PublicClient): PayloadsController => { +export const getPayloadsController = (address: Hex, publicClient: PublicClient): PayloadsController => { const controllerContract = getContract({ abi: PAYLOADS_CONTROLLER_EXTENDED_ABI, address, publicClient }); return { cacheLogs: async () => { @@ -39,8 +43,6 @@ const getPayloadsController = (address: Hex, publicClient: PublicClient): Payloa }); return { createdLogs, queuedLogs, executedLogs }; }, - create: () => {}, - queue: () => {}, - execute: () => {}, + simulateExecutionByIdOnTenderly: async (id: bigint) => {}, }; }; diff --git a/src/simulate/govv3/simulate.ts b/src/simulate/govv3/simulate.ts new file mode 100644 index 0000000..7e488cd --- /dev/null +++ b/src/simulate/govv3/simulate.ts @@ -0,0 +1,19 @@ +import { AaveV3Sepolia } from '@bgd-labs/aave-address-book'; +import { logError, logInfo, logSuccess } from '../../utils/logger'; +import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; +import { getGovernance } from './governance'; +import { createPublicClient, http } from 'viem'; +import { sepolia } from 'viem/chains'; + +export async function simulateProposal(proposalId: bigint) { + logInfo('General', `Running simulation for ${proposalId}`); + const governance = getGovernance( + AaveV3Sepolia.GOVERNANCE, + createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }), + 3962575n + ); + const logs = await governance.cacheLogs(); + const proposal = await governance.getProposal(proposalId, logs); + console.log(proposal); + return {}; +} diff --git a/types.d.ts b/types.d.ts index 2efa8e8..e0729c1 100644 --- a/types.d.ts +++ b/types.d.ts @@ -3,5 +3,7 @@ declare namespace NodeJS { TENDERLY_ACCESS_TOKEN: string; TENDERLY_ACCOUNT: string; TENDERLY_PROJECT_SLUG: string; + + RPC_SEPOLIA: string; } } diff --git a/yarn.lock b/yarn.lock index 0ab0601..7b3c8e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,10 +33,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@bgd-labs/aave-address-book@^1.33.0": - version "1.33.0" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-1.33.0.tgz#2302e6f53a2b1529f5f071bd23fc603a84002559" - integrity sha512-ZXs5Xfb7AR0jTu557tkmdMhwPUBG+YHASxYyLN5P0LX7g0bCm4aFFSB8NgzhepqM7V6vXgYEEBijXPyGhSiweA== +"@bgd-labs/aave-address-book@1.33.1-e5554f111c11be63c08c5861c43bb27567e806a4.0": + version "1.33.1-e5554f111c11be63c08c5861c43bb27567e806a4.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-1.33.1-e5554f111c11be63c08c5861c43bb27567e806a4.0.tgz#c37c008e923b1eba8dc8a2c4f1427fac0861f888" + integrity sha512-5E6v9geue/5jGg/rT+W00Al9Jdhjhr1RMEfo7uwCIuUH6k8fgjngoAvzCOZxQzZZaczeBrkxLPixTXwO56u6Zw== "@esbuild-kit/cjs-loader@^2.4.2": version "2.4.2" From 1437828442a2ee2ca18b43c2e0d28e7d6c059f24 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 21 Aug 2023 22:31:11 +0200 Subject: [PATCH 03/94] fix: add startBlocks etc --- src/simulate/govv3/governance.ts | 88 +++++++++------- src/simulate/govv3/payloadsController.ts | 122 ++++++++++++++++++----- src/simulate/govv3/simulate.ts | 30 +++++- src/utils/logs.ts | 7 +- 4 files changed, 179 insertions(+), 68 deletions(-) diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index 13f9b8b..d48df52 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -33,42 +33,58 @@ export const getGovernance = (address: Hex, publicClient: PublicClient, blockCre return { async cacheLogs() { - const createdLogs = await getLogs(publicClient, (fromBlock, toBlock) => { - return governanceContract.createEventFilter.ProposalCreated( - {}, - { - fromBlock: fromBlock || blockCreated, - toBlock, - } - ); - }); - const queuedLogs = await getLogs(publicClient, (fromBlock, toBlock) => { - return governanceContract.createEventFilter.ProposalQueued( - {}, - { - fromBlock: fromBlock || blockCreated, - toBlock, - } - ); - }); - const executedLogs = await getLogs(publicClient, (fromBlock, toBlock) => { - return governanceContract.createEventFilter.ProposalExecuted( - {}, - { - fromBlock: fromBlock || blockCreated, - toBlock, - } - ); - }); - const payloadSentLogs = await getLogs(publicClient, (fromBlock, toBlock) => { - return governanceContract.createEventFilter.PayloadSent( - {}, - { - fromBlock: fromBlock || blockCreated, - toBlock, - } - ); - }); + const createdLogs = await getLogs( + publicClient, + (fromBlock, toBlock) => { + return governanceContract.createEventFilter.ProposalCreated( + {}, + { + fromBlock: fromBlock, + toBlock, + } + ); + }, + blockCreated + ); + const queuedLogs = await getLogs( + publicClient, + (fromBlock, toBlock) => { + return governanceContract.createEventFilter.ProposalQueued( + {}, + { + fromBlock: fromBlock, + toBlock, + } + ); + }, + blockCreated + ); + const executedLogs = await getLogs( + publicClient, + (fromBlock, toBlock) => { + return governanceContract.createEventFilter.ProposalExecuted( + {}, + { + fromBlock: fromBlock, + toBlock, + } + ); + }, + blockCreated + ); + const payloadSentLogs = await getLogs( + publicClient, + (fromBlock, toBlock) => { + return governanceContract.createEventFilter.PayloadSent( + {}, + { + fromBlock: fromBlock, + toBlock, + } + ); + }, + blockCreated + ); return { createdLogs, queuedLogs, executedLogs, payloadSentLogs }; }, async getProposal(proposalId: bigint, logs: Awaited>) { diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index b8a40a2..11e79e6 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -1,48 +1,116 @@ -import { Hex, PublicClient, getContract } from 'viem'; +import { ContractFunctionResult, Hex, PublicClient, encodeFunctionData, getContract, toHex } from 'viem'; import { PAYLOADS_CONTROLLER_EXTENDED_ABI } from './abis/PayloadsControllerExtended'; import { getLogs } from '../../utils/logs'; import { FilterLogWithTimestamp } from '../govv2/networks/types'; +import { TenderlyRequest, tenderly } from '../../utils/tenderlyClient'; +import { TenderlySimulationResponse } from '../../../dist'; +import { EOA } from '../../utils/constants'; + +type PayloadCreatedLog = FilterLogWithTimestamp; +type PayloadQueuedLog = FilterLogWithTimestamp; +type PayloadExecutedLog = FilterLogWithTimestamp; interface PayloadsController { // cache created / queued / Executed logs cacheLogs: () => Promise<{ - createdLogs: Array>; - queuedLogs: Array>; - executedLogs: Array>; + createdLogs: Array; + queuedLogs: Array; + executedLogs: Array; }>; // executes an existing payload - simulateExecutionByIdOnTenderly: (id: bigint) => Promise; + getPayload: ( + id: number, + logs: Awaited> + ) => Promise<{ + payload: ContractFunctionResult; + createdLog: PayloadCreatedLog; + queuedLog?: PayloadQueuedLog; + executedLog?: PayloadExecutedLog; + }>; + simulatePayloadExecutionOnTenderly: ( + id: number, + logs: Awaited> + ) => Promise; // creates and executes a payload // TODO: not sure yet about types etc } -export const getPayloadsController = (address: Hex, publicClient: PublicClient): PayloadsController => { +export const getPayloadsController = ( + address: Hex, + publicClient: PublicClient, + blockCreated?: bigint +): PayloadsController => { const controllerContract = getContract({ abi: PAYLOADS_CONTROLLER_EXTENDED_ABI, address, publicClient }); return { cacheLogs: async () => { - const createdLogs = await getLogs(publicClient, (fromBLock, toBlock) => { - return controllerContract.createEventFilter.PayloadCreated( - {}, - { - fromBlock: fromBLock, + const createdLogs = await getLogs( + publicClient, + (fromBlock, toBlock) => { + return controllerContract.createEventFilter.PayloadCreated( + {}, + { + fromBlock: fromBlock, + toBlock: toBlock, + } + ); + }, + blockCreated + ); + const queuedLogs = await getLogs( + publicClient, + (fromBlock, toBlock) => { + return controllerContract.createEventFilter.PayloadQueued({ + fromBlock: fromBlock, + toBlock: toBlock, + }); + }, + blockCreated + ); + const executedLogs = await getLogs( + publicClient, + (fromBlock, toBlock) => { + return controllerContract.createEventFilter.PayloadExecuted({ + fromBlock: fromBlock, toBlock: toBlock, - } - ); - }); - const queuedLogs = await getLogs(publicClient, (fromBLock, toBlock) => { - return controllerContract.createEventFilter.PayloadQueued({ - fromBlock: fromBLock, - toBlock: toBlock, - }); - }); - const executedLogs = await getLogs(publicClient, (fromBLock, toBlock) => { - return controllerContract.createEventFilter.PayloadExecuted({ - fromBlock: fromBLock, - toBlock: toBlock, - }); - }); + }); + }, + blockCreated + ); return { createdLogs, queuedLogs, executedLogs }; }, - simulateExecutionByIdOnTenderly: async (id: bigint) => {}, + getPayload: async (id, logs) => { + const createdLog = logs.createdLogs.find((l) => l.args.payloadId === id)!; + if (!createdLog) throw new Error(`Could not find payload ${id} on ${publicClient.chain!.id}`); + const queuedLog = logs.queuedLogs.find((l) => l.args.payloadId === id); + const executedLog = logs.executedLogs.find((l) => l.args.payloadId === id); + const payload = await controllerContract.read.getPayloadById([id]); + return { createdLog, queuedLog, executedLog, payload }; + }, + simulatePayloadExecutionOnTenderly: async (id, { executedLog, payload, queuedLog }) => { + if (executedLog) { + const tx = await publicClient.getTransaction({ hash: executedLog.transactionHash! }); + return tenderly.simulateTx(publicClient.chain!.id, tx); + } + const currentBlock = await publicClient.getBlock(); + const simulationPayload = { + network_id: String(publicClient.chain!.id), + from: EOA, + to: controllerContract.address, + input: encodeFunctionData({ + abi: PAYLOADS_CONTROLLER_EXTENDED_ABI, + functionName: 'executePayload', + args: [id], + }), + block_header: { + timestamp: toHex(BigInt(payload.queuedAt + payload.gracePeriod)), + }, + }; + if (queuedLog) { + } else { + // TODO: overwrite state so it's queued etc + } + + return tenderly.simulate(simulationPayload); + }, }; }; diff --git a/src/simulate/govv3/simulate.ts b/src/simulate/govv3/simulate.ts index 7e488cd..b25ae34 100644 --- a/src/simulate/govv3/simulate.ts +++ b/src/simulate/govv3/simulate.ts @@ -3,7 +3,24 @@ import { logError, logInfo, logSuccess } from '../../utils/logger'; import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; import { getGovernance } from './governance'; import { createPublicClient, http } from 'viem'; -import { sepolia } from 'viem/chains'; +import { sepolia, polygonMumbai, bscTestnet, avalancheFuji } from 'viem/chains'; +import { getPayloadsController } from './payloadsController'; + +const CHAIN_ID_CLIENT_MAP = { + [sepolia.id]: { client: createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }) }, + [polygonMumbai.id]: { + client: createPublicClient({ chain: polygonMumbai, transport: http(process.env.RPC_POLYGON_MUMBAI) }), + blockCreated: 38318051n, + }, + [bscTestnet.id]: { + client: createPublicClient({ chain: bscTestnet, transport: http(process.env.RPC_BSC_TESTNET) }), + blockCreated: 31893040n, + }, + [avalancheFuji.id]: { + client: createPublicClient({ chain: avalancheFuji, transport: http(process.env.RPC_AVALANCHE_FUJI) }), + blockCreated: 24512916n, + }, +} as const; export async function simulateProposal(proposalId: bigint) { logInfo('General', `Running simulation for ${proposalId}`); @@ -14,6 +31,15 @@ export async function simulateProposal(proposalId: bigint) { ); const logs = await governance.cacheLogs(); const proposal = await governance.getProposal(proposalId, logs); - console.log(proposal); + for (const payload of proposal.proposal.payloads) { + const controllerContract = getPayloadsController( + payload.payloadsController, + CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP].client, + CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP].blockCreated + ); + const logs = await controllerContract.cacheLogs(); + const config = await controllerContract.getPayload(payload.payloadId, logs); + const result = await controllerContract.simulatePayloadExecutionOnTenderly(payload.payloadId, config); + } return {}; } diff --git a/src/utils/logs.ts b/src/utils/logs.ts index b16bcbd..5a6f0dc 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -13,12 +13,13 @@ import { FilterLogWithTimestamp } from '../simulate/govv2/networks/types'; */ export async function getLogs( client: PublicClient, - filterFn: (from: bigint, to?: bigint) => Promise['filter']> + filterFn: (from: bigint, to?: bigint) => Promise['filter']>, + fromBlock?: bigint ): Promise>> { // create cache folder if doesn't exist yet const cachePath = path.join(process.cwd(), 'cache', client.chain!.id.toString()); const currentBlock = await client.getBlockNumber(); - const filter = await filterFn(0n); + const filter = await filterFn(fromBlock || 0n); const filePath = path.join(cachePath, filter.eventName + '.json'); if (!fs.existsSync(cachePath)) { fs.mkdirSync(cachePath, { recursive: true }); @@ -29,7 +30,7 @@ export async function getLogs( : []; const logs = await getPastLogsRecursive( client, - cache.length > 0 ? BigInt(cache[cache.length - 1].blockNumber as bigint) + 1n : filter.fromBlock!, + cache.length > 0 ? BigInt(cache[cache.length - 1].blockNumber as bigint) + 1n : filter.fromBlock || fromBlock || 0n, currentBlock, filterFn ); From f9dffad73adcac06d6605661224dd3aed7e73a47 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 22 Aug 2023 13:50:02 +0200 Subject: [PATCH 04/94] fix: properly allow simulations --- src/index.ts | 1 + src/simulate/govv3/payloadsController.ts | 29 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/index.ts b/src/index.ts index 433e755..5bde2de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ export * from './reports/diff-reports'; export { simulateProposal } from './simulate/govv2/simulate'; +export { simulateProposal as simulateProposalV3 } from './simulate/govv3/simulate'; export * from './utils/tenderlyClient'; export * from './simulate/govv2/networks/types'; diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 11e79e6..fa38c2b 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -1,10 +1,11 @@ -import { ContractFunctionResult, Hex, PublicClient, encodeFunctionData, getContract, toHex } from 'viem'; +import { ContractFunctionResult, Hex, PublicClient, encodeFunctionData, encodePacked, getContract, toHex } from 'viem'; import { PAYLOADS_CONTROLLER_EXTENDED_ABI } from './abis/PayloadsControllerExtended'; import { getLogs } from '../../utils/logs'; import { FilterLogWithTimestamp } from '../govv2/networks/types'; import { TenderlyRequest, tenderly } from '../../utils/tenderlyClient'; import { TenderlySimulationResponse } from '../../../dist'; import { EOA } from '../../utils/constants'; +import { getSolidityStorageSlotUint } from '../../utils/storageSlots'; type PayloadCreatedLog = FilterLogWithTimestamp; type PayloadQueuedLog = FilterLogWithTimestamp; @@ -86,13 +87,14 @@ export const getPayloadsController = ( const payload = await controllerContract.read.getPayloadById([id]); return { createdLog, queuedLog, executedLog, payload }; }, - simulatePayloadExecutionOnTenderly: async (id, { executedLog, payload, queuedLog }) => { + simulatePayloadExecutionOnTenderly: async (id, { executedLog, payload }) => { + // if successfully executed just replay the txn if (executedLog) { const tx = await publicClient.getTransaction({ hash: executedLog.transactionHash! }); return tenderly.simulateTx(publicClient.chain!.id, tx); } const currentBlock = await publicClient.getBlock(); - const simulationPayload = { + const simulationPayload: TenderlyRequest = { network_id: String(publicClient.chain!.id), from: EOA, to: controllerContract.address, @@ -101,14 +103,23 @@ export const getPayloadsController = ( functionName: 'executePayload', args: [id], }), - block_header: { - timestamp: toHex(BigInt(payload.queuedAt + payload.gracePeriod)), + state_objects: { + [controllerContract.address]: { + storage: { + [getSolidityStorageSlotUint(3n, BigInt(id))]: encodePacked( + ['uint40', 'uint40', 'uint8', 'uint8', 'address'], + [ + Number(currentBlock.timestamp - BigInt(payload.delay) - 1n), // altering queued time so can be executed in current block + payload.createdAt, + 2, // QUEUED - might make sense to enum + payload.maximumAccessLevelRequired, + payload.creator, + ] + ), + }, + }, }, }; - if (queuedLog) { - } else { - // TODO: overwrite state so it's queued etc - } return tenderly.simulate(simulationPayload); }, From 5d17f393168cb710bdb6475a03080c9500993029 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 22 Aug 2023 14:32:58 +0200 Subject: [PATCH 05/94] fix: return response --- src/simulate/govv3/payloadsController.ts | 2 +- src/simulate/govv3/simulate.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index fa38c2b..8d54500 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -11,7 +11,7 @@ type PayloadCreatedLog = FilterLogWithTimestamp; type PayloadExecutedLog = FilterLogWithTimestamp; -interface PayloadsController { +export interface PayloadsController { // cache created / queued / Executed logs cacheLogs: () => Promise<{ createdLogs: Array; diff --git a/src/simulate/govv3/simulate.ts b/src/simulate/govv3/simulate.ts index b25ae34..db9fd79 100644 --- a/src/simulate/govv3/simulate.ts +++ b/src/simulate/govv3/simulate.ts @@ -4,7 +4,7 @@ import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; import { getGovernance } from './governance'; import { createPublicClient, http } from 'viem'; import { sepolia, polygonMumbai, bscTestnet, avalancheFuji } from 'viem/chains'; -import { getPayloadsController } from './payloadsController'; +import { PayloadsController, getPayloadsController } from './payloadsController'; const CHAIN_ID_CLIENT_MAP = { [sepolia.id]: { client: createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }) }, @@ -31,6 +31,10 @@ export async function simulateProposal(proposalId: bigint) { ); const logs = await governance.cacheLogs(); const proposal = await governance.getProposal(proposalId, logs); + const payloads: { + payload: Awaited>; + simulation: TenderlySimulationResponse; + }[] = []; for (const payload of proposal.proposal.payloads) { const controllerContract = getPayloadsController( payload.payloadsController, @@ -40,6 +44,7 @@ export async function simulateProposal(proposalId: bigint) { const logs = await controllerContract.cacheLogs(); const config = await controllerContract.getPayload(payload.payloadId, logs); const result = await controllerContract.simulatePayloadExecutionOnTenderly(payload.payloadId, config); + payloads.push({ payload: config, simulation: result }); } - return {}; + return { proposal, payloads }; } From d5197609e6f452b94533b2d508924e9a7c134733 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 22 Aug 2023 15:00:18 +0200 Subject: [PATCH 06/94] fix: add seplia blockCreated --- src/simulate/govv3/simulate.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/simulate/govv3/simulate.ts b/src/simulate/govv3/simulate.ts index db9fd79..35f973f 100644 --- a/src/simulate/govv3/simulate.ts +++ b/src/simulate/govv3/simulate.ts @@ -7,7 +7,10 @@ import { sepolia, polygonMumbai, bscTestnet, avalancheFuji } from 'viem/chains'; import { PayloadsController, getPayloadsController } from './payloadsController'; const CHAIN_ID_CLIENT_MAP = { - [sepolia.id]: { client: createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }) }, + [sepolia.id]: { + client: createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }), + blockCreated: 3967960n, + }, [polygonMumbai.id]: { client: createPublicClient({ chain: polygonMumbai, transport: http(process.env.RPC_POLYGON_MUMBAI) }), blockCreated: 38318051n, From cc7e313bf87228df956e9258232b30163f65f45e Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 22 Aug 2023 15:02:59 +0200 Subject: [PATCH 07/94] fix: require gov address --- src/commands/simulate-proposal-v3.ts | 3 ++- src/simulate/govv3/simulate.ts | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/commands/simulate-proposal-v3.ts b/src/commands/simulate-proposal-v3.ts index a35bdcf..3fb09c7 100644 --- a/src/commands/simulate-proposal-v3.ts +++ b/src/commands/simulate-proposal-v3.ts @@ -1,4 +1,5 @@ import { simulateProposal } from '../simulate/govv3/simulate'; +import { AaveV3Sepolia } from '@bgd-labs/aave-address-book'; export const command = 'simulate-proposal-v3 [proposalId]'; @@ -7,6 +8,6 @@ export const describe = 'simulates a aave v3 governance proposal'; export const handler = async function (argv) { if (!argv.proposalId) throw new Error('proposalId is required'); const proposalId = BigInt(argv.proposalId); - const result = await simulateProposal(proposalId); + const result = await simulateProposal(AaveV3Sepolia.GOVERNANCE, proposalId); // console.log(result); }; diff --git a/src/simulate/govv3/simulate.ts b/src/simulate/govv3/simulate.ts index 35f973f..c123805 100644 --- a/src/simulate/govv3/simulate.ts +++ b/src/simulate/govv3/simulate.ts @@ -2,7 +2,7 @@ import { AaveV3Sepolia } from '@bgd-labs/aave-address-book'; import { logError, logInfo, logSuccess } from '../../utils/logger'; import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; import { getGovernance } from './governance'; -import { createPublicClient, http } from 'viem'; +import { Hex, createPublicClient, http } from 'viem'; import { sepolia, polygonMumbai, bscTestnet, avalancheFuji } from 'viem/chains'; import { PayloadsController, getPayloadsController } from './payloadsController'; @@ -25,10 +25,10 @@ const CHAIN_ID_CLIENT_MAP = { }, } as const; -export async function simulateProposal(proposalId: bigint) { +export async function simulateProposal(governanceAddress: Hex, proposalId: bigint) { logInfo('General', `Running simulation for ${proposalId}`); const governance = getGovernance( - AaveV3Sepolia.GOVERNANCE, + governanceAddress, createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }), 3962575n ); From abbe436259335e2366201eb487572e92f4527096 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 22 Aug 2023 15:09:24 +0200 Subject: [PATCH 08/94] fix: broken import --- src/simulate/govv3/payloadsController.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 8d54500..2e7d633 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -2,8 +2,7 @@ import { ContractFunctionResult, Hex, PublicClient, encodeFunctionData, encodePa import { PAYLOADS_CONTROLLER_EXTENDED_ABI } from './abis/PayloadsControllerExtended'; import { getLogs } from '../../utils/logs'; import { FilterLogWithTimestamp } from '../govv2/networks/types'; -import { TenderlyRequest, tenderly } from '../../utils/tenderlyClient'; -import { TenderlySimulationResponse } from '../../../dist'; +import { TenderlyRequest, tenderly, TenderlySimulationResponse } from '../../utils/tenderlyClient'; import { EOA } from '../../utils/constants'; import { getSolidityStorageSlotUint } from '../../utils/storageSlots'; From 5042db002e47903bd21c43e961cb6a75b0b71472 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 22 Aug 2023 15:27:51 +0200 Subject: [PATCH 09/94] feat: add some exports --- src/index.ts | 2 ++ src/simulate/govv3/governance.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5bde2de..6a88d12 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,7 @@ export * from './reports/diff-reports'; export { simulateProposal } from './simulate/govv2/simulate'; export { simulateProposal as simulateProposalV3 } from './simulate/govv3/simulate'; +export { getGovernance, Governance } from './simulate/govv3/governance'; +export { getPayloadsController, PayloadsController } from './simulate/govv3/payloadsController'; export * from './utils/tenderlyClient'; export * from './simulate/govv2/networks/types'; diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index d48df52..4648a8b 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -8,7 +8,7 @@ type QueuedLog = FilterLogWithTimestamp; type PayloadSentLog = FilterLogWithTimestamp; -interface Governance { +export interface Governance { cacheLogs: () => Promise<{ createdLogs: Array; queuedLogs: Array; From 606a867ec32cc585173cc1ffa5c7e6948b0d5f0c Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 22 Aug 2023 15:51:05 +0200 Subject: [PATCH 10/94] fix: expose enum --- src/index.ts | 5 +++-- src/simulate/govv3/governance.ts | 4 +++- src/simulate/govv3/payloadsController.ts | 22 +++++++++++++++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6a88d12..abfbc98 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,8 @@ export * from './reports/diff-reports'; export { simulateProposal } from './simulate/govv2/simulate'; export { simulateProposal as simulateProposalV3 } from './simulate/govv3/simulate'; -export { getGovernance, Governance } from './simulate/govv3/governance'; -export { getPayloadsController, PayloadsController } from './simulate/govv3/payloadsController'; +export * from './simulate/govv3/governance'; +export * from './simulate/govv3/payloadsController'; export * from './utils/tenderlyClient'; export * from './simulate/govv2/networks/types'; +export * from './utils/logger'; diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index 4648a8b..b4c2887 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -1,4 +1,4 @@ -import { ContractFunctionResult, Hex, PublicClient, getContract } from 'viem'; +import { ContractFunctionResult, GetContractReturnType, Hex, PublicClient, getContract } from 'viem'; import { FilterLogWithTimestamp } from '../govv2/networks/types'; import { GOVERNANCE_EXTENDED_ABI } from './abis/GovernanceExtended'; import { getLogs } from '../../utils/logs'; @@ -9,6 +9,7 @@ type ExecutedLog = FilterLogWithTimestamp; export interface Governance { + governanceContract: GetContractReturnType; cacheLogs: () => Promise<{ createdLogs: Array; queuedLogs: Array; @@ -32,6 +33,7 @@ export const getGovernance = (address: Hex, publicClient: PublicClient, blockCre const governanceContract = getContract({ abi: GOVERNANCE_EXTENDED_ABI, address, publicClient }); return { + governanceContract, async cacheLogs() { const createdLogs = await getLogs( publicClient, diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 2e7d633..79fe67f 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -1,4 +1,13 @@ -import { ContractFunctionResult, Hex, PublicClient, encodeFunctionData, encodePacked, getContract, toHex } from 'viem'; +import { + ContractFunctionResult, + GetContractReturnType, + Hex, + PublicClient, + encodeFunctionData, + encodePacked, + getContract, + toHex, +} from 'viem'; import { PAYLOADS_CONTROLLER_EXTENDED_ABI } from './abis/PayloadsControllerExtended'; import { getLogs } from '../../utils/logs'; import { FilterLogWithTimestamp } from '../govv2/networks/types'; @@ -10,7 +19,17 @@ type PayloadCreatedLog = FilterLogWithTimestamp; type PayloadExecutedLog = FilterLogWithTimestamp; +export enum PayloadState { + None, + Created, + Queued, + Executed, + Cancelled, + Expired, +} + export interface PayloadsController { + controllerContract: GetContractReturnType; // cache created / queued / Executed logs cacheLogs: () => Promise<{ createdLogs: Array; @@ -42,6 +61,7 @@ export const getPayloadsController = ( ): PayloadsController => { const controllerContract = getContract({ abi: PAYLOADS_CONTROLLER_EXTENDED_ABI, address, publicClient }); return { + controllerContract, cacheLogs: async () => { const createdLogs = await getLogs( publicClient, From 28e783e73bfd0cbba51cef4e5a32cc94eddb9a64 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 22 Aug 2023 15:58:00 +0200 Subject: [PATCH 11/94] fix: export correct type --- src/simulate/govv3/governance.ts | 2 +- src/simulate/govv3/payloadsController.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index b4c2887..7e42ee2 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -9,7 +9,7 @@ type ExecutedLog = FilterLogWithTimestamp; export interface Governance { - governanceContract: GetContractReturnType; + governanceContract: GetContractReturnType; cacheLogs: () => Promise<{ createdLogs: Array; queuedLogs: Array; diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 79fe67f..0e9443d 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -29,7 +29,7 @@ export enum PayloadState { } export interface PayloadsController { - controllerContract: GetContractReturnType; + controllerContract: GetContractReturnType; // cache created / queued / Executed logs cacheLogs: () => Promise<{ createdLogs: Array; From 453d2a78d5ffc095ba641350a6e82f4cad9fdf18 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 23 Aug 2023 12:07:56 +0200 Subject: [PATCH 12/94] feat: add reports generator --- package.json | 2 +- src/index.ts | 1 + src/simulate/govv3/abis/ERC20.ts | 16 ++ src/simulate/govv3/checks/logs.ts | 44 +++++ src/simulate/govv3/checks/selfDestruct.ts | 109 +++++++++++++ src/simulate/govv3/checks/targets-verified.ts | 78 +++++++++ src/simulate/govv3/checks/types.ts | 18 +++ src/simulate/govv3/generatePayloadReport.ts | 152 ++++++++++++++++++ src/simulate/govv3/payloadsController.ts | 3 +- src/simulate/govv3/simulate.ts | 9 ++ src/simulate/govv3/utils/markdownUtils.ts | 26 +++ src/simulate/govv3/utils/solidityUtils.ts | 52 ++++++ .../govv3/utils/stateDiffInterpreter.ts | 113 +++++++++++++ src/simulate/govv3/utils/tenderlyDeepDiff.ts | 28 ++++ src/utils/tenderlyClient.ts | 14 ++ yarn.lock | 8 +- 16 files changed, 667 insertions(+), 6 deletions(-) create mode 100644 src/simulate/govv3/abis/ERC20.ts create mode 100644 src/simulate/govv3/checks/logs.ts create mode 100644 src/simulate/govv3/checks/selfDestruct.ts create mode 100644 src/simulate/govv3/checks/targets-verified.ts create mode 100644 src/simulate/govv3/checks/types.ts create mode 100644 src/simulate/govv3/generatePayloadReport.ts create mode 100644 src/simulate/govv3/utils/markdownUtils.ts create mode 100644 src/simulate/govv3/utils/solidityUtils.ts create mode 100644 src/simulate/govv3/utils/stateDiffInterpreter.ts create mode 100644 src/simulate/govv3/utils/tenderlyDeepDiff.ts diff --git a/package.json b/package.json index cad88e0..742c858 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.6.2", + "viem": "^1.6.7", "yargs": "^17.7.2", "zod": "^3.21.4" } diff --git a/src/index.ts b/src/index.ts index abfbc98..f88333a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ export { simulateProposal } from './simulate/govv2/simulate'; export { simulateProposal as simulateProposalV3 } from './simulate/govv3/simulate'; export * from './simulate/govv3/governance'; export * from './simulate/govv3/payloadsController'; +export * from './simulate/govv3/generatePayloadReport'; export * from './utils/tenderlyClient'; export * from './simulate/govv2/networks/types'; export * from './utils/logger'; diff --git a/src/simulate/govv3/abis/ERC20.ts b/src/simulate/govv3/abis/ERC20.ts new file mode 100644 index 0000000..580fd6c --- /dev/null +++ b/src/simulate/govv3/abis/ERC20.ts @@ -0,0 +1,16 @@ +export const ERC20_ABI = [ + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] as const; diff --git a/src/simulate/govv3/checks/logs.ts b/src/simulate/govv3/checks/logs.ts new file mode 100644 index 0000000..c7e0ffa --- /dev/null +++ b/src/simulate/govv3/checks/logs.ts @@ -0,0 +1,44 @@ +import { getAddress } from 'viem'; +import { ProposalCheck } from './types'; +import { Log } from '../../../utils/tenderlyClient'; +import { getContractName } from '../utils/solidityUtils'; + +/** + * Reports all emitted events from the proposal + */ +export const checkLogs: ProposalCheck = { + name: 'Reports all events emitted from the proposal', + async checkProposal(proposal, sim, deps) { + let info = []; + const events = sim.transaction.transaction_info.logs?.reduce((logs, log) => { + const addr = getAddress(log.raw.address); + if (!logs[addr]) logs[addr] = [log]; + else logs[addr].push(log); + return logs; + }, {} as Record); + + // Return if no events to show + if (!events || !Object.keys(events).length) return { info: ['No events emitted'], warnings: [], errors: [] }; + + // Parse each event + for (const [address, logs] of Object.entries(events)) { + // Use contracts array to get contract name of address + info.push(`- ${getContractName(sim.contracts, address)}`); + + // Format log data for report + logs.forEach((log) => { + if (Boolean(log.name)) { + // Log is decoded, format data as: VotingDelaySet(oldVotingDelay: value, newVotingDelay: value) + const parsedInputs = log.inputs?.map((i) => `${i.soltype!.name}: ${i.value}`).join(', '); + info.push(`- \`${log.name}(${parsedInputs || ''})\``); + } else { + // Log is not decoded, report the raw data + // TODO find a transaction with undecoded logs to know how topics/data are formatted in simulation response + info.push(`- Undecoded log: \`${JSON.stringify(log)}\``); + } + }); + } + + return { info, warnings: [], errors: [] }; + }, +}; diff --git a/src/simulate/govv3/checks/selfDestruct.ts b/src/simulate/govv3/checks/selfDestruct.ts new file mode 100644 index 0000000..6708543 --- /dev/null +++ b/src/simulate/govv3/checks/selfDestruct.ts @@ -0,0 +1,109 @@ +// Based on https://github.com/Uniswap/governance-seatbelt/blob/main/checks/check-targets-no-selfdestruct.ts +// adjusted for viem & aave governance v3 +import { Hex, PublicClient } from 'viem'; +import { ProposalCheck } from './types'; +import { toAddressLink } from '../utils/markdownUtils'; + +/** + * Check all targets with code if they contain selfdestruct. + */ +export const checkTargetsNoSelfdestruct: ProposalCheck = { + name: 'Check all targets do not contain selfdestruct', + async checkProposal(proposal, sim, publicClient) { + const allTargets = proposal.payload.actions.map((action) => action.target); + const uniqueTargets = allTargets.filter((addr, i, targets) => targets.indexOf(addr) === i); + const { info, warn, error } = await checkNoSelfdestructs([], uniqueTargets, publicClient); + return { info, warnings: warn, errors: error }; + }, +}; + +/** + * Check all touched contracts with code if they contain selfdestruct. + */ +export const checkTouchedContractsNoSelfdestruct: ProposalCheck = { + name: 'Check all touched contracts do not contain selfdestruct', + async checkProposal(proposal, sim, publicClient) { + const { info, warn, error } = await checkNoSelfdestructs([], sim.transaction.addresses, publicClient); + return { info, warnings: warn, errors: error }; + }, +}; + +/** + * For a given simulation response, check if a set of addresses contain selfdestruct. + */ +async function checkNoSelfdestructs( + trustedAddrs: Hex[], + addresses: Hex[], + provider: PublicClient +): Promise<{ info: string[]; warn: string[]; error: string[] }> { + const info: string[] = []; + const warn: string[] = []; + const error: string[] = []; + for (const addr of addresses) { + const status = await checkNoSelfdestruct(trustedAddrs, addr, provider); + const address = toAddressLink(addr, false, provider); + if (status === 'eoa') info.push(`- ${address}: EOA`); + else if (status === 'empty') warn.push(`- ${address}: EOA (may have code later)`); + else if (status === 'safe') info.push(`- ${address}: Contract (looks safe)`); + else if (status === 'delegatecall') warn.push(`- ${address}: Contract (with DELEGATECALL)`); + else if (status === 'trusted') info.push(`- ${address}: Trusted contract (not checked)`); + else error.push(`- ${address}: Contract (with SELFDESTRUCT)`); + } + return { info, warn, error }; +} + +const STOP = 0x00; +const JUMPDEST = 0x5b; +const PUSH1 = 0x60; +const PUSH32 = 0x7f; +const RETURN = 0xf3; +const REVERT = 0xfd; +const INVALID = 0xfe; +const SELFDESTRUCT = 0xff; +const DELEGATECALL = 0xf4; + +const isHalting = (opcode: number): boolean => [STOP, RETURN, REVERT, INVALID, SELFDESTRUCT].includes(opcode); +const isPUSH = (opcode: number): boolean => opcode >= PUSH1 && opcode <= PUSH32; + +/** + * For a given address, check if it's an EOA, a safe contract, or a contract contain selfdestruct. + */ +async function checkNoSelfdestruct( + trustedAddrs: Hex[], + addr: Hex, + provider: PublicClient +): Promise<'safe' | 'eoa' | 'empty' | 'selfdestruct' | 'delegatecall' | 'trusted'> { + if (trustedAddrs.map((addr) => addr.toLowerCase()).includes(addr.toLowerCase())) return 'trusted'; + + const [code, nonce] = await Promise.all([ + provider.getBytecode({ address: addr }), + provider.getTransactionCount({ address: addr }), + ]); + + // If there is no code and nonce is > 0 then it's an EOA. + // If nonce is 0 it is an empty account that might have code later. + // A contract might have nonce > 0, but then it will have code. + // If it had code, but was selfdestructed, the nonce should be reset to 0. + if (!code) return nonce > 0 ? 'eoa' : 'empty'; + + // Detection logic from https://github.com/MrLuit/selfdestruct-detect + const bytecode = Buffer.from(code.substring(2), 'hex'); + let halted = false; + let delegatecall = false; + for (let index = 0; index < bytecode.length; index++) { + const opcode = bytecode[index]; + if (opcode === SELFDESTRUCT && !halted) { + return 'selfdestruct'; + } else if (opcode === DELEGATECALL && !halted) { + delegatecall = true; + } else if (opcode === JUMPDEST) { + halted = false; + } else if (isHalting(opcode)) { + halted = true; + } else if (isPUSH(opcode)) { + index += opcode - PUSH1 + 0x01; + } + } + + return delegatecall ? 'delegatecall' : 'safe'; +} diff --git a/src/simulate/govv3/checks/targets-verified.ts b/src/simulate/govv3/checks/targets-verified.ts new file mode 100644 index 0000000..2bd062b --- /dev/null +++ b/src/simulate/govv3/checks/targets-verified.ts @@ -0,0 +1,78 @@ +import { Hex, PublicClient } from 'viem'; +import { ProposalCheck } from './types'; +import { TenderlySimulationResponse } from '../../../utils/tenderlyClient'; + +/** + * Check all targets with code are verified on Etherscan + */ +export const checkTargetsVerifiedEtherscan: ProposalCheck = { + name: 'Check all targets are verified on Etherscan', + async checkProposal(proposal, sim, publicClient) { + const allTargets = proposal.payload.actions.map((action) => action.target); + const uniqueTargets = allTargets.filter((addr, i, targets) => targets.indexOf(addr) === i); + const info = await checkVerificationStatuses(sim, uniqueTargets, publicClient); + return { info, warnings: [], errors: [] }; + }, +}; + +/** + * Check all touched contracts with code are verified on Etherscan + */ +export const checkTouchedContractsVerifiedEtherscan: ProposalCheck = { + name: 'Check all touched contracts are verified on Etherscan', + async checkProposal(proposal, sim, publicClient) { + const info = await checkVerificationStatuses(sim, sim.transaction.addresses, publicClient); + return { info, warnings: [], errors: [] }; + }, +}; + +/** + * For a given simulation response, check verification status of a set of addresses + */ +async function checkVerificationStatuses( + sim: TenderlySimulationResponse, + addresses: Hex[], + provider: PublicClient +): Promise { + let info = []; // prepare output + for (const addr of addresses) { + const status = await checkVerificationStatus(sim, addr, provider); + if (status === 'eoa') { + info.push(`- ${addr}: EOA (verification not applicable)`); + } else if (status === 'verified') { + const contract = getContract(sim, addr); + info.push(`- ${addr}: Contract (verified) (${contract?.contract_name})`); + } else { + info.push(`- ${addr}: Contract (not verified)`); + } + } + return info; +} + +/** + * For a given address, check if it's an EOA, a verified contract, or an unverified contract + */ +async function checkVerificationStatus( + sim: TenderlySimulationResponse, + addr: Hex, + provider: PublicClient +): Promise<'verified' | 'eoa' | 'unverified'> { + // If an address exists in the contracts array, it's verified on Etherscan + const contract = getContract(sim, addr); + if (contract) return 'verified'; + const stateDiff = getStateDiff(sim, addr); + if (stateDiff) return 'unverified'; + // Otherwise, check if there's code at the address. Addresses with code not in the contracts array are not verified + const code = await provider.getBytecode({ address: addr }); + return code === undefined ? 'eoa' : 'unverified'; +} + +function getContract(sim: TenderlySimulationResponse, addr: string) { + return sim.contracts.find((item) => item.address === addr); +} + +function getStateDiff(sim: TenderlySimulationResponse, addr: string) { + return sim.transaction.transaction_info.state_diff?.find( + (diff) => diff.raw?.[0]?.address.toLowerCase() === addr.toLowerCase() + ); +} diff --git a/src/simulate/govv3/checks/types.ts b/src/simulate/govv3/checks/types.ts new file mode 100644 index 0000000..56e9e9d --- /dev/null +++ b/src/simulate/govv3/checks/types.ts @@ -0,0 +1,18 @@ +import { PublicClient } from 'viem'; +import { PayloadsController } from '../payloadsController'; +import { TenderlySimulationResponse } from '../../../utils/tenderlyClient'; + +export type CheckResult = { + info: string[]; + warnings: string[]; + errors: string[]; +}; + +export interface ProposalCheck { + name: string; + checkProposal( + proposalInfo: Awaited>, + simulation: TenderlySimulationResponse, + publicClient: PublicClient + ): Promise; +} diff --git a/src/simulate/govv3/generatePayloadReport.ts b/src/simulate/govv3/generatePayloadReport.ts new file mode 100644 index 0000000..5c4e2a4 --- /dev/null +++ b/src/simulate/govv3/generatePayloadReport.ts @@ -0,0 +1,152 @@ +import { Hex, PublicClient, getAddress } from 'viem'; +import { StateDiff, TenderlySimulationResponse } from '../../utils/tenderlyClient'; +import { PayloadsController } from './payloadsController'; +import { tenderlyDeepDiff } from './utils/tenderlyDeepDiff'; +import { interpretStateChange } from './utils/stateDiffInterpreter'; +import { getContractName } from './utils/solidityUtils'; +import { boolToMarkdown, toTxLink } from './utils/markdownUtils'; +import { checkTargetsNoSelfdestruct, checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; +import { CheckResult, ProposalCheck } from './checks/types'; +import { checkLogs } from './checks/logs'; +import { checkTargetsVerifiedEtherscan, checkTouchedContractsVerifiedEtherscan } from './checks/targets-verified'; + +type GenerateReportRequest = { + payloadId: number; + payloadInfo: Awaited>; + simulation: TenderlySimulationResponse; + publicClient: PublicClient; +}; + +export async function generateReport({ payloadId, payloadInfo, simulation, publicClient }: GenerateReportRequest) { + const { payload, executedLog, queuedLog, createdLog } = payloadInfo; + // generate file header + let report = `## Payload ${payloadId} on ${simulation.simulation.network_id} + +- creator: ${payload.creator} +- maximumAccessLevelRequired: ${payload.maximumAccessLevelRequired} +- state: ${payload.state} +- actions: ${JSON.stringify(payload.actions, (key, value) => (typeof value === 'bigint' ? value.toString() : value))} +- createdAt: [${payload.createdAt}](${toTxLink(createdLog.transactionHash, false, publicClient)})\n`; + if (queuedLog) { + report += `- queuedAt: [${payload.createdAt}](${toTxLink(queuedLog.transactionHash, false, publicClient)})\n`; + } + if (executedLog) { + report += `- executedAt: [${payload.createdAt}](${toTxLink(executedLog.transactionHash, false, publicClient)})\n`; + } + report += '\n'; + + // check if simulation was successful + report += `### Simulation ${boolToMarkdown(simulation.transaction.status)}\n\n`; + if (!simulation.transaction.status) { + const txInfo = simulation.transaction.transaction_info; + const reason = txInfo.stack_trace ? txInfo.stack_trace[0].error_reason : 'unknown error'; + report += `Transaction reverted with reason: ${reason}`; + } else { + // State diffs in the simulation are an array, so first we organize them by address. + const stateDiffs = simulation.transaction.transaction_info.state_diff.reduce((diffs, diff) => { + // TODO: double check if that's safe to skip + if (!diff.raw?.[0]) return diffs; + const addr = getAddress(diff.raw[0].address); + if (!diffs[addr]) diffs[addr] = [diff]; + else diffs[addr].push(diff); + return diffs; + }, {} as Record); + + if (!Object.keys(stateDiffs).length) { + report += `No state changes detected`; + } else { + let stateChanges = ''; + let warnings = ''; + // Parse state changes at each address + for (const [address, diffs] of Object.entries(stateDiffs)) { + // Use contracts array to get contract name of address + stateChanges += `\n\`\`\`diff\n# ${getContractName(simulation.contracts, address)}\n`; + + // Parse each diff. A single diff may involve multiple storage changes, e.g. a proposal that + // executes three transactions will show three state changes to the `queuedTransactions` + // mapping within a single `diff` element. We always JSON.stringify the values so structs + // (i.e. tuples) don't print as [object Object] + for (const diff of diffs) { + if (!diff.soltype) { + // In this branch, state change is not decoded, so return raw data of each storage write + // (all other branches have decoded state changes) + diff.raw.forEach((w) => { + const oldVal = JSON.stringify(w.original); + const newVal = JSON.stringify(w.dirty); + // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` + stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); + }); + } else if (diff.soltype.simple_type) { + // This is a simple type with a single changed value + // const oldVal = JSON.parse(JSON.stringify(diff.original)) + // const newVal = JSON.parse(JSON.stringify(diff.dirty)) + // info += `\n - \`${diff.soltype.name}\` changed from \`${oldVal}\` to \`${newVal}\`` + stateChanges += tenderlyDeepDiff(diff.original, diff.dirty, diff.soltype.name); + } else if (diff.soltype.type.startsWith('mapping')) { + // This is a complex type like a mapping, which may have multiple changes. The diff.original + // and diff.dirty fields can be strings or objects, and for complex types they are objects, + // so we cast them as such + const keys = Object.keys(diff.original); + const original = diff.original as Record; + const dirty = diff.dirty as Record; + for (const k of keys as Hex[]) { + stateChanges += tenderlyDeepDiff(original[k], dirty[k], `\`${diff.soltype?.name}\` key \`${k}\``); + const interpretation = await interpretStateChange( + address, + diff.soltype?.name, + original[k], + dirty[k], + k, + publicClient + ); + if (interpretation) stateChanges += `\n${interpretation}`; + stateChanges += '\n'; + } + } else { + // TODO arrays and nested mapping are currently not well supported -- find a transaction + // that changes state of these types to inspect the Tenderly simulation response and + // handle it accordingly. In the meantime we show the raw state changes and print a + // warning about decoding the data + diff.raw.forEach((w) => { + const oldVal = JSON.stringify(w.original); + const newVal = JSON.stringify(w.dirty); + // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` + stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); + warnings += `Could not parse state: add support for formatting type ${diff.soltype?.type} (slot ${w.key})\n`; + }); + } + } + stateChanges += '```\n'; + } + + if (warnings) { + report += `#### Warnings\n`; + report += warnings; + } + report += `#### State Changes\n`; + report += stateChanges; + } + } + const checks = [ + checkLogs, + checkTargetsVerifiedEtherscan, + checkTouchedContractsVerifiedEtherscan, + checkTargetsNoSelfdestruct, + checkTouchedContractsNoSelfdestruct, + ]; + + for (const check of checks) { + const result = await check.checkProposal(payloadInfo, simulation, publicClient); + report += renderCheckResult(check, result); + } + + return report; +} + +function renderCheckResult(check: ProposalCheck, result: CheckResult) { + let response = `### Check: ${check.name} ${boolToMarkdown(!result.errors.length)}\n\n`; + if (result.errors.length) response += `#### Errors\n\n${result.errors.join('\n')}\n\n`; + if (result.warnings.length) response += `#### Warnings\n\n${result.warnings.join('\n')}\n\n`; + if (result.info.length) response += `#### Info\n\n${result.info.join('\n')}\n\n`; + return response; +} diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 0e9443d..8b26281 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -122,6 +122,7 @@ export const getPayloadsController = ( functionName: 'executePayload', args: [id], }), + block_number: Number(currentBlock.number), state_objects: { [controllerContract.address]: { storage: { @@ -130,7 +131,7 @@ export const getPayloadsController = ( [ Number(currentBlock.timestamp - BigInt(payload.delay) - 1n), // altering queued time so can be executed in current block payload.createdAt, - 2, // QUEUED - might make sense to enum + PayloadState.Queued, payload.maximumAccessLevelRequired, payload.creator, ] diff --git a/src/simulate/govv3/simulate.ts b/src/simulate/govv3/simulate.ts index c123805..009e0b1 100644 --- a/src/simulate/govv3/simulate.ts +++ b/src/simulate/govv3/simulate.ts @@ -5,6 +5,7 @@ import { getGovernance } from './governance'; import { Hex, createPublicClient, http } from 'viem'; import { sepolia, polygonMumbai, bscTestnet, avalancheFuji } from 'viem/chains'; import { PayloadsController, getPayloadsController } from './payloadsController'; +import { generateReport } from './generatePayloadReport'; const CHAIN_ID_CLIENT_MAP = { [sepolia.id]: { @@ -47,6 +48,14 @@ export async function simulateProposal(governanceAddress: Hex, proposalId: bigin const logs = await controllerContract.cacheLogs(); const config = await controllerContract.getPayload(payload.payloadId, logs); const result = await controllerContract.simulatePayloadExecutionOnTenderly(payload.payloadId, config); + console.log( + await generateReport({ + payloadId: payload.payloadId, + payloadInfo: config, + simulation: result, + publicClient: CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP].client, + }) + ); payloads.push({ payload: config, simulation: result }); } return { proposal, payloads }; diff --git a/src/simulate/govv3/utils/markdownUtils.ts b/src/simulate/govv3/utils/markdownUtils.ts new file mode 100644 index 0000000..d7653fb --- /dev/null +++ b/src/simulate/govv3/utils/markdownUtils.ts @@ -0,0 +1,26 @@ +import { Hex, PublicClient } from 'viem'; + +export function boolToMarkdown(value: boolean) { + if (value) return `:white_check_mark:`; + return `:sos:`; +} + +/** + * Turns a plaintext address into a link to etherscan page of that address + * @param address to be linked + * @param code whether to link to the code tab + */ +export function toAddressLink(address: Hex, code: boolean = false, client: PublicClient): string { + return `[${address}](${client.chain?.blockExplorers?.default}/address/${address}${code ? '#code' : ''})`; +} + +/** + * Turns a plaintext address into a link to etherscan page of that address + * @param address to be linked + * @param code whether to link to the code tab + */ +export function toTxLink(txn: Hex, md: boolean, client: PublicClient): string { + const link = `${client.chain?.blockExplorers?.default}/tx/${txn}`; + if (md) return `[${txn}](${link})`; + return link; +} diff --git a/src/simulate/govv3/utils/solidityUtils.ts b/src/simulate/govv3/utils/solidityUtils.ts new file mode 100644 index 0000000..2657166 --- /dev/null +++ b/src/simulate/govv3/utils/solidityUtils.ts @@ -0,0 +1,52 @@ +import { getAddress } from 'viem'; +import { TenderlySimulationResponse } from '../../../utils/tenderlyClient'; + +/** + * Returns the selected bits of a uint256 + * @param _bigIntValue + * @param startBit + * @param endBit + * @returns + */ +export function getBits(_bigIntValue: bigint | number | string, startBit: bigint, endBit: bigint) { + const bigIntValue = BigInt(_bigIntValue); + if (startBit > endBit) { + throw new Error('Invalid bit range: startBit must be less than or equal to endBit'); + } + + const bitLength = BigInt(bigIntValue.toString(2)).toString().length; + if (endBit >= bitLength) { + endBit = BigInt(bitLength - 1); + } + + const mask = (1n << (endBit - startBit + 1n)) - 1n; + const maskedValue = (bigIntValue >> startBit) & mask; + return maskedValue.toString(); +} + +// --- Helper methods --- +/** + * @notice Given a Tenderly contract object, generates a descriptive human-friendly name for that contract + * @param contract Tenderly contract object to generate name from + */ +export function getContractName(contracts: TenderlySimulationResponse['contracts'] = [], address: string): string { + // lower-case comparison as strict equality would fail on child contracts which are lower-cased when returned from tenderly + const contract = contracts.find((c) => c.address.toLowerCase() === address.toLowerCase()); + if (!contract) return `unknown contract name at \`${getAddress(address)}\``; + let contractName = contract?.contract_name; + + // If the contract is a token, include the full token name. This is useful in cases where the + // token is a proxy, so the contract name doesn't give much useful information + if (contract?.token_data?.name) contractName += ` (${contract?.token_data?.name})`; + + // if the contract is a proxy include it's child + if (contract.standards?.includes('eip1967') && contract.child_contracts?.[0].address) { + return `${contractName} at \`${getAddress(contract.address)}\` with implementation ${getContractName( + contracts, + contract.child_contracts?.[0].address + )}`; + } + + // Lastly, append the contract address and save it off + return `${contractName} at \`${getAddress(contract.address)}\``; +} diff --git a/src/simulate/govv3/utils/stateDiffInterpreter.ts b/src/simulate/govv3/utils/stateDiffInterpreter.ts new file mode 100644 index 0000000..2910695 --- /dev/null +++ b/src/simulate/govv3/utils/stateDiffInterpreter.ts @@ -0,0 +1,113 @@ +import { Hex, PublicClient, getContract } from 'viem'; +import { tenderlyDeepDiff } from './tenderlyDeepDiff'; +import { ERC20_ABI } from '../abis/ERC20'; +import * as pools from '@bgd-labs/aave-address-book'; +import { getBits } from './solidityUtils'; + +export async function interpretStateChange( + contractAddress: string, + name: string = '', + original: Record, + dirty: Record, + key: Hex, + publicClient: PublicClient +) { + if (name === '_reserves' && (original.configuration.data || dirty.configuration.data)) + return await reserveConfigurationChanged(contractAddress, original, dirty, key, publicClient); + return undefined; +} + +async function reserveConfigurationChanged( + contractAddress: string, + original: Record, + dirty: Record, + key: Hex, + publicClient: PublicClient +) { + const configurationBefore = getDecodedReserveData(contractAddress, original.configuration.data); + const configurationAfter = getDecodedReserveData(contractAddress, dirty.configuration.data); + let symbol = 'unknown'; + try { + const erc20Contract = getContract({ publicClient, address: key, abi: ERC20_ABI }); + symbol = await erc20Contract.read.symbol(); + } catch (e) {} + // const symbol = + return `# decoded configuration.data for key \`${key}\` (symbol: ${symbol}) + ${tenderlyDeepDiff(configurationBefore, configurationAfter, 'configuration.data')}`; +} + +function getDecodedReserveData(contractAddress: string, data?: bigint) { + if (!data) return {}; + if ( + [pools.AaveV2EthereumAMM.POOL, pools.AaveV2Ethereum.POOL, pools.AaveV2Polygon.POOL, pools.AaveV2Avalanche.POOL] + .map((address) => address.toLowerCase()) + .includes(contractAddress.toLowerCase()) + ) + return decodeReserveDataV2(data); + return decodeReserveDataV3(data); +} + +function decodeReserveDataV2(data: bigint) { + const ltv = getBits(data, 0n, 15n); + const liquidationThreshold = getBits(data, 16n, 31n); + const liquidationBonus = getBits(data, 32n, 47n); + const decimals = getBits(data, 48n, 55n); + const active = Number(getBits(data, 56n, 56n)); + const frozen = Number(getBits(data, 57n, 57n)); + const borrowingEnabled = Number(getBits(data, 58n, 58n)); + const reserveFactor = getBits(data, 64n, 79n); + return { + ltv, + liquidationThreshold, + liquidationBonus, + decimals, + active: !!active, + frozen: !!frozen, + borrowingEnabled: !!borrowingEnabled, + reserveFactor, + }; +} + +function decodeReserveDataV3(data: bigint) { + const ltv = getBits(data, 0n, 15n); + const liquidationThreshold = getBits(data, 16n, 31n); + const liquidationBonus = getBits(data, 32n, 47n); + const decimals = getBits(data, 48n, 55n); + const active = Number(getBits(data, 56n, 56n)); + const frozen = Number(getBits(data, 57n, 57n)); + const borrowingEnabled = Number(getBits(data, 58n, 58n)); + const stableRateBorrowingEnabled = Number(getBits(data, 59n, 59n)); + const paused = Number(getBits(data, 60n, 60n)); + const borrowingInIsolation = Number(getBits(data, 61n, 61n)); + const siloedBorrowingEnabled = Number(getBits(data, 62n, 62n)); + const flashloaningEnabled = Number(getBits(data, 63n, 63n)); + const reserveFactor = getBits(data, 64n, 79n); + const borrowCap = getBits(data, 80n, 115n); + const supplyCap = getBits(data, 116n, 151n); + const liquidationProtocolFee = getBits(data, 152n, 167n); + const eModeCategory = getBits(data, 168n, 175n); + const unbackedMintCap = getBits(data, 176n, 211n); + const debtCeiling = getBits(data, 212n, 251n); + + return { + ltv, + liquidationThreshold, + liquidationBonus, + decimals, + active: !!active, + frozen: !!frozen, + borrowingEnabled: !!borrowingEnabled, + stableRateBorrowingEnabled, + paused, + borrowingInIsolation, + reserveFactor, + borrowCap, + supplyCap, + liquidationProtocolFee, + eModeCategory, + unbackedMintCap, + debtCeiling, + siloedBorrowingEnabled: !!siloedBorrowingEnabled, + flashloaningEnabled: !!flashloaningEnabled, + }; +} diff --git a/src/simulate/govv3/utils/tenderlyDeepDiff.ts b/src/simulate/govv3/utils/tenderlyDeepDiff.ts new file mode 100644 index 0000000..13d61ee --- /dev/null +++ b/src/simulate/govv3/utils/tenderlyDeepDiff.ts @@ -0,0 +1,28 @@ +/** + * Generates a markdown diff for a nested tenderly state object + * @param before + * @param after + * @param prefix + * @returns + */ +export function tenderlyDeepDiff( + before: Record | string, + after: Record | string, + prefix?: string +): string { + if (typeof before !== 'object' || typeof after !== 'object') { + return `${prefix ? `@@ ${prefix} @@\n` : ''}- ${before} + + ${after}\n`; + } + return Object.keys(before).reduce((acc, key) => { + if (before[key] === after[key]) return acc; + if (typeof before[key] === 'object') + return tenderlyDeepDiff(before[key], after[key], prefix ? `${prefix}.${key}` : key); + return ( + acc + + `@@ ${prefix ? `${prefix}.${key}` : key} @@ + - ${before[key]} + + ${after[key]}\n` + ); + }, ''); +} diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 8d45a8f..e1e0f43 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -130,6 +130,19 @@ export interface Input { value: boolean | string; } +export interface Log { + name: string | null; + anonymous: boolean; + inputs: Input[]; + raw: LogRaw; +} + +export interface LogRaw { + address: string; + topics: string[]; + data: string; +} + export interface Trace { from: Hex; to?: Hex; @@ -262,6 +275,7 @@ class Tenderly { } else { request.state_objects[request.from].balance = String(parseEther('3')); } + const response = await fetch(`${this.TENDERLY_BASE}/account/${this.ACCOUNT}/project/${this.PROJECT}/simulate`, { method: 'POST', body: JSON.stringify({ diff --git a/yarn.lock b/yarn.lock index 7b3c8e0..7f8e2ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2492,10 +2492,10 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.6.2.tgz#298ac87de69abcb9e772ffd7cdba9c46ff2849d2" - integrity sha512-ZHmjfEdIZE+FP3tRzDgskAsn1IQHn/5knh47fUUWa9jcVNZLC0kA0hiqGS3uy0uqUtWTDMykA+ALRUTzi+qYVg== +viem@^1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.6.7.tgz#2445ea47aae96f5bfc3b79ed08df20ce9530ca7a" + integrity sha512-w2OMJqKcQrzPQnmMFxe4ex+md8wSwfle6L3LvEi25CBvDKhkuljVrsWY19UzG05ssQhiZ+cdxU3YMBrX817Qiw== dependencies: "@adraffy/ens-normalize" "1.9.0" "@noble/curves" "1.1.0" From c026c83117ce789ebb8911964558516e0fff5dee Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 23 Aug 2023 13:56:16 +0200 Subject: [PATCH 13/94] feat: proposal state enum --- src/simulate/govv3/governance.ts | 10 ++++++++++ src/simulate/govv3/payloadsController.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index 7e42ee2..81c7b39 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -8,6 +8,16 @@ type QueuedLog = FilterLogWithTimestamp; type PayloadSentLog = FilterLogWithTimestamp; +export enum ProposalState { + Null, // proposal does not exists + Created, // created, waiting for a cooldown to initiate the balances snapshot + Active, // balances snapshot set, voting in progress + Queued, // voting results submitted, but proposal is under grace period when guardian can cancel it + Executed, // results sent to the execution chain(s) + Failed, // voting was not successful + Cancelled, // got cancelled by guardian, or because proposition power of creator dropped below allowed minimum + Expired, +} export interface Governance { governanceContract: GetContractReturnType; cacheLogs: () => Promise<{ diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 8b26281..3f1b679 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -112,7 +112,7 @@ export const getPayloadsController = ( const tx = await publicClient.getTransaction({ hash: executedLog.transactionHash! }); return tenderly.simulateTx(publicClient.chain!.id, tx); } - const currentBlock = await publicClient.getBlock(); + const currentBlock = await publicClient.getBlock({ blockTag: 'finalized' }); const simulationPayload: TenderlyRequest = { network_id: String(publicClient.chain!.id), from: EOA, From 07dad2e86c6b65ba81397a0e9e8ff3282c6bf591 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 23 Aug 2023 14:00:31 +0200 Subject: [PATCH 14/94] fix: remove types --- src/index.ts | 1 - src/simulate/govv3/governance.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index f88333a..2fd15ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,5 +5,4 @@ export * from './simulate/govv3/governance'; export * from './simulate/govv3/payloadsController'; export * from './simulate/govv3/generatePayloadReport'; export * from './utils/tenderlyClient'; -export * from './simulate/govv2/networks/types'; export * from './utils/logger'; diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index 81c7b39..4458bc4 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -18,6 +18,7 @@ export enum ProposalState { Cancelled, // got cancelled by guardian, or because proposition power of creator dropped below allowed minimum Expired, } + export interface Governance { governanceContract: GetContractReturnType; cacheLogs: () => Promise<{ From d71d9151e0df5b930ca801f02f1498814fc1b4fb Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 23 Aug 2023 14:12:24 +0200 Subject: [PATCH 15/94] fix: dont use finalized --- src/commands/simulate-proposal-v3.ts | 2 +- src/commands/simulate-proposal.ts | 2 +- src/simulate/govv3/payloadsController.ts | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/commands/simulate-proposal-v3.ts b/src/commands/simulate-proposal-v3.ts index 3fb09c7..e62b4ac 100644 --- a/src/commands/simulate-proposal-v3.ts +++ b/src/commands/simulate-proposal-v3.ts @@ -6,7 +6,7 @@ export const command = 'simulate-proposal-v3 [proposalId]'; export const describe = 'simulates a aave v3 governance proposal'; export const handler = async function (argv) { - if (!argv.proposalId) throw new Error('proposalId is required'); + if (argv.proposalId == undefined) throw new Error('proposalId is required'); const proposalId = BigInt(argv.proposalId); const result = await simulateProposal(AaveV3Sepolia.GOVERNANCE, proposalId); // console.log(result); diff --git a/src/commands/simulate-proposal.ts b/src/commands/simulate-proposal.ts index fc531db..6273bfc 100644 --- a/src/commands/simulate-proposal.ts +++ b/src/commands/simulate-proposal.ts @@ -11,7 +11,7 @@ export const builder = (yargs) => }); export const handler = async function (argv) { - if (!argv.proposalId) throw new Error('proposalId is required'); + if (argv.proposalId == undefined) throw new Error('proposalId is required'); const proposalId = BigInt(argv.proposalId); const result = await simulateProposal(proposalId); // console.log(result); diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 3f1b679..b85add5 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -112,7 +112,9 @@ export const getPayloadsController = ( const tx = await publicClient.getTransaction({ hash: executedLog.transactionHash! }); return tenderly.simulateTx(publicClient.chain!.id, tx); } - const currentBlock = await publicClient.getBlock({ blockTag: 'finalized' }); + const _currentBlock = await publicClient.getBlockNumber(); + // workaround for tenderly lags & bugs when not specifying the blocknumber + const currentBlock = await publicClient.getBlock({ blockNumber: _currentBlock - 5n }); const simulationPayload: TenderlyRequest = { network_id: String(publicClient.chain!.id), from: EOA, From 8d3b7cafcbc8a224fe7c1c2f224455a3a76fdfb8 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 23 Aug 2023 15:14:13 +0200 Subject: [PATCH 16/94] fix: identation --- src/simulate/govv3/utils/tenderlyDeepDiff.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/simulate/govv3/utils/tenderlyDeepDiff.ts b/src/simulate/govv3/utils/tenderlyDeepDiff.ts index 13d61ee..33b47da 100644 --- a/src/simulate/govv3/utils/tenderlyDeepDiff.ts +++ b/src/simulate/govv3/utils/tenderlyDeepDiff.ts @@ -12,7 +12,7 @@ export function tenderlyDeepDiff( ): string { if (typeof before !== 'object' || typeof after !== 'object') { return `${prefix ? `@@ ${prefix} @@\n` : ''}- ${before} - + ${after}\n`; ++ ${after}\n`; } return Object.keys(before).reduce((acc, key) => { if (before[key] === after[key]) return acc; @@ -21,8 +21,8 @@ export function tenderlyDeepDiff( return ( acc + `@@ ${prefix ? `${prefix}.${key}` : key} @@ - - ${before[key]} - + ${after[key]}\n` +- ${before[key]} ++ ${after[key]}\n` ); }, ''); } From 01a6bba66c6ca7229d3ad91774b907b844bc3326 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 23 Aug 2023 15:41:25 +0200 Subject: [PATCH 17/94] fix: correct links --- src/simulate/govv3/utils/markdownUtils.ts | 4 ++-- src/simulate/govv3/utils/tenderlyDeepDiff.ts | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/simulate/govv3/utils/markdownUtils.ts b/src/simulate/govv3/utils/markdownUtils.ts index d7653fb..31c9c12 100644 --- a/src/simulate/govv3/utils/markdownUtils.ts +++ b/src/simulate/govv3/utils/markdownUtils.ts @@ -11,7 +11,7 @@ export function boolToMarkdown(value: boolean) { * @param code whether to link to the code tab */ export function toAddressLink(address: Hex, code: boolean = false, client: PublicClient): string { - return `[${address}](${client.chain?.blockExplorers?.default}/address/${address}${code ? '#code' : ''})`; + return `[${address}](${client.chain?.blockExplorers?.default.url}/address/${address}${code ? '#code' : ''})`; } /** @@ -20,7 +20,7 @@ export function toAddressLink(address: Hex, code: boolean = false, client: Publi * @param code whether to link to the code tab */ export function toTxLink(txn: Hex, md: boolean, client: PublicClient): string { - const link = `${client.chain?.blockExplorers?.default}/tx/${txn}`; + const link = `${client.chain?.blockExplorers?.default.url}/tx/${txn}`; if (md) return `[${txn}](${link})`; return link; } diff --git a/src/simulate/govv3/utils/tenderlyDeepDiff.ts b/src/simulate/govv3/utils/tenderlyDeepDiff.ts index 33b47da..c5d2fc2 100644 --- a/src/simulate/govv3/utils/tenderlyDeepDiff.ts +++ b/src/simulate/govv3/utils/tenderlyDeepDiff.ts @@ -11,18 +11,12 @@ export function tenderlyDeepDiff( prefix?: string ): string { if (typeof before !== 'object' || typeof after !== 'object') { - return `${prefix ? `@@ ${prefix} @@\n` : ''}- ${before} -+ ${after}\n`; + return `${prefix ? `@@ ${prefix} @@\n` : ''}- ${before}\n+ ${after}\n`; } return Object.keys(before).reduce((acc, key) => { if (before[key] === after[key]) return acc; if (typeof before[key] === 'object') return tenderlyDeepDiff(before[key], after[key], prefix ? `${prefix}.${key}` : key); - return ( - acc + - `@@ ${prefix ? `${prefix}.${key}` : key} @@ -- ${before[key]} -+ ${after[key]}\n` - ); + return acc + `@@ ${prefix ? `${prefix}.${key}` : key} @@\n- ${before[key]}\n+ ${after[key]}\n`; }, ''); } From 75259511a70639c3f44fb1137b8fcb7ea4f01f22 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 30 Aug 2023 11:38:00 +0200 Subject: [PATCH 18/94] fix: expose way to deploy proposal --- package.json | 4 ++-- src/index.ts | 1 + src/simulate/govv2/networks/commonL2.ts | 2 +- src/simulate/govv2/networks/mainnet.ts | 26 +++++++++++++++---------- src/simulate/govv2/networks/types.ts | 2 +- src/utils/tenderlyClient.ts | 19 ++++++++++++++---- yarn.lock | 22 ++++++++------------- 7 files changed, 44 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 742c858..f876281 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@types/yargs": "^17.0.24", "tsup": "^7.2.0", "tsx": "^3.12.7", - "typescript": "^5.1.6", + "typescript": "^5.2.2", "vitest": "^0.34.1" }, "type": "module", @@ -61,7 +61,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.6.7", + "viem": "^1.9.2", "yargs": "^17.7.2", "zod": "^3.21.4" } diff --git a/src/index.ts b/src/index.ts index 2fd15ee..ee61c47 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ export * from './reports/diff-reports'; export { simulateProposal } from './simulate/govv2/simulate'; export { simulateProposal as simulateProposalV3 } from './simulate/govv3/simulate'; +export * from './simulate/govv2/networks/mainnet'; export * from './simulate/govv3/governance'; export * from './simulate/govv3/payloadsController'; export * from './simulate/govv3/generatePayloadReport'; diff --git a/src/simulate/govv2/networks/commonL2.ts b/src/simulate/govv2/networks/commonL2.ts index d8dd1d6..fa9a385 100644 --- a/src/simulate/govv2/networks/commonL2.ts +++ b/src/simulate/govv2/networks/commonL2.ts @@ -161,7 +161,7 @@ export async function getProposalStateById({ return { state: ActionSetState.NOT_FOUND }; } -export async function getProposalState({ +export async function getProposalState({ queuedLogs, executedLogs, dataValue, diff --git a/src/simulate/govv2/networks/mainnet.ts b/src/simulate/govv2/networks/mainnet.ts index b8c250a..b993433 100644 --- a/src/simulate/govv2/networks/mainnet.ts +++ b/src/simulate/govv2/networks/mainnet.ts @@ -1,6 +1,8 @@ import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; import { ActionSetState, L2NetworkModule, MainnetModule, ProposalState } from './types'; import { + Hex, + PublicClient, concat, encodeAbiParameters, encodeFunctionData, @@ -14,7 +16,7 @@ import { } from 'viem'; import { mainnetClient } from '../../../utils/rpcClients'; import { getLogs } from '../../../utils/logs'; -import { Trace, tenderly } from '../../../utils/tenderlyClient'; +import { StateObject, Trace, tenderly } from '../../../utils/tenderlyClient'; import { EOA } from '../../../utils/constants'; import { AAVE_GOVERNANCE_V2_ABI, @@ -26,11 +28,15 @@ import { getSolidityStorageSlotBytes } from '../../../utils/storageSlots'; import { ARC_TIMELOCK_ABI } from '../abis/ArcTimelock'; import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; -const aaveGovernanceV2Contract = getContract({ - address: AaveGovernanceV2.GOV, - abi: AAVE_GOVERNANCE_V2_ABI, - publicClient: mainnetClient, -}); +export const getGovernanceV2Contract = (publicClient: T) => { + return getContract({ + address: AaveGovernanceV2.GOV, + abi: AAVE_GOVERNANCE_V2_ABI, + publicClient, + }); +}; + +const aaveGovernanceV2Contract = getGovernanceV2Contract(mainnetClient); export const mainnet: MainnetModule = { name: 'Mainnet', @@ -140,7 +146,7 @@ export const mainnet: MainnetModule = { const slot = getSolidityStorageSlotBytes(slots.queuedTxsSlot, hash); acc[slot] = pad('0x1', { size: 32 }); return acc; - }, {}), + }, {} as any), }, [AaveGovernanceV2.GOV]: { storage: { @@ -198,17 +204,17 @@ export const arc: L2NetworkModule Array; getProposalState: ( args: Omit, 'dataValue'> & { trace: Trace; fromTimestamp: number } - ) => ReturnType>; + ) => ReturnType; simulateOnTenderly?: ( args: { args: FormattedArgs; diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index e1e0f43..13998f9 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -1,13 +1,9 @@ import { Hex, - PublicClient, Transaction as ViemTransaction, - WalletClient, createPublicClient, createWalletClient, - getAddress, http, - pad, toHex, parseEther, fromHex, @@ -345,6 +341,21 @@ class Tenderly { return fork; }; + deployCode = (fork: any, filePath: string) => { + const walletProvider = createWalletClient({ + account: EOA, + chain: { id: 3030, name: 'tenderly' } as any, + transport: http(fork.forkUrl), + }); + + const artifact = require(filePath); + + walletProvider.deployContract({ + abi: artifact.abi, + bytecode: artifact.bytecode, + } as any); + }; + unwrapAndExecuteSimulationPayloadOnFork = async (fork: any, request: TenderlyRequest) => { // 0. fund account await this.fundAccount(fork, EOA); diff --git a/yarn.lock b/yarn.lock index 7f8e2ad..c5fa30b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -651,11 +651,6 @@ loupe "^2.3.6" pretty-format "^29.5.0" -"@wagmi/chains@1.7.0": - version "1.7.0" - resolved "https://registry.yarnpkg.com/@wagmi/chains/-/chains-1.7.0.tgz#8f6ad81cf867e1788417f7c978ca92bc083ecaf6" - integrity sha512-TKVeHv0GqP5sV1yQ8BDGYToAFezPnCexbbBpeH14x7ywi5a1dDStPffpt9x+ytE6LJWkZ6pAMs/HNWXBQ5Nqmw== - abitype@0.9.3: version "0.9.3" resolved "https://registry.npmjs.org/abitype/-/abitype-0.9.3.tgz" @@ -2445,10 +2440,10 @@ type-fest@^0.8.1: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -typescript@^5.1.6: - version "5.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" - integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== +typescript@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" + integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== ufo@^1.1.2: version "1.1.2" @@ -2492,10 +2487,10 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.6.7: - version "1.6.7" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.6.7.tgz#2445ea47aae96f5bfc3b79ed08df20ce9530ca7a" - integrity sha512-w2OMJqKcQrzPQnmMFxe4ex+md8wSwfle6L3LvEi25CBvDKhkuljVrsWY19UzG05ssQhiZ+cdxU3YMBrX817Qiw== +viem@^1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.9.2.tgz#7cc15d8945e8268810d885610a8a06b11c0bbe16" + integrity sha512-a4l502Sl4ytYOT6a77ezDCEEgztR+wF8ZZRLAEVcrQawFFIiAWXGPrXVPT8MQmDF00idPMKPON8Ayz34Ft3NLw== dependencies: "@adraffy/ens-normalize" "1.9.0" "@noble/curves" "1.1.0" @@ -2503,7 +2498,6 @@ viem@^1.6.7: "@scure/bip32" "1.3.0" "@scure/bip39" "1.2.0" "@types/ws" "^8.5.4" - "@wagmi/chains" "1.7.0" abitype "0.9.3" isomorphic-ws "5.0.0" ws "8.12.0" From 23c46e7103515620a0bc89b44e37fac77b7ec001 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 30 Aug 2023 11:45:46 +0200 Subject: [PATCH 19/94] fix: return address --- src/utils/tenderlyClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 13998f9..47ed2ba 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -350,7 +350,7 @@ class Tenderly { const artifact = require(filePath); - walletProvider.deployContract({ + return walletProvider.deployContract({ abi: artifact.abi, bytecode: artifact.bytecode, } as any); From 8e358df0f2f3de94c932d8387d209cf8c42f9ae1 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 30 Aug 2023 11:54:02 +0200 Subject: [PATCH 20/94] feat: make contract walletClient --- src/simulate/govv2/networks/mainnet.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/simulate/govv2/networks/mainnet.ts b/src/simulate/govv2/networks/mainnet.ts index b993433..3d33fdc 100644 --- a/src/simulate/govv2/networks/mainnet.ts +++ b/src/simulate/govv2/networks/mainnet.ts @@ -3,6 +3,7 @@ import { ActionSetState, L2NetworkModule, MainnetModule, ProposalState } from '. import { Hex, PublicClient, + WalletClient, concat, encodeAbiParameters, encodeFunctionData, @@ -28,7 +29,21 @@ import { getSolidityStorageSlotBytes } from '../../../utils/storageSlots'; import { ARC_TIMELOCK_ABI } from '../abis/ArcTimelock'; import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; -export const getGovernanceV2Contract = (publicClient: T) => { +export const getGovernanceV2Contract = ({ + publicClient, + walletClient, +}: { + publicClient: T; + walletClient?: Y; +}) => { + if (walletClient) { + return getContract({ + address: AaveGovernanceV2.GOV, + abi: AAVE_GOVERNANCE_V2_ABI, + walletClient, + publicClient, + }); + } return getContract({ address: AaveGovernanceV2.GOV, abi: AAVE_GOVERNANCE_V2_ABI, @@ -36,7 +51,7 @@ export const getGovernanceV2Contract = (publicClient: T) }); }; -const aaveGovernanceV2Contract = getGovernanceV2Contract(mainnetClient); +const aaveGovernanceV2Contract = getGovernanceV2Contract({ publicClient: mainnetClient }); export const mainnet: MainnetModule = { name: 'Mainnet', From 73bdfdf94e19764f01e403268a49848cdf75e14a Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 30 Aug 2023 12:00:26 +0200 Subject: [PATCH 21/94] fix: expose fork warping --- src/utils/tenderlyClient.ts | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 47ed2ba..4bae3d5 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -356,6 +356,24 @@ class Tenderly { } as any); }; + warp = async (fork: any, timestamp: bigint) => { + const publicProvider = createPublicClient({ + chain: { id: 3030 } as any, + transport: http(fork.forkUrl), + }); + + const currentBlock = await publicProvider.getBlock(); + // warping forward in time + if (timestamp > currentBlock.timestamp) { + await publicProvider.request({ + method: 'evm_increaseTime' as any, + params: [toHex(timestamp - currentBlock.timestamp)], + }); + } else { + logWarning('tenderly', 'skipping time warp as tenderly forks do not support traveling back in time'); + } + }; + unwrapAndExecuteSimulationPayloadOnFork = async (fork: any, request: TenderlyRequest) => { // 0. fund account await this.fundAccount(fork, EOA); @@ -381,16 +399,7 @@ class Tenderly { // 2. warp time if (request.block_header?.timestamp) { - const currentBlock = await publicProvider.getBlock(); - // warping back in time - if (fromHex(request.block_header?.timestamp, 'bigint') > currentBlock.timestamp) { - await publicProvider.request({ - method: 'evm_increaseTime' as any, - params: [toHex(fromHex(request.block_header?.timestamp, 'bigint') - currentBlock.timestamp)], - }); - } else { - logWarning('tenderly', 'skipping time warp as tenderly forks do not support traveling back in time'); - } + this.warp(fork, fromHex(request.block_header?.timestamp, 'bigint')); } // 3. execute txn From 3673a551b8f5cf2daab29836b8466378cebee625 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 30 Aug 2023 12:15:54 +0200 Subject: [PATCH 22/94] fix: remove generic --- src/simulate/govv2/networks/mainnet.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/simulate/govv2/networks/mainnet.ts b/src/simulate/govv2/networks/mainnet.ts index 3d33fdc..e97509d 100644 --- a/src/simulate/govv2/networks/mainnet.ts +++ b/src/simulate/govv2/networks/mainnet.ts @@ -29,12 +29,12 @@ import { getSolidityStorageSlotBytes } from '../../../utils/storageSlots'; import { ARC_TIMELOCK_ABI } from '../abis/ArcTimelock'; import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; -export const getGovernanceV2Contract = ({ +export const getGovernanceV2Contract = ({ publicClient, walletClient, }: { - publicClient: T; - walletClient?: Y; + publicClient: PublicClient; + walletClient?: WalletClient; }) => { if (walletClient) { return getContract({ From d528de601838fbb1769775bfed65ac1101a54e46 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 5 Sep 2023 17:00:09 +0200 Subject: [PATCH 23/94] feat: also warp blocks --- src/utils/tenderlyClient.ts | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 4bae3d5..521f3ef 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -66,7 +66,7 @@ export type TenderlyRequest = { state_objects?: Record; contracts?: ContractObject[]; block_header?: { - number?: string; + number?: Hex; timestamp?: Hex; }; generate_access_list?: boolean; @@ -356,7 +356,7 @@ class Tenderly { } as any); }; - warp = async (fork: any, timestamp: bigint) => { + warpTime = async (fork: any, timestamp: bigint) => { const publicProvider = createPublicClient({ chain: { id: 3030 } as any, transport: http(fork.forkUrl), @@ -365,6 +365,7 @@ class Tenderly { const currentBlock = await publicProvider.getBlock(); // warping forward in time if (timestamp > currentBlock.timestamp) { + logInfo('tenderly', 'warping time'); await publicProvider.request({ method: 'evm_increaseTime' as any, params: [toHex(timestamp - currentBlock.timestamp)], @@ -374,6 +375,23 @@ class Tenderly { } }; + warpBlocks = async (fork: any, blockNumber: bigint) => { + const publicProvider = createPublicClient({ + chain: { id: 3030 } as any, + transport: http(fork.forkUrl), + }); + const currentBlock = await publicProvider.getBlock(); + if (blockNumber > currentBlock.number) { + logInfo('tenderly', 'warping blocks'); + await publicProvider.request({ + method: 'evm_increaseBlocks' as any, + params: [toHex(blockNumber - currentBlock.number)], + }); + } else { + logWarning('tenderly', 'skipping block warp as tenderly forks do not support traveling back in time'); + } + }; + unwrapAndExecuteSimulationPayloadOnFork = async (fork: any, request: TenderlyRequest) => { // 0. fund account await this.fundAccount(fork, EOA); @@ -399,7 +417,10 @@ class Tenderly { // 2. warp time if (request.block_header?.timestamp) { - this.warp(fork, fromHex(request.block_header?.timestamp, 'bigint')); + this.warpTime(fork, fromHex(request.block_header?.timestamp, 'bigint')); + } + if (request.block_header?.number) { + this.warpBlocks(fork, fromHex(request.block_header?.number, 'bigint')); } // 3. execute txn From 294fb4550d94cfc97013a7d5e6b1691f461981e0 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 5 Sep 2023 17:05:48 +0200 Subject: [PATCH 24/94] fix: await warping --- src/utils/tenderlyClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 521f3ef..5672d65 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -417,10 +417,10 @@ class Tenderly { // 2. warp time if (request.block_header?.timestamp) { - this.warpTime(fork, fromHex(request.block_header?.timestamp, 'bigint')); + await this.warpTime(fork, fromHex(request.block_header?.timestamp, 'bigint')); } if (request.block_header?.number) { - this.warpBlocks(fork, fromHex(request.block_header?.number, 'bigint')); + await this.warpBlocks(fork, fromHex(request.block_header?.number, 'bigint')); } // 3. execute txn From 29dc759160c417366a2f1a0f8a7eb854e4daa948 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 5 Sep 2023 21:38:51 +0200 Subject: [PATCH 25/94] fix: use interfaces from address-book --- package.json | 8 +- src/simulate/govv2/abis/AaveGovernanceV2.ts | 475 ---------------- src/simulate/govv2/abis/Executor.ts | 518 +++++++++--------- src/simulate/govv2/networks/commonL2.ts | 1 - src/simulate/govv2/networks/mainnet.ts | 17 +- src/simulate/govv2/networks/types.ts | 28 +- src/simulate/govv3/abis/GovernanceExtended.ts | 494 ----------------- .../govv3/abis/PayloadsControllerExtended.ts | 414 -------------- src/simulate/govv3/governance.ts | 16 +- src/simulate/govv3/payloadsController.ts | 17 +- yarn.lock | 210 +++---- 11 files changed, 405 insertions(+), 1793 deletions(-) delete mode 100644 src/simulate/govv3/abis/GovernanceExtended.ts delete mode 100644 src/simulate/govv3/abis/PayloadsControllerExtended.ts diff --git a/package.json b/package.json index f876281..4b63106 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,9 @@ "@types/object-hash": "^3.0.3", "@types/yargs": "^17.0.24", "tsup": "^7.2.0", - "tsx": "^3.12.7", + "tsx": "^3.12.8", "typescript": "^5.2.2", - "vitest": "^0.34.1" + "vitest": "^0.34.3" }, "type": "module", "main": "./dist/index.cjs", @@ -52,7 +52,7 @@ "access": "public" }, "dependencies": { - "@bgd-labs/aave-address-book": "1.33.1-e5554f111c11be63c08c5861c43bb27567e806a4.0", + "@bgd-labs/aave-address-book": "2.2.0", "bs58": "^5.0.0", "chalk": "^4.1.2", "dotenv": "^16.3.1", @@ -61,7 +61,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.9.2", + "viem": "^1.10.3", "yargs": "^17.7.2", "zod": "^3.21.4" } diff --git a/src/simulate/govv2/abis/AaveGovernanceV2.ts b/src/simulate/govv2/abis/AaveGovernanceV2.ts index d6c6610..7152726 100644 --- a/src/simulate/govv2/abis/AaveGovernanceV2.ts +++ b/src/simulate/govv2/abis/AaveGovernanceV2.ts @@ -2,481 +2,6 @@ import { Address, Hex, fromHex, pad, toHex } from 'viem'; import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; import { getSolidityStorageSlotUint } from '../../../utils/storageSlots'; -export const AAVE_GOVERNANCE_V2_ABI = [ - { - inputs: [ - { internalType: 'address', name: 'governanceStrategy', type: 'address' }, - { internalType: 'uint256', name: 'votingDelay', type: 'uint256' }, - { internalType: 'address', name: 'guardian', type: 'address' }, - { internalType: 'address[]', name: 'executors', type: 'address[]' }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'executor', - type: 'address', - }, - ], - name: 'ExecutorAuthorized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'executor', - type: 'address', - }, - ], - name: 'ExecutorUnauthorized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'newStrategy', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'initiatorChange', - type: 'address', - }, - ], - name: 'GovernanceStrategyChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousOwner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [{ indexed: false, internalType: 'uint256', name: 'id', type: 'uint256' }], - name: 'ProposalCanceled', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'id', type: 'uint256' }, - { - indexed: true, - internalType: 'address', - name: 'creator', - type: 'address', - }, - { - indexed: true, - internalType: 'contract IExecutorWithTimelock', - name: 'executor', - type: 'address', - }, - { - indexed: false, - internalType: 'address[]', - name: 'targets', - type: 'address[]', - }, - { - indexed: false, - internalType: 'uint256[]', - name: 'values', - type: 'uint256[]', - }, - { - indexed: false, - internalType: 'string[]', - name: 'signatures', - type: 'string[]', - }, - { - indexed: false, - internalType: 'bytes[]', - name: 'calldatas', - type: 'bytes[]', - }, - { - indexed: false, - internalType: 'bool[]', - name: 'withDelegatecalls', - type: 'bool[]', - }, - { - indexed: false, - internalType: 'uint256', - name: 'startBlock', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'endBlock', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'strategy', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'ipfsHash', - type: 'bytes32', - }, - ], - name: 'ProposalCreated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'id', type: 'uint256' }, - { - indexed: true, - internalType: 'address', - name: 'initiatorExecution', - type: 'address', - }, - ], - name: 'ProposalExecuted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'id', type: 'uint256' }, - { - indexed: false, - internalType: 'uint256', - name: 'executionTime', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'initiatorQueueing', - type: 'address', - }, - ], - name: 'ProposalQueued', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'id', type: 'uint256' }, - { - indexed: true, - internalType: 'address', - name: 'voter', - type: 'address', - }, - { indexed: false, internalType: 'bool', name: 'support', type: 'bool' }, - { - indexed: false, - internalType: 'uint256', - name: 'votingPower', - type: 'uint256', - }, - ], - name: 'VoteEmitted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newVotingDelay', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'initiatorChange', - type: 'address', - }, - ], - name: 'VotingDelayChanged', - type: 'event', - }, - { - inputs: [], - name: 'DOMAIN_TYPEHASH', - outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'NAME', - outputs: [{ internalType: 'string', name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'VOTE_EMITTED_TYPEHASH', - outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: '__abdicate', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address[]', name: 'executors', type: 'address[]' }], - name: 'authorizeExecutors', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'cancel', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IExecutorWithTimelock', - name: 'executor', - type: 'address', - }, - { internalType: 'address[]', name: 'targets', type: 'address[]' }, - { internalType: 'uint256[]', name: 'values', type: 'uint256[]' }, - { internalType: 'string[]', name: 'signatures', type: 'string[]' }, - { internalType: 'bytes[]', name: 'calldatas', type: 'bytes[]' }, - { internalType: 'bool[]', name: 'withDelegatecalls', type: 'bool[]' }, - { internalType: 'bytes32', name: 'ipfsHash', type: 'bytes32' }, - ], - name: 'create', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'execute', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [], - name: 'getGovernanceStrategy', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getGuardian', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'getProposalById', - outputs: [ - { - components: [ - { internalType: 'uint256', name: 'id', type: 'uint256' }, - { internalType: 'address', name: 'creator', type: 'address' }, - { - internalType: 'contract IExecutorWithTimelock', - name: 'executor', - type: 'address', - }, - { internalType: 'address[]', name: 'targets', type: 'address[]' }, - { internalType: 'uint256[]', name: 'values', type: 'uint256[]' }, - { internalType: 'string[]', name: 'signatures', type: 'string[]' }, - { internalType: 'bytes[]', name: 'calldatas', type: 'bytes[]' }, - { internalType: 'bool[]', name: 'withDelegatecalls', type: 'bool[]' }, - { internalType: 'uint256', name: 'startBlock', type: 'uint256' }, - { internalType: 'uint256', name: 'endBlock', type: 'uint256' }, - { internalType: 'uint256', name: 'executionTime', type: 'uint256' }, - { internalType: 'uint256', name: 'forVotes', type: 'uint256' }, - { internalType: 'uint256', name: 'againstVotes', type: 'uint256' }, - { internalType: 'bool', name: 'executed', type: 'bool' }, - { internalType: 'bool', name: 'canceled', type: 'bool' }, - { internalType: 'address', name: 'strategy', type: 'address' }, - { internalType: 'bytes32', name: 'ipfsHash', type: 'bytes32' }, - ], - internalType: 'struct IAaveGovernanceV2.ProposalWithoutVotes', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'getProposalState', - outputs: [ - { - internalType: 'enum IAaveGovernanceV2.ProposalState', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getProposalsCount', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { internalType: 'address', name: 'voter', type: 'address' }, - ], - name: 'getVoteOnProposal', - outputs: [ - { - components: [ - { internalType: 'bool', name: 'support', type: 'bool' }, - { internalType: 'uint248', name: 'votingPower', type: 'uint248' }, - ], - internalType: 'struct IAaveGovernanceV2.Vote', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getVotingDelay', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'executor', type: 'address' }], - name: 'isExecutorAuthorized', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'queue', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'governanceStrategy', type: 'address' }], - name: 'setGovernanceStrategy', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'votingDelay', type: 'uint256' }], - name: 'setVotingDelay', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { internalType: 'bool', name: 'support', type: 'bool' }, - ], - name: 'submitVote', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { internalType: 'bool', name: 'support', type: 'bool' }, - { internalType: 'uint8', name: 'v', type: 'uint8' }, - { internalType: 'bytes32', name: 'r', type: 'bytes32' }, - { internalType: 'bytes32', name: 's', type: 'bytes32' }, - ], - name: 'submitVoteBySignature', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address[]', name: 'executors', type: 'address[]' }], - name: 'unauthorizeExecutors', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - export enum PROPOSAL_STATES { PENDING, CANCELED, diff --git a/src/simulate/govv2/abis/Executor.ts b/src/simulate/govv2/abis/Executor.ts index 004e094..7c9f451 100644 --- a/src/simulate/govv2/abis/Executor.ts +++ b/src/simulate/govv2/abis/Executor.ts @@ -1,472 +1,468 @@ export const EXECUTOR_ABI = [ { inputs: [ - { internalType: "address", name: "admin", type: "address" }, - { internalType: "uint256", name: "delay", type: "uint256" }, - { internalType: "uint256", name: "gracePeriod", type: "uint256" }, - { internalType: "uint256", name: "minimumDelay", type: "uint256" }, - { internalType: "uint256", name: "maximumDelay", type: "uint256" }, + { internalType: 'address', name: 'admin', type: 'address' }, + { internalType: 'uint256', name: 'delay', type: 'uint256' }, + { internalType: 'uint256', name: 'gracePeriod', type: 'uint256' }, + { internalType: 'uint256', name: 'minimumDelay', type: 'uint256' }, + { internalType: 'uint256', name: 'maximumDelay', type: 'uint256' }, { - internalType: "uint256", - name: "propositionThreshold", - type: "uint256", + internalType: 'uint256', + name: 'propositionThreshold', + type: 'uint256', }, - { internalType: "uint256", name: "voteDuration", type: "uint256" }, - { internalType: "uint256", name: "voteDifferential", type: "uint256" }, - { internalType: "uint256", name: "minimumQuorum", type: "uint256" }, + { internalType: 'uint256', name: 'voteDuration', type: 'uint256' }, + { internalType: 'uint256', name: 'voteDifferential', type: 'uint256' }, + { internalType: 'uint256', name: 'minimumQuorum', type: 'uint256' }, ], - stateMutability: "nonpayable", - type: "constructor", + stateMutability: 'nonpayable', + type: 'constructor', }, { anonymous: false, inputs: [ { indexed: false, - internalType: "bytes32", - name: "actionHash", - type: "bytes32", + internalType: 'bytes32', + name: 'actionHash', + type: 'bytes32', }, { indexed: true, - internalType: "address", - name: "target", - type: "address", + internalType: 'address', + name: 'target', + type: 'address', }, { indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", + internalType: 'uint256', + name: 'value', + type: 'uint256', }, { indexed: false, - internalType: "string", - name: "signature", - type: "string", + internalType: 'string', + name: 'signature', + type: 'string', }, - { indexed: false, internalType: "bytes", name: "data", type: "bytes" }, + { indexed: false, internalType: 'bytes', name: 'data', type: 'bytes' }, { indexed: false, - internalType: "uint256", - name: "executionTime", - type: "uint256", + internalType: 'uint256', + name: 'executionTime', + type: 'uint256', }, { indexed: false, - internalType: "bool", - name: "withDelegatecall", - type: "bool", + internalType: 'bool', + name: 'withDelegatecall', + type: 'bool', }, ], - name: "CancelledAction", - type: "event", + name: 'CancelledAction', + type: 'event', }, { anonymous: false, inputs: [ { indexed: false, - internalType: "bytes32", - name: "actionHash", - type: "bytes32", + internalType: 'bytes32', + name: 'actionHash', + type: 'bytes32', }, { indexed: true, - internalType: "address", - name: "target", - type: "address", + internalType: 'address', + name: 'target', + type: 'address', }, { indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", + internalType: 'uint256', + name: 'value', + type: 'uint256', }, { indexed: false, - internalType: "string", - name: "signature", - type: "string", + internalType: 'string', + name: 'signature', + type: 'string', }, - { indexed: false, internalType: "bytes", name: "data", type: "bytes" }, + { indexed: false, internalType: 'bytes', name: 'data', type: 'bytes' }, { indexed: false, - internalType: "uint256", - name: "executionTime", - type: "uint256", + internalType: 'uint256', + name: 'executionTime', + type: 'uint256', }, { indexed: false, - internalType: "bool", - name: "withDelegatecall", - type: "bool", + internalType: 'bool', + name: 'withDelegatecall', + type: 'bool', }, { indexed: false, - internalType: "bytes", - name: "resultData", - type: "bytes", + internalType: 'bytes', + name: 'resultData', + type: 'bytes', }, ], - name: "ExecutedAction", - type: "event", + name: 'ExecutedAction', + type: 'event', }, { anonymous: false, inputs: [ { indexed: false, - internalType: "address", - name: "newAdmin", - type: "address", + internalType: 'address', + name: 'newAdmin', + type: 'address', }, ], - name: "NewAdmin", - type: "event", + name: 'NewAdmin', + type: 'event', }, { anonymous: false, inputs: [ { indexed: false, - internalType: "uint256", - name: "delay", - type: "uint256", + internalType: 'uint256', + name: 'delay', + type: 'uint256', }, ], - name: "NewDelay", - type: "event", + name: 'NewDelay', + type: 'event', }, { anonymous: false, inputs: [ { indexed: false, - internalType: "address", - name: "newPendingAdmin", - type: "address", + internalType: 'address', + name: 'newPendingAdmin', + type: 'address', }, ], - name: "NewPendingAdmin", - type: "event", + name: 'NewPendingAdmin', + type: 'event', }, { anonymous: false, inputs: [ { indexed: false, - internalType: "bytes32", - name: "actionHash", - type: "bytes32", + internalType: 'bytes32', + name: 'actionHash', + type: 'bytes32', }, { indexed: true, - internalType: "address", - name: "target", - type: "address", + internalType: 'address', + name: 'target', + type: 'address', }, { indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", + internalType: 'uint256', + name: 'value', + type: 'uint256', }, { indexed: false, - internalType: "string", - name: "signature", - type: "string", + internalType: 'string', + name: 'signature', + type: 'string', }, - { indexed: false, internalType: "bytes", name: "data", type: "bytes" }, + { indexed: false, internalType: 'bytes', name: 'data', type: 'bytes' }, { indexed: false, - internalType: "uint256", - name: "executionTime", - type: "uint256", + internalType: 'uint256', + name: 'executionTime', + type: 'uint256', }, { indexed: false, - internalType: "bool", - name: "withDelegatecall", - type: "bool", + internalType: 'bool', + name: 'withDelegatecall', + type: 'bool', }, ], - name: "QueuedAction", - type: "event", + name: 'QueuedAction', + type: 'event', }, { inputs: [], - name: "GRACE_PERIOD", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'GRACE_PERIOD', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "MAXIMUM_DELAY", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'MAXIMUM_DELAY', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "MINIMUM_DELAY", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'MINIMUM_DELAY', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "MINIMUM_QUORUM", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'MINIMUM_QUORUM', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "ONE_HUNDRED_WITH_PRECISION", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'ONE_HUNDRED_WITH_PRECISION', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "PROPOSITION_THRESHOLD", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'PROPOSITION_THRESHOLD', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "VOTE_DIFFERENTIAL", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'VOTE_DIFFERENTIAL', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "VOTING_DURATION", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'VOTING_DURATION', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "acceptAdmin", + name: 'acceptAdmin', outputs: [], - stateMutability: "nonpayable", - type: "function", + stateMutability: 'nonpayable', + type: 'function', }, { inputs: [ - { internalType: "address", name: "target", type: "address" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { internalType: "string", name: "signature", type: "string" }, - { internalType: "bytes", name: "data", type: "bytes" }, - { internalType: "uint256", name: "executionTime", type: "uint256" }, - { internalType: "bool", name: "withDelegatecall", type: "bool" }, + { internalType: 'address', name: 'target', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'string', name: 'signature', type: 'string' }, + { internalType: 'bytes', name: 'data', type: 'bytes' }, + { internalType: 'uint256', name: 'executionTime', type: 'uint256' }, + { internalType: 'bool', name: 'withDelegatecall', type: 'bool' }, ], - name: "cancelTransaction", - outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], - stateMutability: "nonpayable", - type: "function", + name: 'cancelTransaction', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'nonpayable', + type: 'function', }, { inputs: [ - { internalType: "address", name: "target", type: "address" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { internalType: "string", name: "signature", type: "string" }, - { internalType: "bytes", name: "data", type: "bytes" }, - { internalType: "uint256", name: "executionTime", type: "uint256" }, - { internalType: "bool", name: "withDelegatecall", type: "bool" }, + { internalType: 'address', name: 'target', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'string', name: 'signature', type: 'string' }, + { internalType: 'bytes', name: 'data', type: 'bytes' }, + { internalType: 'uint256', name: 'executionTime', type: 'uint256' }, + { internalType: 'bool', name: 'withDelegatecall', type: 'bool' }, ], - name: "executeTransaction", - outputs: [{ internalType: "bytes", name: "", type: "bytes" }], - stateMutability: "payable", - type: "function", + name: 'executeTransaction', + outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], + stateMutability: 'payable', + type: 'function', }, { inputs: [], - name: "getAdmin", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", + name: 'getAdmin', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "getDelay", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'getDelay', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [ { - internalType: "contract IAaveGovernanceV2", - name: "governance", - type: "address", + internalType: 'contract IAaveGovernanceV2', + name: 'governance', + type: 'address', }, - { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, ], - name: "getMinimumPropositionPowerNeeded", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + name: 'getMinimumPropositionPowerNeeded', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { - inputs: [ - { internalType: "uint256", name: "votingSupply", type: "uint256" }, - ], - name: "getMinimumVotingPowerNeeded", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", + inputs: [{ internalType: 'uint256', name: 'votingSupply', type: 'uint256' }], + name: 'getMinimumVotingPowerNeeded', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', }, { inputs: [], - name: "getPendingAdmin", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", + name: 'getPendingAdmin', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', }, { - inputs: [{ internalType: "bytes32", name: "actionHash", type: "bytes32" }], - name: "isActionQueued", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", + inputs: [{ internalType: 'bytes32', name: 'actionHash', type: 'bytes32' }], + name: 'isActionQueued', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', }, { inputs: [ { - internalType: "contract IAaveGovernanceV2", - name: "governance", - type: "address", + internalType: 'contract IAaveGovernanceV2', + name: 'governance', + type: 'address', }, - { internalType: "uint256", name: "proposalId", type: "uint256" }, + { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, ], - name: "isProposalOverGracePeriod", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", + name: 'isProposalOverGracePeriod', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', }, { inputs: [ { - internalType: "contract IAaveGovernanceV2", - name: "governance", - type: "address", + internalType: 'contract IAaveGovernanceV2', + name: 'governance', + type: 'address', }, - { internalType: "uint256", name: "proposalId", type: "uint256" }, + { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, ], - name: "isProposalPassed", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", + name: 'isProposalPassed', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', }, { inputs: [ { - internalType: "contract IAaveGovernanceV2", - name: "governance", - type: "address", + internalType: 'contract IAaveGovernanceV2', + name: 'governance', + type: 'address', }, - { internalType: "address", name: "user", type: "address" }, - { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: 'address', name: 'user', type: 'address' }, + { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, ], - name: "isPropositionPowerEnough", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", + name: 'isPropositionPowerEnough', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', }, { inputs: [ { - internalType: "contract IAaveGovernanceV2", - name: "governance", - type: "address", + internalType: 'contract IAaveGovernanceV2', + name: 'governance', + type: 'address', }, - { internalType: "uint256", name: "proposalId", type: "uint256" }, + { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, ], - name: "isQuorumValid", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", + name: 'isQuorumValid', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', }, { inputs: [ { - internalType: "contract IAaveGovernanceV2", - name: "governance", - type: "address", + internalType: 'contract IAaveGovernanceV2', + name: 'governance', + type: 'address', }, - { internalType: "uint256", name: "proposalId", type: "uint256" }, + { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, ], - name: "isVoteDifferentialValid", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", + name: 'isVoteDifferentialValid', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', }, { inputs: [ - { internalType: "address", name: "target", type: "address" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { internalType: "string", name: "signature", type: "string" }, - { internalType: "bytes", name: "data", type: "bytes" }, - { internalType: "uint256", name: "executionTime", type: "uint256" }, - { internalType: "bool", name: "withDelegatecall", type: "bool" }, + { internalType: 'address', name: 'target', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'string', name: 'signature', type: 'string' }, + { internalType: 'bytes', name: 'data', type: 'bytes' }, + { internalType: 'uint256', name: 'executionTime', type: 'uint256' }, + { internalType: 'bool', name: 'withDelegatecall', type: 'bool' }, ], - name: "queueTransaction", - outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], - stateMutability: "nonpayable", - type: "function", + name: 'queueTransaction', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'nonpayable', + type: 'function', }, { - inputs: [{ internalType: "uint256", name: "delay", type: "uint256" }], - name: "setDelay", + inputs: [{ internalType: 'uint256', name: 'delay', type: 'uint256' }], + name: 'setDelay', outputs: [], - stateMutability: "nonpayable", - type: "function", + stateMutability: 'nonpayable', + type: 'function', }, { - inputs: [ - { internalType: "address", name: "newPendingAdmin", type: "address" }, - ], - name: "setPendingAdmin", + inputs: [{ internalType: 'address', name: 'newPendingAdmin', type: 'address' }], + name: 'setPendingAdmin', outputs: [], - stateMutability: "nonpayable", - type: "function", + stateMutability: 'nonpayable', + type: 'function', }, { inputs: [ { - internalType: "contract IAaveGovernanceV2", - name: "governance", - type: "address", + internalType: 'contract IAaveGovernanceV2', + name: 'governance', + type: 'address', }, - { internalType: "address", name: "user", type: "address" }, - { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: 'address', name: 'user', type: 'address' }, + { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, ], - name: "validateCreatorOfProposal", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", + name: 'validateCreatorOfProposal', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', }, { inputs: [ { - internalType: "contract IAaveGovernanceV2", - name: "governance", - type: "address", + internalType: 'contract IAaveGovernanceV2', + name: 'governance', + type: 'address', }, - { internalType: "address", name: "user", type: "address" }, - { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: 'address', name: 'user', type: 'address' }, + { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, ], - name: "validateProposalCancellation", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", + name: 'validateProposalCancellation', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', }, - { stateMutability: "payable", type: "receive" }, + { stateMutability: 'payable', type: 'receive' }, ] as const; diff --git a/src/simulate/govv2/networks/commonL2.ts b/src/simulate/govv2/networks/commonL2.ts index fa9a385..d18dc8b 100644 --- a/src/simulate/govv2/networks/commonL2.ts +++ b/src/simulate/govv2/networks/commonL2.ts @@ -1,7 +1,6 @@ import { Abi, GetContractReturnType, - GetFilterLogsReturnType, Hex, PublicClient, decodeFunctionData, diff --git a/src/simulate/govv2/networks/mainnet.ts b/src/simulate/govv2/networks/mainnet.ts index e97509d..6aeb2a2 100644 --- a/src/simulate/govv2/networks/mainnet.ts +++ b/src/simulate/govv2/networks/mainnet.ts @@ -1,7 +1,6 @@ -import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; +import { AaveGovernanceV2, IAaveGovernanceV2_ABI } from '@bgd-labs/aave-address-book'; import { ActionSetState, L2NetworkModule, MainnetModule, ProposalState } from './types'; import { - Hex, PublicClient, WalletClient, concat, @@ -17,13 +16,9 @@ import { } from 'viem'; import { mainnetClient } from '../../../utils/rpcClients'; import { getLogs } from '../../../utils/logs'; -import { StateObject, Trace, tenderly } from '../../../utils/tenderlyClient'; +import { Trace, tenderly } from '../../../utils/tenderlyClient'; import { EOA } from '../../../utils/constants'; -import { - AAVE_GOVERNANCE_V2_ABI, - AAVE_GOVERNANCE_V2_START_BLOCK, - getAaveGovernanceV2Slots, -} from '../abis/AaveGovernanceV2'; +import { AAVE_GOVERNANCE_V2_START_BLOCK, getAaveGovernanceV2Slots } from '../abis/AaveGovernanceV2'; import { EXECUTOR_ABI } from '../abis/Executor'; import { getSolidityStorageSlotBytes } from '../../../utils/storageSlots'; import { ARC_TIMELOCK_ABI } from '../abis/ArcTimelock'; @@ -39,14 +34,14 @@ export const getGovernanceV2Contract = ({ if (walletClient) { return getContract({ address: AaveGovernanceV2.GOV, - abi: AAVE_GOVERNANCE_V2_ABI, + abi: IAaveGovernanceV2_ABI, walletClient, publicClient, }); } return getContract({ address: AaveGovernanceV2.GOV, - abi: AAVE_GOVERNANCE_V2_ABI, + abi: IAaveGovernanceV2_ABI, publicClient, }); }; @@ -137,7 +132,7 @@ export const mainnet: MainnetModule = { value: proposal.values.reduce((sum, cur) => sum + cur).toString(), gas: 30_000_000, input: encodeFunctionData({ - abi: AAVE_GOVERNANCE_V2_ABI, + abi: IAaveGovernanceV2_ABI, functionName: 'execute', args: [proposalId], }), diff --git a/src/simulate/govv2/networks/types.ts b/src/simulate/govv2/networks/types.ts index 2849362..0dc1722 100644 --- a/src/simulate/govv2/networks/types.ts +++ b/src/simulate/govv2/networks/types.ts @@ -1,8 +1,8 @@ import type { Abi } from 'abitype'; import { TenderlySimulationResponse, Trace } from '../../../utils/tenderlyClient'; import { GetFilterLogsReturnType, Hex, ReadContractReturnType } from 'viem'; -import { AAVE_GOVERNANCE_V2_ABI } from '../abis/AaveGovernanceV2'; import { GetProposalStateProps, getProposalState } from './commonL2'; +import { IAaveGovernanceV2_ABI } from '@bgd-labs/aave-address-book'; export type FormattedArgs = { targets: Hex[]; @@ -67,27 +67,27 @@ export enum ProposalState { export interface MainnetModule { name: string; cacheLogs: () => Promise<{ - createdLogs: Array>; - queuedLogs: Array>; - executedLogs: Array>; + createdLogs: Array>; + queuedLogs: Array>; + executedLogs: Array>; }>; getProposalState: (args: { proposalId: bigint; - createdLogs: Array>; - queuedLogs: Array>; - executedLogs: Array>; + createdLogs: Array>; + queuedLogs: Array>; + executedLogs: Array>; }) => | { state: ProposalState.EXECUTED; - log: FilterLogWithTimestamp; + log: FilterLogWithTimestamp; } | { state: ProposalState.QUEUED; - log: FilterLogWithTimestamp; + log: FilterLogWithTimestamp; } | { state: ProposalState.CREATED; - log: FilterLogWithTimestamp; + log: FilterLogWithTimestamp; }; simulateOnTenderly: ( args: { @@ -95,19 +95,19 @@ export interface MainnetModule { } & ( | { state: ProposalState.EXECUTED; - log: FilterLogWithTimestamp; + log: FilterLogWithTimestamp; } | { state: ProposalState.QUEUED; - log: FilterLogWithTimestamp; + log: FilterLogWithTimestamp; } | { state: ProposalState.CREATED; - log: FilterLogWithTimestamp; + log: FilterLogWithTimestamp; } ) ) => Promise<{ - proposal: ReadContractReturnType; + proposal: ReadContractReturnType; simulation: TenderlySimulationResponse; }>; } diff --git a/src/simulate/govv3/abis/GovernanceExtended.ts b/src/simulate/govv3/abis/GovernanceExtended.ts deleted file mode 100644 index 21add94..0000000 --- a/src/simulate/govv3/abis/GovernanceExtended.ts +++ /dev/null @@ -1,494 +0,0 @@ -export const GOVERNANCE_EXTENDED_ABI = [ - { - inputs: [ - { internalType: 'address', name: 'crossChainController', type: 'address' }, - { internalType: 'uint256', name: 'coolDownPeriod', type: 'uint256' }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [{ indexed: true, internalType: 'uint256', name: 'gasLimit', type: 'uint256' }], - name: 'GasLimitUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'address', name: 'oldGuardian', type: 'address' }, - { indexed: false, internalType: 'address', name: 'newGuardian', type: 'address' }, - ], - name: 'GuardianUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [{ indexed: false, internalType: 'uint8', name: 'version', type: 'uint8' }], - name: 'Initialized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' }, - { indexed: true, internalType: 'address', name: 'newOwner', type: 'address' }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { indexed: false, internalType: 'uint40', name: 'payloadId', type: 'uint40' }, - { indexed: true, internalType: 'address', name: 'payloadsController', type: 'address' }, - { indexed: true, internalType: 'uint256', name: 'chainId', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'payloadNumberOnProposal', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'numberOfPayloadsOnProposal', type: 'uint256' }, - ], - name: 'PayloadSent', - type: 'event', - }, - { - anonymous: false, - inputs: [{ indexed: true, internalType: 'address', name: 'newPowerStrategy', type: 'address' }], - name: 'PowerStrategyUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [{ indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'ProposalCanceled', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { indexed: true, internalType: 'address', name: 'creator', type: 'address' }, - { indexed: true, internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { indexed: false, internalType: 'bytes32', name: 'ipfsHash', type: 'bytes32' }, - ], - name: 'ProposalCreated', - type: 'event', - }, - { - anonymous: false, - inputs: [{ indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'ProposalExecuted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { indexed: false, internalType: 'uint128', name: 'votesFor', type: 'uint128' }, - { indexed: false, internalType: 'uint128', name: 'votesAgainst', type: 'uint128' }, - ], - name: 'ProposalFailed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { indexed: false, internalType: 'uint128', name: 'votesFor', type: 'uint128' }, - { indexed: false, internalType: 'uint128', name: 'votesAgainst', type: 'uint128' }, - ], - name: 'ProposalQueued', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { indexed: true, internalType: 'address', name: 'voter', type: 'address' }, - { indexed: true, internalType: 'bool', name: 'support', type: 'bool' }, - { - components: [ - { internalType: 'address', name: 'underlyingAsset', type: 'address' }, - { internalType: 'uint128', name: 'slot', type: 'uint128' }, - ], - indexed: false, - internalType: 'struct IVotingMachineWithProofs.VotingAssetWithSlot[]', - name: 'votingAssetsWithSlot', - type: 'tuple[]', - }, - ], - name: 'VoteForwarded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { indexed: true, internalType: 'bytes32', name: 'snapshotBlockHash', type: 'bytes32' }, - { indexed: false, internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, - ], - name: 'VotingActivated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { indexed: false, internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, - { indexed: false, internalType: 'uint24', name: 'coolDownBeforeVotingStart', type: 'uint24' }, - { indexed: false, internalType: 'uint256', name: 'quorum', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'differential', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'minPropositionPower', type: 'uint256' }, - ], - name: 'VotingConfigUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'address', name: 'votingPortal', type: 'address' }, - { indexed: true, internalType: 'bool', name: 'approved', type: 'bool' }, - ], - name: 'VotingPortalUpdated', - type: 'event', - }, - { - inputs: [], - name: 'ACHIEVABLE_VOTING_PARTICIPATION', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [], - name: 'COOLDOWN_PERIOD', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'CROSS_CHAIN_CONTROLLER', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MIN_VOTING_DURATION', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [], - name: 'NAME', - outputs: [{ internalType: 'string', name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'PRECISION_DIVIDER', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'PROPOSAL_EXPIRATION_TIME', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'VOTING_TOKENS_CAP', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'activateVoting', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address[]', name: 'votingPortals', type: 'address[]' }], - name: 'addVotingPortals', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'cancelProposal', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'uint256', name: 'chain', type: 'uint256' }, - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { internalType: 'address', name: 'payloadsController', type: 'address' }, - { internalType: 'uint40', name: 'payloadId', type: 'uint40' }, - ], - internalType: 'struct PayloadsControllerUtils.Payload[]', - name: 'payloads', - type: 'tuple[]', - }, - { internalType: 'address', name: 'votingPortal', type: 'address' }, - { internalType: 'bytes32', name: 'ipfsHash', type: 'bytes32' }, - ], - name: 'createProposal', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'executeProposal', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getGasLimit', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPowerStrategy', - outputs: [{ internalType: 'contract IGovernancePowerStrategy', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'getProposal', - outputs: [ - { - components: [ - { internalType: 'enum IGovernanceCore.State', name: 'state', type: 'uint8' }, - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { internalType: 'uint40', name: 'creationTime', type: 'uint40' }, - { internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, - { internalType: 'uint40', name: 'votingActivationTime', type: 'uint40' }, - { internalType: 'uint40', name: 'queuingTime', type: 'uint40' }, - { internalType: 'uint40', name: 'cancelTimestamp', type: 'uint40' }, - { internalType: 'address', name: 'creator', type: 'address' }, - { internalType: 'address', name: 'votingPortal', type: 'address' }, - { internalType: 'bytes32', name: 'snapshotBlockHash', type: 'bytes32' }, - { internalType: 'bytes32', name: 'ipfsHash', type: 'bytes32' }, - { internalType: 'uint128', name: 'forVotes', type: 'uint128' }, - { internalType: 'uint128', name: 'againstVotes', type: 'uint128' }, - { - components: [ - { internalType: 'uint256', name: 'chain', type: 'uint256' }, - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { internalType: 'address', name: 'payloadsController', type: 'address' }, - { internalType: 'uint40', name: 'payloadId', type: 'uint40' }, - ], - internalType: 'struct PayloadsControllerUtils.Payload[]', - name: 'payloads', - type: 'tuple[]', - }, - ], - internalType: 'struct IGovernanceCore.Proposal', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'proposalId', type: 'uint256' }], - name: 'getProposalState', - outputs: [{ internalType: 'enum IGovernanceCore.State', name: '', type: 'uint8' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getProposalsCount', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }], - name: 'getVotingConfig', - outputs: [ - { - components: [ - { internalType: 'uint24', name: 'coolDownBeforeVotingStart', type: 'uint24' }, - { internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, - { internalType: 'uint56', name: 'quorum', type: 'uint56' }, - { internalType: 'uint56', name: 'differential', type: 'uint56' }, - { internalType: 'uint56', name: 'minPropositionPower', type: 'uint56' }, - ], - internalType: 'struct IGovernanceCore.VotingConfig', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getVotingPortalsCount', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'guardian', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'address', name: 'guardian', type: 'address' }, - { internalType: 'contract IGovernancePowerStrategy', name: 'powerStrategy', type: 'address' }, - { - components: [ - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { internalType: 'uint24', name: 'coolDownBeforeVotingStart', type: 'uint24' }, - { internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, - { internalType: 'uint256', name: 'quorum', type: 'uint256' }, - { internalType: 'uint256', name: 'differential', type: 'uint256' }, - { internalType: 'uint256', name: 'minPropositionPower', type: 'uint256' }, - ], - internalType: 'struct IGovernanceCore.SetVotingConfigInput[]', - name: 'votingConfigs', - type: 'tuple[]', - }, - { internalType: 'address[]', name: 'votingPortals', type: 'address[]' }, - { internalType: 'uint256', name: 'gasLimit', type: 'uint256' }, - ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'votingPortal', type: 'address' }], - name: 'isVotingPortalApproved', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { internalType: 'uint128', name: 'forVotes', type: 'uint128' }, - { internalType: 'uint128', name: 'againstVotes', type: 'uint128' }, - ], - name: 'queueProposal', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address[]', name: 'votingPortals', type: 'address[]' }], - name: 'removeVotingPortals', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function' }, - { - inputs: [{ internalType: 'address', name: 'votingPortal', type: 'address' }], - name: 'rescueVotingPortal', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'contract IGovernancePowerStrategy', name: 'powerStrategy', type: 'address' }], - name: 'setPowerStrategy', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { internalType: 'uint24', name: 'coolDownBeforeVotingStart', type: 'uint24' }, - { internalType: 'uint24', name: 'votingDuration', type: 'uint24' }, - { internalType: 'uint256', name: 'quorum', type: 'uint256' }, - { internalType: 'uint256', name: 'differential', type: 'uint256' }, - { internalType: 'uint256', name: 'minPropositionPower', type: 'uint256' }, - ], - internalType: 'struct IGovernanceCore.SetVotingConfigInput[]', - name: 'votingConfigs', - type: 'tuple[]', - }, - ], - name: 'setVotingConfigs', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'gasLimit', type: 'uint256' }], - name: 'updateGasLimit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'newGuardian', type: 'address' }], - name: 'updateGuardian', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - { internalType: 'bool', name: 'support', type: 'bool' }, - { - components: [ - { internalType: 'address', name: 'underlyingAsset', type: 'address' }, - { internalType: 'uint128', name: 'slot', type: 'uint128' }, - ], - internalType: 'struct IVotingMachineWithProofs.VotingAssetWithSlot[]', - name: 'votingAssetsWithSlot', - type: 'tuple[]', - }, - ], - name: 'voteViaPortal', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; diff --git a/src/simulate/govv3/abis/PayloadsControllerExtended.ts b/src/simulate/govv3/abis/PayloadsControllerExtended.ts deleted file mode 100644 index 87b5f18..0000000 --- a/src/simulate/govv3/abis/PayloadsControllerExtended.ts +++ /dev/null @@ -1,414 +0,0 @@ -export const PAYLOADS_CONTROLLER_EXTENDED_ABI = [ - { - inputs: [ - { internalType: 'address', name: 'crossChainController', type: 'address' }, - { internalType: 'address', name: 'messageOriginator', type: 'address' }, - { internalType: 'uint256', name: 'originChainId', type: 'uint256' }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'address', name: 'caller', type: 'address' }, - { indexed: true, internalType: 'address', name: 'token', type: 'address' }, - { indexed: true, internalType: 'address', name: 'to', type: 'address' }, - { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' }, - ], - name: 'ERC20Rescued', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { indexed: true, internalType: 'address', name: 'executor', type: 'address' }, - { indexed: false, internalType: 'uint40', name: 'delay', type: 'uint40' }, - ], - name: 'ExecutorSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'address', name: 'oldGuardian', type: 'address' }, - { indexed: false, internalType: 'address', name: 'newGuardian', type: 'address' }, - ], - name: 'GuardianUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [{ indexed: false, internalType: 'uint8', name: 'version', type: 'uint8' }], - name: 'Initialized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'address', name: 'caller', type: 'address' }, - { indexed: true, internalType: 'address', name: 'to', type: 'address' }, - { indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' }, - ], - name: 'NativeTokensRescued', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' }, - { indexed: true, internalType: 'address', name: 'newOwner', type: 'address' }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [{ indexed: false, internalType: 'uint40', name: 'payloadId', type: 'uint40' }], - name: 'PayloadCancelled', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint40', name: 'payloadId', type: 'uint40' }, - { indexed: true, internalType: 'address', name: 'creator', type: 'address' }, - { - components: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bool', name: 'withDelegateCall', type: 'bool' }, - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'string', name: 'signature', type: 'string' }, - { internalType: 'bytes', name: 'callData', type: 'bytes' }, - ], - indexed: false, - internalType: 'struct IPayloadsControllerCore.ExecutionAction[]', - name: 'actions', - type: 'tuple[]', - }, - { - indexed: true, - internalType: 'enum PayloadsControllerUtils.AccessControl', - name: 'maximumAccessLevelRequired', - type: 'uint8', - }, - ], - name: 'PayloadCreated', - type: 'event', - }, - { - anonymous: false, - inputs: [{ indexed: false, internalType: 'uint40', name: 'payloadId', type: 'uint40' }], - name: 'PayloadExecuted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'address', name: 'originSender', type: 'address' }, - { indexed: true, internalType: 'uint256', name: 'originChainId', type: 'uint256' }, - { indexed: true, internalType: 'bool', name: 'delivered', type: 'bool' }, - { indexed: false, internalType: 'bytes', name: 'message', type: 'bytes' }, - { indexed: false, internalType: 'bytes', name: 'reason', type: 'bytes' }, - ], - name: 'PayloadExecutionMessageReceived', - type: 'event', - }, - { - anonymous: false, - inputs: [{ indexed: false, internalType: 'uint40', name: 'payloadId', type: 'uint40' }], - name: 'PayloadQueued', - type: 'event', - }, - { - inputs: [], - name: 'CROSS_CHAIN_CONTROLLER', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'EXPIRATION_DELAY', - outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'GRACE_PERIOD', - outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_EXECUTION_DELAY', - outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [], - name: 'MESSAGE_ORIGINATOR', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MIN_EXECUTION_DELAY', - outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [], - name: 'ORIGIN_CHAIN_ID', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint40', name: 'payloadId', type: 'uint40' }], - name: 'cancelPayload', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bool', name: 'withDelegateCall', type: 'bool' }, - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'string', name: 'signature', type: 'string' }, - { internalType: 'bytes', name: 'callData', type: 'bytes' }, - ], - internalType: 'struct IPayloadsControllerCore.ExecutionAction[]', - name: 'actions', - type: 'tuple[]', - }, - ], - name: 'createPayload', - outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'bytes', name: 'message', type: 'bytes' }], - name: 'decodeMessage', - outputs: [ - { internalType: 'uint40', name: '', type: 'uint40' }, - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: '', type: 'uint8' }, - { internalType: 'uint40', name: '', type: 'uint40' }, - ], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - ], - name: 'emergencyEtherTransfer', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'erc20Token', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'amount', type: 'uint256' }, - ], - name: 'emergencyTokenTransfer', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint40', name: 'payloadId', type: 'uint40' }], - name: 'executePayload', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [{ internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessControl', type: 'uint8' }], - name: 'getExecutorSettingsByAccessControl', - outputs: [ - { - components: [ - { internalType: 'address', name: 'executor', type: 'address' }, - { internalType: 'uint40', name: 'delay', type: 'uint40' }, - ], - internalType: 'struct IPayloadsControllerCore.ExecutorConfig', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint40', name: 'payloadId', type: 'uint40' }], - name: 'getPayloadById', - outputs: [ - { - components: [ - { internalType: 'address', name: 'creator', type: 'address' }, - { - internalType: 'enum PayloadsControllerUtils.AccessControl', - name: 'maximumAccessLevelRequired', - type: 'uint8', - }, - { internalType: 'enum IPayloadsControllerCore.PayloadState', name: 'state', type: 'uint8' }, - { internalType: 'uint40', name: 'createdAt', type: 'uint40' }, - { internalType: 'uint40', name: 'queuedAt', type: 'uint40' }, - { internalType: 'uint40', name: 'executedAt', type: 'uint40' }, - { internalType: 'uint40', name: 'cancelledAt', type: 'uint40' }, - { internalType: 'uint40', name: 'expirationTime', type: 'uint40' }, - { internalType: 'uint40', name: 'delay', type: 'uint40' }, - { internalType: 'uint40', name: 'gracePeriod', type: 'uint40' }, - { - components: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bool', name: 'withDelegateCall', type: 'bool' }, - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'string', name: 'signature', type: 'string' }, - { internalType: 'bytes', name: 'callData', type: 'bytes' }, - ], - internalType: 'struct IPayloadsControllerCore.ExecutionAction[]', - name: 'actions', - type: 'tuple[]', - }, - ], - internalType: 'struct IPayloadsControllerCore.Payload', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint40', name: 'payloadId', type: 'uint40' }], - name: 'getPayloadState', - outputs: [{ internalType: 'enum IPayloadsControllerCore.PayloadState', name: '', type: 'uint8' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPayloadsCount', - outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'guardian', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'address', name: 'guardian', type: 'address' }, - { - components: [ - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { - components: [ - { internalType: 'address', name: 'executor', type: 'address' }, - { internalType: 'uint40', name: 'delay', type: 'uint40' }, - ], - internalType: 'struct IPayloadsControllerCore.ExecutorConfig', - name: 'executorConfig', - type: 'tuple', - }, - ], - internalType: 'struct IPayloadsControllerCore.UpdateExecutorInput[]', - name: 'executors', - type: 'tuple[]', - }, - ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'originSender', type: 'address' }, - { internalType: 'uint256', name: 'originChainId', type: 'uint256' }, - { internalType: 'bytes', name: 'message', type: 'bytes' }, - ], - name: 'receiveCrossChainMessage', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function' }, - { - inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'enum PayloadsControllerUtils.AccessControl', name: 'accessLevel', type: 'uint8' }, - { - components: [ - { internalType: 'address', name: 'executor', type: 'address' }, - { internalType: 'uint40', name: 'delay', type: 'uint40' }, - ], - internalType: 'struct IPayloadsControllerCore.ExecutorConfig', - name: 'executorConfig', - type: 'tuple', - }, - ], - internalType: 'struct IPayloadsControllerCore.UpdateExecutorInput[]', - name: 'executors', - type: 'tuple[]', - }, - ], - name: 'updateExecutors', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'newGuardian', type: 'address' }], - name: 'updateGuardian', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'whoCanRescue', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { stateMutability: 'payable', type: 'receive' }, -] as const; diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index 4458bc4..0df4994 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -1,12 +1,12 @@ import { ContractFunctionResult, GetContractReturnType, Hex, PublicClient, getContract } from 'viem'; import { FilterLogWithTimestamp } from '../govv2/networks/types'; -import { GOVERNANCE_EXTENDED_ABI } from './abis/GovernanceExtended'; import { getLogs } from '../../utils/logs'; +import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book'; -type CreatedLog = FilterLogWithTimestamp; -type QueuedLog = FilterLogWithTimestamp; -type ExecutedLog = FilterLogWithTimestamp; -type PayloadSentLog = FilterLogWithTimestamp; +type CreatedLog = FilterLogWithTimestamp; +type QueuedLog = FilterLogWithTimestamp; +type ExecutedLog = FilterLogWithTimestamp; +type PayloadSentLog = FilterLogWithTimestamp; export enum ProposalState { Null, // proposal does not exists @@ -20,7 +20,7 @@ export enum ProposalState { } export interface Governance { - governanceContract: GetContractReturnType; + governanceContract: GetContractReturnType; cacheLogs: () => Promise<{ createdLogs: Array; queuedLogs: Array; @@ -31,7 +31,7 @@ export interface Governance { proposalId: bigint, logs: Awaited> ) => Promise<{ - proposal: ContractFunctionResult; + proposal: ContractFunctionResult; createdLog: CreatedLog; queuedLog?: QueuedLog; executedLog?: ExecutedLog; @@ -41,7 +41,7 @@ export interface Governance { } export const getGovernance = (address: Hex, publicClient: PublicClient, blockCreated?: bigint): Governance => { - const governanceContract = getContract({ abi: GOVERNANCE_EXTENDED_ABI, address, publicClient }); + const governanceContract = getContract({ abi: IGovernanceCore_ABI, address, publicClient }); return { governanceContract, diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index b85add5..3aa066c 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -6,18 +6,17 @@ import { encodeFunctionData, encodePacked, getContract, - toHex, } from 'viem'; -import { PAYLOADS_CONTROLLER_EXTENDED_ABI } from './abis/PayloadsControllerExtended'; import { getLogs } from '../../utils/logs'; import { FilterLogWithTimestamp } from '../govv2/networks/types'; import { TenderlyRequest, tenderly, TenderlySimulationResponse } from '../../utils/tenderlyClient'; import { EOA } from '../../utils/constants'; import { getSolidityStorageSlotUint } from '../../utils/storageSlots'; +import { IPayloadsControllerCore_ABI } from '@bgd-labs/aave-address-book'; -type PayloadCreatedLog = FilterLogWithTimestamp; -type PayloadQueuedLog = FilterLogWithTimestamp; -type PayloadExecutedLog = FilterLogWithTimestamp; +type PayloadCreatedLog = FilterLogWithTimestamp; +type PayloadQueuedLog = FilterLogWithTimestamp; +type PayloadExecutedLog = FilterLogWithTimestamp; export enum PayloadState { None, @@ -29,7 +28,7 @@ export enum PayloadState { } export interface PayloadsController { - controllerContract: GetContractReturnType; + controllerContract: GetContractReturnType; // cache created / queued / Executed logs cacheLogs: () => Promise<{ createdLogs: Array; @@ -41,7 +40,7 @@ export interface PayloadsController { id: number, logs: Awaited> ) => Promise<{ - payload: ContractFunctionResult; + payload: ContractFunctionResult; createdLog: PayloadCreatedLog; queuedLog?: PayloadQueuedLog; executedLog?: PayloadExecutedLog; @@ -59,7 +58,7 @@ export const getPayloadsController = ( publicClient: PublicClient, blockCreated?: bigint ): PayloadsController => { - const controllerContract = getContract({ abi: PAYLOADS_CONTROLLER_EXTENDED_ABI, address, publicClient }); + const controllerContract = getContract({ abi: IPayloadsControllerCore_ABI, address, publicClient }); return { controllerContract, cacheLogs: async () => { @@ -120,7 +119,7 @@ export const getPayloadsController = ( from: EOA, to: controllerContract.address, input: encodeFunctionData({ - abi: PAYLOADS_CONTROLLER_EXTENDED_ABI, + abi: IPayloadsControllerCore_ABI, functionName: 'executePayload', args: [id], }), diff --git a/yarn.lock b/yarn.lock index c5fa30b..177c8e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@adraffy/ens-normalize@1.9.0": - version "1.9.0" - resolved "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.9.0.tgz" - integrity sha512-iowxq3U30sghZotgl4s/oJRci6WPBfNO5YYgk2cIOMCHr3LeGPcsZjCEr+33Q4N+oV3OABDAtA+pyvWjbvBifQ== +"@adraffy/ens-normalize@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" + integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== "@assemblyscript/loader@^0.9.4": version "0.9.4" @@ -33,10 +33,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@bgd-labs/aave-address-book@1.33.1-e5554f111c11be63c08c5861c43bb27567e806a4.0": - version "1.33.1-e5554f111c11be63c08c5861c43bb27567e806a4.0" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-1.33.1-e5554f111c11be63c08c5861c43bb27567e806a4.0.tgz#c37c008e923b1eba8dc8a2c4f1427fac0861f888" - integrity sha512-5E6v9geue/5jGg/rT+W00Al9Jdhjhr1RMEfo7uwCIuUH6k8fgjngoAvzCOZxQzZZaczeBrkxLPixTXwO56u6Zw== +"@bgd-labs/aave-address-book@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.2.0.tgz#dfb21c33355811ca6c8dc70cdbfdb89e641802cf" + integrity sha512-KX0dhpn5a8ajr6/IpbyzCHaRXJz1K6bI74OCOIhh7Ju0SxKKpFcD7l6/Sh3GzkPqYaf0p3G5u+BpAqaVdIM34w== "@esbuild-kit/cjs-loader@^2.4.2": version "2.4.2" @@ -54,6 +54,14 @@ esbuild "~0.17.6" source-map-support "^0.5.21" +"@esbuild-kit/core-utils@^3.2.2": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@esbuild-kit/core-utils/-/core-utils-3.2.2.tgz#ac3fe38d6ddcb3aa4658425034bb7a9cefa83495" + integrity sha512-Ub6LaRaAgF80dTSzUdXpFLM1pVDdmEVB9qb5iAzSpyDlX/mfJTFGOnZ516O05p5uWWteNviMKi4PAyEuRxI5gA== + dependencies: + esbuild "~0.18.20" + source-map-support "^0.5.21" + "@esbuild-kit/esm-loader@^2.5.5": version "2.5.5" resolved "https://registry.yarnpkg.com/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz#b82da14fcee3fc1d219869756c06f43f67d1ca71" @@ -409,26 +417,19 @@ resolved "https://registry.npmjs.org/@multiformats/base-x/-/base-x-4.0.1.tgz" integrity sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw== -"@noble/curves@1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz" - integrity sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA== - dependencies: - "@noble/hashes" "1.3.1" - -"@noble/curves@~1.0.0": - version "1.0.0" - resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.0.0.tgz" - integrity sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw== +"@noble/curves@1.2.0", "@noble/curves@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== dependencies: - "@noble/hashes" "1.3.0" + "@noble/hashes" "1.3.2" -"@noble/hashes@1.3.0": - version "1.3.0" - resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz" - integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== +"@noble/hashes@1.3.2", "@noble/hashes@~1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@noble/hashes@1.3.1", "@noble/hashes@~1.3.0": +"@noble/hashes@~1.3.0": version "1.3.1" resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz" integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== @@ -512,19 +513,24 @@ resolved "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz" integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== -"@scure/bip32@1.3.0": - version "1.3.0" - resolved "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.0.tgz" - integrity sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q== +"@scure/base@~1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + +"@scure/bip32@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.2.tgz#90e78c027d5e30f0b22c1f8d50ff12f3fb7559f8" + integrity sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA== dependencies: - "@noble/curves" "~1.0.0" - "@noble/hashes" "~1.3.0" - "@scure/base" "~1.1.0" + "@noble/curves" "~1.2.0" + "@noble/hashes" "~1.3.2" + "@scure/base" "~1.1.2" -"@scure/bip39@1.2.0": - version "1.2.0" - resolved "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.0.tgz" - integrity sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg== +"@scure/bip39@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" + integrity sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg== dependencies: "@noble/hashes" "~1.3.0" "@scure/base" "~1.1.0" @@ -589,9 +595,9 @@ resolved "https://registry.npmjs.org/@types/object-hash/-/object-hash-3.0.3.tgz" integrity sha512-Mb0SDIhjhBAz4/rDNU0cYcQR4lSJIwy+kFlm0whXLkx+o0pXwEszwyrWD6gXWumxVbAS6XZ9gXK82LR+Uk+cKQ== -"@types/ws@^8.5.4": +"@types/ws@^8.5.5": version "8.5.5" - resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" integrity sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg== dependencies: "@types/node" "*" @@ -608,53 +614,53 @@ dependencies: "@types/yargs-parser" "*" -"@vitest/expect@0.34.1": - version "0.34.1" - resolved "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.1.tgz" - integrity sha512-q2CD8+XIsQ+tHwypnoCk8Mnv5e6afLFvinVGCq3/BOT4kQdVQmY6rRfyKkwcg635lbliLPqbunXZr+L1ssUWiQ== +"@vitest/expect@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.34.3.tgz#576e1fd6a3a8b8b7a79a06477f3d450a77d67852" + integrity sha512-F8MTXZUYRBVsYL1uoIft1HHWhwDbSzwAU9Zgh8S6WFC3YgVb4AnFV2GXO3P5Em8FjEYaZtTnQYoNwwBrlOMXgg== dependencies: - "@vitest/spy" "0.34.1" - "@vitest/utils" "0.34.1" + "@vitest/spy" "0.34.3" + "@vitest/utils" "0.34.3" chai "^4.3.7" -"@vitest/runner@0.34.1": - version "0.34.1" - resolved "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.1.tgz" - integrity sha512-YfQMpYzDsYB7yqgmlxZ06NI4LurHWfrH7Wy3Pvf/z/vwUSgq1zLAb1lWcItCzQG+NVox+VvzlKQrYEXb47645g== +"@vitest/runner@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.34.3.tgz#ce09b777d133bbcf843e1a67f4a743365764e097" + integrity sha512-lYNq7N3vR57VMKMPLVvmJoiN4bqwzZ1euTW+XXYH5kzr3W/+xQG3b41xJn9ChJ3AhYOSoweu974S1V3qDcFESA== dependencies: - "@vitest/utils" "0.34.1" + "@vitest/utils" "0.34.3" p-limit "^4.0.0" pathe "^1.1.1" -"@vitest/snapshot@0.34.1": - version "0.34.1" - resolved "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.1.tgz" - integrity sha512-0O9LfLU0114OqdF8lENlrLsnn024Tb1CsS9UwG0YMWY2oGTQfPtkW+B/7ieyv0X9R2Oijhi3caB1xgGgEgclSQ== +"@vitest/snapshot@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-0.34.3.tgz#cb4767aa44711a1072bd2e06204b659275c4f0f2" + integrity sha512-QyPaE15DQwbnIBp/yNJ8lbvXTZxS00kRly0kfFgAD5EYmCbYcA+1EEyRalc93M0gosL/xHeg3lKAClIXYpmUiQ== dependencies: magic-string "^0.30.1" pathe "^1.1.1" pretty-format "^29.5.0" -"@vitest/spy@0.34.1": - version "0.34.1" - resolved "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.1.tgz" - integrity sha512-UT4WcI3EAPUNO8n6y9QoEqynGGEPmmRxC+cLzneFFXpmacivjHZsNbiKD88KUScv5DCHVDgdBsLD7O7s1enFcQ== +"@vitest/spy@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.34.3.tgz#d4cf25e6ca9230991a0223ecd4ec2df30f0784ff" + integrity sha512-N1V0RFQ6AI7CPgzBq9kzjRdPIgThC340DGjdKdPSE8r86aUSmeliTUgkTqLSgtEwWWsGfBQ+UetZWhK0BgJmkQ== dependencies: tinyspy "^2.1.1" -"@vitest/utils@0.34.1": - version "0.34.1" - resolved "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.1.tgz" - integrity sha512-/ql9dsFi4iuEbiNcjNHQWXBum7aL8pyhxvfnD9gNtbjR9fUKAjxhj4AA3yfLXg6gJpMGGecvtF8Au2G9y3q47Q== +"@vitest/utils@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.34.3.tgz#6e243189a358b736b9fc0216e6b6979bc857e897" + integrity sha512-kiSnzLG6m/tiT0XEl4U2H8JDBjFtwVlaE8I3QfGiMFR0QvnRDfYfdP3YvTBWM/6iJDAyaPY6yVQiCTUc7ZzTHA== dependencies: diff-sequences "^29.4.3" loupe "^2.3.6" pretty-format "^29.5.0" -abitype@0.9.3: - version "0.9.3" - resolved "https://registry.npmjs.org/abitype/-/abitype-0.9.3.tgz" - integrity sha512-dz4qCQLurx97FQhnb/EIYTk/ldQ+oafEDUqC0VVIeQS1Q48/YWt/9YNfMmp9SLFqN41ktxny3c8aYxHjmFIB/w== +abitype@0.9.8: + version "0.9.8" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c" + integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ== acorn-walk@^8.2.0: version "8.2.0" @@ -1048,7 +1054,7 @@ esbuild@^0.17.5: "@esbuild/win32-ia32" "0.17.12" "@esbuild/win32-x64" "0.17.12" -esbuild@^0.18.2: +esbuild@^0.18.2, esbuild@~0.18.20: version "0.18.20" resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz" integrity sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA== @@ -2409,13 +2415,13 @@ tsup@^7.2.0: sucrase "^3.20.3" tree-kill "^1.2.2" -tsx@^3.12.7: - version "3.12.7" - resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.12.7.tgz#b3b8b0fc79afc8260d1e14f9e995616c859a91e9" - integrity sha512-C2Ip+jPmqKd1GWVQDvz/Eyc6QJbGfE7NrR3fx5BpEHMZsEHoIxHL1j+lKdGobr8ovEyqeNkPLSKp6SCSOt7gmw== +tsx@^3.12.8: + version "3.12.8" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.12.8.tgz#e9ec95c6b116e28f0187467f839029a3ce17a851" + integrity sha512-Lt9KYaRGF023tlLInPj8rgHwsZU8qWLBj4iRXNWxTfjIkU7canGL806AqKear1j722plHuiYNcL2ZCo6uS9UJA== dependencies: "@esbuild-kit/cjs-loader" "^2.4.2" - "@esbuild-kit/core-utils" "^3.0.0" + "@esbuild-kit/core-utils" "^3.2.2" "@esbuild-kit/esm-loader" "^2.5.5" optionalDependencies: fsevents "~2.3.2" @@ -2487,25 +2493,25 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.9.2: - version "1.9.2" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.9.2.tgz#7cc15d8945e8268810d885610a8a06b11c0bbe16" - integrity sha512-a4l502Sl4ytYOT6a77ezDCEEgztR+wF8ZZRLAEVcrQawFFIiAWXGPrXVPT8MQmDF00idPMKPON8Ayz34Ft3NLw== - dependencies: - "@adraffy/ens-normalize" "1.9.0" - "@noble/curves" "1.1.0" - "@noble/hashes" "1.3.0" - "@scure/bip32" "1.3.0" - "@scure/bip39" "1.2.0" - "@types/ws" "^8.5.4" - abitype "0.9.3" +viem@^1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.10.3.tgz#e558ec568f961a5472ba6999528cb4eb7ae31c6f" + integrity sha512-7L35k0JmxTa7xIx1s8lCsTLGrTEUXTYnLppZ56EVBjtvE2OKSfDjL8No0Fnedu6Ye0zi/VX2BQC3arhpKOVIlw== + dependencies: + "@adraffy/ens-normalize" "1.9.4" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@scure/bip32" "1.3.2" + "@scure/bip39" "1.2.1" + "@types/ws" "^8.5.5" + abitype "0.9.8" isomorphic-ws "5.0.0" - ws "8.12.0" + ws "8.13.0" -vite-node@0.34.1: - version "0.34.1" - resolved "https://registry.npmjs.org/vite-node/-/vite-node-0.34.1.tgz" - integrity sha512-odAZAL9xFMuAg8aWd7nSPT+hU8u2r9gU3LRm9QKjxBEF2rRdWpMuqkrkjvyVQEdNFiBctqr2Gg4uJYizm5Le6w== +vite-node@0.34.3: + version "0.34.3" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.34.3.tgz#de134fe38bc1555ac8ab5e489d7df6159a3e1a4c" + integrity sha512-+0TzJf1g0tYXj6tR2vEyiA42OPq68QkRZCu/ERSo2PtsDJfBpDyEfuKbRvLmZqi/CgC7SCBtyC+WjTGNMRIaig== dependencies: cac "^6.7.14" debug "^4.3.4" @@ -2526,19 +2532,19 @@ vite-node@0.34.1: optionalDependencies: fsevents "~2.3.2" -vitest@^0.34.1: - version "0.34.1" - resolved "https://registry.npmjs.org/vitest/-/vitest-0.34.1.tgz" - integrity sha512-G1PzuBEq9A75XSU88yO5G4vPT20UovbC/2osB2KEuV/FisSIIsw7m5y2xMdB7RsAGHAfg2lPmp2qKr3KWliVlQ== +vitest@^0.34.3: + version "0.34.3" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.34.3.tgz#863d61c133d01b16e49fd52d380c09fa5ac03188" + integrity sha512-7+VA5Iw4S3USYk+qwPxHl8plCMhA5rtfwMjgoQXMT7rO5ldWcdsdo3U1QD289JgglGK4WeOzgoLTsGFu6VISyQ== dependencies: "@types/chai" "^4.3.5" "@types/chai-subset" "^1.3.3" "@types/node" "*" - "@vitest/expect" "0.34.1" - "@vitest/runner" "0.34.1" - "@vitest/snapshot" "0.34.1" - "@vitest/spy" "0.34.1" - "@vitest/utils" "0.34.1" + "@vitest/expect" "0.34.3" + "@vitest/runner" "0.34.3" + "@vitest/snapshot" "0.34.3" + "@vitest/spy" "0.34.3" + "@vitest/utils" "0.34.3" acorn "^8.9.0" acorn-walk "^8.2.0" cac "^6.7.14" @@ -2553,7 +2559,7 @@ vitest@^0.34.1: tinybench "^2.5.0" tinypool "^0.7.0" vite "^3.0.0 || ^4.0.0" - vite-node "0.34.1" + vite-node "0.34.3" why-is-node-running "^2.2.2" webidl-conversions@^3.0.0: @@ -2612,10 +2618,10 @@ wrappy@1: resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -ws@8.12.0: - version "8.12.0" - resolved "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz" - integrity sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig== +ws@8.13.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== y18n@^5.0.5: version "5.0.8" From 36031dd1bf092918ed8a34ce4c4ff7fd85d78bcb Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 6 Sep 2023 17:10:18 +0200 Subject: [PATCH 26/94] fix: expose method to get simulation payload --- package.json | 4 +- src/simulate/govv3/payloadsController.ts | 72 +++++++++++++----------- yarn.lock | 16 +++--- 3 files changed, 50 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index 4b63106..0d2e450 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "access": "public" }, "dependencies": { - "@bgd-labs/aave-address-book": "2.2.0", + "@bgd-labs/aave-address-book": "2.3.0", "bs58": "^5.0.0", "chalk": "^4.1.2", "dotenv": "^16.3.1", @@ -61,7 +61,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.10.3", + "viem": "^1.10.4", "yargs": "^17.7.2", "zod": "^3.21.4" } diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 3aa066c..5334cf3 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -45,6 +45,7 @@ export interface PayloadsController { queuedLog?: PayloadQueuedLog; executedLog?: PayloadExecutedLog; }>; + getSimulationPayloadForExecution: (id: number) => Promise; simulatePayloadExecutionOnTenderly: ( id: number, logs: Awaited> @@ -59,6 +60,41 @@ export const getPayloadsController = ( blockCreated?: bigint ): PayloadsController => { const controllerContract = getContract({ abi: IPayloadsControllerCore_ABI, address, publicClient }); + + const getSimulationPayloadForExecution = async (id: number) => { + const payload = await controllerContract.read.getPayloadById([id]); + const _currentBlock = await publicClient.getBlockNumber(); + // workaround for tenderly lags & bugs when not specifying the blocknumber + const currentBlock = await publicClient.getBlock({ blockNumber: _currentBlock - 5n }); + const simulationPayload: TenderlyRequest = { + network_id: String(publicClient.chain!.id), + from: EOA, + to: controllerContract.address, + input: encodeFunctionData({ + abi: IPayloadsControllerCore_ABI, + functionName: 'executePayload', + args: [id], + }), + block_number: Number(currentBlock.number), + state_objects: { + [controllerContract.address]: { + storage: { + [getSolidityStorageSlotUint(3n, BigInt(id))]: encodePacked( + ['uint40', 'uint40', 'uint8', 'uint8', 'address'], + [ + Number(currentBlock.timestamp - BigInt(payload.delay) - 1n), // altering queued time so can be executed in current block + payload.createdAt, + PayloadState.Queued, + payload.maximumAccessLevelRequired, + payload.creator, + ] + ), + }, + }, + }, + }; + return simulationPayload; + }; return { controllerContract, cacheLogs: async () => { @@ -105,44 +141,16 @@ export const getPayloadsController = ( const payload = await controllerContract.read.getPayloadById([id]); return { createdLog, queuedLog, executedLog, payload }; }, - simulatePayloadExecutionOnTenderly: async (id, { executedLog, payload }) => { + getSimulationPayloadForExecution, + simulatePayloadExecutionOnTenderly: async (id, { executedLog }) => { // if successfully executed just replay the txn if (executedLog) { const tx = await publicClient.getTransaction({ hash: executedLog.transactionHash! }); return tenderly.simulateTx(publicClient.chain!.id, tx); } - const _currentBlock = await publicClient.getBlockNumber(); - // workaround for tenderly lags & bugs when not specifying the blocknumber - const currentBlock = await publicClient.getBlock({ blockNumber: _currentBlock - 5n }); - const simulationPayload: TenderlyRequest = { - network_id: String(publicClient.chain!.id), - from: EOA, - to: controllerContract.address, - input: encodeFunctionData({ - abi: IPayloadsControllerCore_ABI, - functionName: 'executePayload', - args: [id], - }), - block_number: Number(currentBlock.number), - state_objects: { - [controllerContract.address]: { - storage: { - [getSolidityStorageSlotUint(3n, BigInt(id))]: encodePacked( - ['uint40', 'uint40', 'uint8', 'uint8', 'address'], - [ - Number(currentBlock.timestamp - BigInt(payload.delay) - 1n), // altering queued time so can be executed in current block - payload.createdAt, - PayloadState.Queued, - payload.maximumAccessLevelRequired, - payload.creator, - ] - ), - }, - }, - }, - }; + const payload = await getSimulationPayloadForExecution(id); - return tenderly.simulate(simulationPayload); + return tenderly.simulate(payload); }, }; }; diff --git a/yarn.lock b/yarn.lock index 177c8e9..66d13b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,10 +33,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@bgd-labs/aave-address-book@2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.2.0.tgz#dfb21c33355811ca6c8dc70cdbfdb89e641802cf" - integrity sha512-KX0dhpn5a8ajr6/IpbyzCHaRXJz1K6bI74OCOIhh7Ju0SxKKpFcD7l6/Sh3GzkPqYaf0p3G5u+BpAqaVdIM34w== +"@bgd-labs/aave-address-book@2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.3.0.tgz#ee937504ca5ec8c7a2d7750cd203aa601d9e04e9" + integrity sha512-P5t94rwHXakJIxtyM0MQWeVFtzkoupGcBcSZnLenRa8dRq1PsDbwDhMtvOMbr94/49Jv6KjTTon+axp158YK6A== "@esbuild-kit/cjs-loader@^2.4.2": version "2.4.2" @@ -2493,10 +2493,10 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.10.3: - version "1.10.3" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.10.3.tgz#e558ec568f961a5472ba6999528cb4eb7ae31c6f" - integrity sha512-7L35k0JmxTa7xIx1s8lCsTLGrTEUXTYnLppZ56EVBjtvE2OKSfDjL8No0Fnedu6Ye0zi/VX2BQC3arhpKOVIlw== +viem@^1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.10.4.tgz#0c08364192194b067cede4583ad8cf7b02d2dbeb" + integrity sha512-GRnz1KLWh7rDFvR0fMUBt8orVu/QbGJ3QqlLo7M71H4rig39TvjDoVyMp7eFK18+Zs6niqev1f8woX9fv3cwVg== dependencies: "@adraffy/ens-normalize" "1.9.4" "@noble/curves" "1.2.0" From 26b6505fafa3ca34eded9ee6c6270333b8edd091 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 6 Sep 2023 18:41:23 +0200 Subject: [PATCH 27/94] stash: stash local cahnges --- src/simulate/govv3/governance.ts | 45 ++++++++++++++++++++++-- src/simulate/govv3/payloadsController.ts | 11 +++--- src/utils/tenderlyClient.ts | 8 ++--- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index 0df4994..a46e19f 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -1,7 +1,19 @@ -import { ContractFunctionResult, GetContractReturnType, Hex, PublicClient, getContract } from 'viem'; +import { + ContractFunctionResult, + GetContractReturnType, + Hex, + PublicClient, + encodeFunctionData, + formatUnits, + getContract, + parseEther, +} from 'viem'; import { FilterLogWithTimestamp } from '../govv2/networks/types'; import { getLogs } from '../../utils/logs'; import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book'; +import { TenderlyRequest } from '../../utils/tenderlyClient'; +import { EOA } from '../../utils/constants'; +import { getSolidityStorageSlotUint } from '../../utils/storageSlots'; type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; @@ -37,9 +49,14 @@ export interface Governance { executedLog?: ExecutedLog; payloadSentLog: PayloadSentLog[]; }>; + getSimulationPayloadForExecution: (proposalId: bigint) => Promise; simulateProposal: any; } +const SLOTS = { + PROPOSALS_MAPPING: 7n, +}; + export const getGovernance = (address: Hex, publicClient: PublicClient, blockCreated?: bigint): Governance => { const governanceContract = getContract({ abi: IGovernanceCore_ABI, address, publicClient }); @@ -100,7 +117,7 @@ export const getGovernance = (address: Hex, publicClient: PublicClient, blockCre ); return { createdLogs, queuedLogs, executedLogs, payloadSentLogs }; }, - async getProposal(proposalId: bigint, logs: Awaited>) { + async getProposal(proposalId, logs) { const proposal = await governanceContract.read.getProposal([proposalId]); const createdLog = logs.createdLogs.find((log) => String(log.args.proposalId) === proposalId.toString())!; const queuedLog = logs.queuedLogs.find((log) => String(log.args.proposalId) === proposalId.toString()); @@ -110,6 +127,30 @@ export const getGovernance = (address: Hex, publicClient: PublicClient, blockCre ); return { proposal, createdLog, queuedLog, executedLog, payloadSentLog }; }, + async getSimulationPayloadForExecution(proposalId: bigint) { + const proposal = await governanceContract.read.getProposal([proposalId]); + const currentBlock = await publicClient.getBlock(); + const simulationPayload: TenderlyRequest = { + network_id: String(publicClient.chain!.id), + from: EOA, + to: governanceContract.address, + input: encodeFunctionData({ + abi: IGovernanceCore_ABI, + functionName: 'executeProposal', + args: [proposalId], + }), + value: parseEther('0.5').toString(), + block_number: Number(currentBlock.number), + state_objects: { + [governanceContract.address]: { + storage: { + [getSolidityStorageSlotUint(SLOTS.PROPOSALS_MAPPING, proposalId)]: '0x0', + }, + }, + }, + }; + return simulationPayload; + }, // TODO async simulateProposal() { // # if executed just replay the txn diff --git a/src/simulate/govv3/payloadsController.ts b/src/simulate/govv3/payloadsController.ts index 5334cf3..8110eee 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/simulate/govv3/payloadsController.ts @@ -54,6 +54,10 @@ export interface PayloadsController { // TODO: not sure yet about types etc } +const SLOTS = { + PAYLOADS_MAPPING: 3n, +}; + export const getPayloadsController = ( address: Hex, publicClient: PublicClient, @@ -63,9 +67,7 @@ export const getPayloadsController = ( const getSimulationPayloadForExecution = async (id: number) => { const payload = await controllerContract.read.getPayloadById([id]); - const _currentBlock = await publicClient.getBlockNumber(); - // workaround for tenderly lags & bugs when not specifying the blocknumber - const currentBlock = await publicClient.getBlock({ blockNumber: _currentBlock - 5n }); + const currentBlock = await publicClient.getBlock(); const simulationPayload: TenderlyRequest = { network_id: String(publicClient.chain!.id), from: EOA, @@ -79,7 +81,7 @@ export const getPayloadsController = ( state_objects: { [controllerContract.address]: { storage: { - [getSolidityStorageSlotUint(3n, BigInt(id))]: encodePacked( + [getSolidityStorageSlotUint(SLOTS.PAYLOADS_MAPPING, BigInt(id))]: encodePacked( ['uint40', 'uint40', 'uint8', 'uint8', 'address'], [ Number(currentBlock.timestamp - BigInt(payload.delay) - 1n), // altering queued time so can be executed in current block @@ -95,6 +97,7 @@ export const getPayloadsController = ( }; return simulationPayload; }; + return { controllerContract, cacheLogs: async () => { diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 5672d65..02937a9 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -341,9 +341,9 @@ class Tenderly { return fork; }; - deployCode = (fork: any, filePath: string) => { + deployCode = (fork: any, filePath: string, from?: Hex) => { const walletProvider = createWalletClient({ - account: EOA, + account: from || EOA, chain: { id: 3030, name: 'tenderly' } as any, transport: http(fork.forkUrl), }); @@ -394,7 +394,7 @@ class Tenderly { unwrapAndExecuteSimulationPayloadOnFork = async (fork: any, request: TenderlyRequest) => { // 0. fund account - await this.fundAccount(fork, EOA); + await this.fundAccount(fork, request.from); const publicProvider = createPublicClient({ chain: { id: 3030 } as any, @@ -427,7 +427,7 @@ class Tenderly { if (request.input) { logInfo('tenderly', 'execute transaction'); const walletProvider = createWalletClient({ - account: EOA, + account: request.from, chain: { id: 3030, name: 'tenderly' } as any, transport: http(fork.forkUrl), }); From 2139238af22c2483e1b9fd9471b4fc6dda975176 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 7 Sep 2023 10:23:04 +0200 Subject: [PATCH 28/94] feat: add utility for setting bits --- src/commands/simulate-proposal-v3.ts | 4 ++-- .../govv3/utils/solidityUtils.spec.ts | 11 +++++++++ src/simulate/govv3/utils/solidityUtils.ts | 24 +++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/simulate/govv3/utils/solidityUtils.spec.ts diff --git a/src/commands/simulate-proposal-v3.ts b/src/commands/simulate-proposal-v3.ts index e62b4ac..cff10f8 100644 --- a/src/commands/simulate-proposal-v3.ts +++ b/src/commands/simulate-proposal-v3.ts @@ -1,5 +1,5 @@ import { simulateProposal } from '../simulate/govv3/simulate'; -import { AaveV3Sepolia } from '@bgd-labs/aave-address-book'; +import { GovernanceV3Sepolia } from '@bgd-labs/aave-address-book'; export const command = 'simulate-proposal-v3 [proposalId]'; @@ -8,6 +8,6 @@ export const describe = 'simulates a aave v3 governance proposal'; export const handler = async function (argv) { if (argv.proposalId == undefined) throw new Error('proposalId is required'); const proposalId = BigInt(argv.proposalId); - const result = await simulateProposal(AaveV3Sepolia.GOVERNANCE, proposalId); + const result = await simulateProposal(GovernanceV3Sepolia.GOVERNANCE, proposalId); // console.log(result); }; diff --git a/src/simulate/govv3/utils/solidityUtils.spec.ts b/src/simulate/govv3/utils/solidityUtils.spec.ts new file mode 100644 index 0000000..703af6a --- /dev/null +++ b/src/simulate/govv3/utils/solidityUtils.spec.ts @@ -0,0 +1,11 @@ +import { describe, it, expect } from 'vitest'; +import { setBits } from './solidityUtils'; + +describe('solidityUtils', () => { + it('setBits', async () => { + expect(setBits('0b11', 1n, 2n, 0n)).toBe('1'); + expect(setBits('0b111', 1n, 2n, 0n)).toBe('5'); + expect(setBits('0b111', 1n, 3n, 0n)).toBe('1'); + expect(setBits('0b111', 0n, 3n, 0n)).toBe('0'); + }); +}); diff --git a/src/simulate/govv3/utils/solidityUtils.ts b/src/simulate/govv3/utils/solidityUtils.ts index 2657166..ce6b124 100644 --- a/src/simulate/govv3/utils/solidityUtils.ts +++ b/src/simulate/govv3/utils/solidityUtils.ts @@ -24,6 +24,30 @@ export function getBits(_bigIntValue: bigint | number | string, startBit: bigint return maskedValue.toString(); } +/** + * Sets the bits in a bigint + * @param _bigIntValue + * @param startBit inclusive + * @param endBit exclusive + * @param value the value to replace + * @returns + */ +export function setBits(_bigIntValue: bigint | number | string, startBit: bigint, endBit: bigint, value: bigint) { + const bigIntValue = BigInt(_bigIntValue); + + // Calculate the mask for the specified range + let mask = BigInt(0); + for (let i = startBit; i < endBit; i++) { + mask |= BigInt(1) << BigInt(i); + } + // Clear the bits in the original number within the specified range + const clearedNumber = bigIntValue & ~mask; + + // Set the new bits in the specified range + let result = clearedNumber | (value << BigInt(startBit)); + return result.toString(); +} + // --- Helper methods --- /** * @notice Given a Tenderly contract object, generates a descriptive human-friendly name for that contract From 35cee9f352abb5c53719e883a6d7b460a4fbc0b4 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 7 Sep 2023 10:40:41 +0200 Subject: [PATCH 29/94] feat: allow simulating proposals --- src/simulate/govv3/governance.ts | 106 ++++++++++++++-------- src/simulate/govv3/utils/solidityUtils.ts | 18 ++-- 2 files changed, 80 insertions(+), 44 deletions(-) diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index a46e19f..b64b8ca 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -4,16 +4,18 @@ import { Hex, PublicClient, encodeFunctionData, - formatUnits, + fromHex, getContract, parseEther, + toHex, } from 'viem'; import { FilterLogWithTimestamp } from '../govv2/networks/types'; import { getLogs } from '../../utils/logs'; import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book'; -import { TenderlyRequest } from '../../utils/tenderlyClient'; +import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../../utils/tenderlyClient'; import { EOA } from '../../utils/constants'; import { getSolidityStorageSlotUint } from '../../utils/storageSlots'; +import { setBits } from './utils/solidityUtils'; type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; @@ -50,16 +52,70 @@ export interface Governance { payloadSentLog: PayloadSentLog[]; }>; getSimulationPayloadForExecution: (proposalId: bigint) => Promise; - simulateProposal: any; + simulateProposalExecutionOnTenderly: ( + proposalId: bigint, + params: { executedLog?: ExecutedLog } + ) => Promise; } const SLOTS = { PROPOSALS_MAPPING: 7n, }; +enum State { + Null, // proposal does not exists + Created, // created, waiting for a cooldown to initiate the balances snapshot + Active, // balances snapshot set, voting in progress + Queued, // voting results submitted, but proposal is under grace period when guardian can cancel it + Executed, // results sent to the execution chain(s) + Failed, // voting was not successful + Cancelled, // got cancelled by guardian, or because proposition power of creator dropped below allowed minimum + Expired, +} + export const getGovernance = (address: Hex, publicClient: PublicClient, blockCreated?: bigint): Governance => { const governanceContract = getContract({ abi: IGovernanceCore_ABI, address, publicClient }); + async function getSimulationPayloadForExecution(proposalId: bigint) { + const currentBlock = await publicClient.getBlock(); + const proposalSlot = getSolidityStorageSlotUint(SLOTS.PROPOSALS_MAPPING, proposalId); + const data = await publicClient.getStorageAt({ + address: governanceContract.address, + slot: proposalSlot, + }); + let bigIntData = fromHex(data!, { to: 'bigint' }); + // manipulate storage + // set queued + bigIntData = setBits(bigIntData, 0n, 8n, State.Queued); + // set creation time + bigIntData = setBits( + bigIntData, + 16n, + 56n, + currentBlock.timestamp - (await governanceContract.read.PROPOSAL_EXPIRATION_TIME()) + ); + const simulationPayload: TenderlyRequest = { + network_id: String(publicClient.chain!.id), + from: EOA, + to: governanceContract.address, + input: encodeFunctionData({ + abi: IGovernanceCore_ABI, + functionName: 'executeProposal', + args: [proposalId], + }), + value: parseEther('0.5').toString(), + block_number: Number(currentBlock.number), + state_objects: { + [governanceContract.address]: { + storage: { + [proposalSlot]: toHex(bigIntData), + }, + }, + }, + }; + return simulationPayload; + } + return { governanceContract, async cacheLogs() { @@ -127,41 +183,15 @@ export const getGovernance = (address: Hex, publicClient: PublicClient, blockCre ); return { proposal, createdLog, queuedLog, executedLog, payloadSentLog }; }, - async getSimulationPayloadForExecution(proposalId: bigint) { - const proposal = await governanceContract.read.getProposal([proposalId]); - const currentBlock = await publicClient.getBlock(); - const simulationPayload: TenderlyRequest = { - network_id: String(publicClient.chain!.id), - from: EOA, - to: governanceContract.address, - input: encodeFunctionData({ - abi: IGovernanceCore_ABI, - functionName: 'executeProposal', - args: [proposalId], - }), - value: parseEther('0.5').toString(), - block_number: Number(currentBlock.number), - state_objects: { - [governanceContract.address]: { - storage: { - [getSolidityStorageSlotUint(SLOTS.PROPOSALS_MAPPING, proposalId)]: '0x0', - }, - }, - }, - }; - return simulationPayload; - }, - // TODO - async simulateProposal() { - // # if executed just replay the txn - // # if queued - // 1. alter storage so it can be executed - // 2. execute - // # if created - // 1. alter storage so it's queued and can be executed - // 2. execute - // # if cancelled - // fork before cancelling & apply same rules as before + getSimulationPayloadForExecution, + async simulateProposalExecutionOnTenderly(proposalId, { executedLog }) { + // if successfully executed just replay the txn + if (executedLog) { + const tx = await publicClient.getTransaction({ hash: executedLog.transactionHash! }); + return tenderly.simulateTx(publicClient.chain!.id, tx); + } + const payload = await getSimulationPayloadForExecution(proposalId); + return tenderly.simulate(payload); }, }; }; diff --git a/src/simulate/govv3/utils/solidityUtils.ts b/src/simulate/govv3/utils/solidityUtils.ts index ce6b124..24fa5e4 100644 --- a/src/simulate/govv3/utils/solidityUtils.ts +++ b/src/simulate/govv3/utils/solidityUtils.ts @@ -26,14 +26,20 @@ export function getBits(_bigIntValue: bigint | number | string, startBit: bigint /** * Sets the bits in a bigint - * @param _bigIntValue + * @param _bigIntBase * @param startBit inclusive * @param endBit exclusive * @param value the value to replace * @returns */ -export function setBits(_bigIntValue: bigint | number | string, startBit: bigint, endBit: bigint, value: bigint) { - const bigIntValue = BigInt(_bigIntValue); +export function setBits( + _bigIntBase: bigint | number | string, + startBit: bigint, + endBit: bigint, + _replaceValue: bigint | number +) { + const bigIntBase = BigInt(_bigIntBase); + const bigIntReplaceValue = BigInt(_replaceValue); // Calculate the mask for the specified range let mask = BigInt(0); @@ -41,11 +47,11 @@ export function setBits(_bigIntValue: bigint | number | string, startBit: bigint mask |= BigInt(1) << BigInt(i); } // Clear the bits in the original number within the specified range - const clearedNumber = bigIntValue & ~mask; + const clearedNumber = bigIntBase & ~mask; // Set the new bits in the specified range - let result = clearedNumber | (value << BigInt(startBit)); - return result.toString(); + let result = clearedNumber | (bigIntReplaceValue << BigInt(startBit)); + return result; } // --- Helper methods --- From 42526f7b1a0970ef67a0cf7f1f7d299b4d2fe2d7 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 7 Sep 2023 12:16:03 +0200 Subject: [PATCH 30/94] feat: migrate to commander --- package.json | 2 + src/cli.ts | 24 +- src/commands/governance-v3.ts | 100 + src/commands/simulate-proposal-v3.ts | 13 - src/simulate/govv3/simulate.ts | 10 +- src/utils/rpcClients.ts | 4 +- yarn-error.log | 2774 ++++++++++++++++++++++++++ yarn.lock | 10 + 8 files changed, 2908 insertions(+), 29 deletions(-) create mode 100644 src/commands/governance-v3.ts delete mode 100644 src/commands/simulate-proposal-v3.ts create mode 100644 yarn-error.log diff --git a/package.json b/package.json index 0d2e450..8926aac 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,10 @@ }, "dependencies": { "@bgd-labs/aave-address-book": "2.3.0", + "@commander-js/extra-typings": "^11.0.0", "bs58": "^5.0.0", "chalk": "^4.1.2", + "commander": "^11.0.0", "dotenv": "^16.3.1", "gray-matter": "^4.0.3", "ipfs-only-hash": "^4.0.0", diff --git a/src/cli.ts b/src/cli.ts index 332e444..a72b954 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,17 +1,25 @@ #!/usr/bin/env node import 'dotenv/config'; +import { Command } from '@commander-js/extra-typings'; import yargs from 'yargs/yargs'; import { hideBin } from 'yargs/helpers'; import * as ipfsCmd from './commands/ipfs-upload'; import * as diffSnapshot from './commands/diff-snaphots'; import * as simulateProposal from './commands/simulate-proposal'; -import * as simulateProposalV3 from './commands/simulate-proposal-v3'; +import { addCommand as addGovernanceV3 } from './commands/governance-v3'; import * as fork from './commands/fork'; -yargs(hideBin(process.argv)) - .command(ipfsCmd) - .command(diffSnapshot) - .command(simulateProposal) - .command(fork) - .command(simulateProposalV3) - .demandCommand().argv; +// yargs(hideBin(process.argv)) +// .command(ipfsCmd) +// .command(diffSnapshot) +// .command(simulateProposal) +// .command(fork) +// .command(governanceV3) +// .demandCommand().argv; + +const program = new Command(); + +program.name('aave-cli').description('CLI to interact with the aave ecosystem').version('0.0.0').showHelpAfterError(); +addGovernanceV3(program); + +program.parse(); diff --git a/src/commands/governance-v3.ts b/src/commands/governance-v3.ts new file mode 100644 index 0000000..d728326 --- /dev/null +++ b/src/commands/governance-v3.ts @@ -0,0 +1,100 @@ +import { Command } from '@commander-js/extra-typings'; +import { simulateProposal } from '../simulate/govv3/simulate'; +import { GovernanceV3Sepolia } from '@bgd-labs/aave-address-book'; +import { getGovernance } from '../simulate/govv3/governance'; +import { createPublicClient } from 'viem'; +import { sepoliaClient } from '../utils/rpcClients'; +import { logInfo } from '../utils/logger'; + +export const command = 'governance-v3 [proposalId]'; + +export const describe = 'interact with governance v3'; + +export const builder = (yargs) => + yargs + .option('chainId', { + type: 'number', + describe: 'the chainId to fork', + }) + .option('blockNumber', { + type: 'number', + describe: 'the blocknumber to fork (latest if omitted)', + }) + .option('alias', { + type: 'string', + describe: 'custom alias', + }) + .option('proposalId', { + type: 'number', + describe: 'Proposal or actionSetId', + }) + .option('payloadAddress', { + type: 'string', + describe: 'address of the payload to execute', + }) + .option('executor', { + type: 'string', + describe: '(optional) address of the executor', + }); + +export const handler = async function (argv) { + if (argv.proposalId == undefined) throw new Error('proposalId is required'); + const proposalId = BigInt(argv.proposalId); + const result = await simulateProposal(GovernanceV3Sepolia.GOVERNANCE, proposalId); + // console.log(result); +}; + +export function addCommand(program: Command) { + const govV3 = program.command('governanceV3').description('interact with governance v3 contracts'); + + govV3 + .command('simulate') + .description('simulates a proposal on tenderly') + .requiredOption('--proposalId ', 'proposalId to simulate via tenderly') + .action(async (name, options) => { + const proposalId = BigInt(options.getOptionValue('proposalId')); + await simulateProposal(GovernanceV3Sepolia.GOVERNANCE, proposalId); + }); + + govV3 + .command('view') + .description('shows all the proposals & state') + .action(async () => { + const governance = getGovernance(GovernanceV3Sepolia.GOVERNANCE, sepoliaClient, 3962575n); + const logs = await governance.cacheLogs(); + const count = await governance.governanceContract.read.getProposalsCount(); + const proposalIds = [...Array(Number(count)).keys()]; + for (const proposalId of proposalIds) { + const { createdLog, executedLog, payloadSentLog, queuedLog, proposal } = await governance.getProposal( + BigInt(proposalId), + logs + ); + logInfo( + `Proposal ${proposalId}`, + `Proposal created on ${new Date(createdLog.timestamp * 1000).toLocaleString()}` + ); + if (queuedLog) { + logInfo( + `Proposal ${proposalId}`, + `Proposal was queued with final votes of ${queuedLog.args.votesFor} to ${ + queuedLog.args.votesAgainst + } on ${new Date(queuedLog.timestamp * 1000).toLocaleString()}` + ); + } + if (executedLog) { + logInfo( + `Proposal ${proposalId}`, + `Proposal was executed on ${new Date(executedLog.timestamp * 1000).toLocaleString()}` + ); + } + } + }); + + govV3 + .command('generateProof') + .description('generates the proof etc') + .requiredOption('--proposalId ', 'proposalId to generate the proof for') + .action((name, options) => { + console.log('simulate', options); + }); +} diff --git a/src/commands/simulate-proposal-v3.ts b/src/commands/simulate-proposal-v3.ts deleted file mode 100644 index cff10f8..0000000 --- a/src/commands/simulate-proposal-v3.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { simulateProposal } from '../simulate/govv3/simulate'; -import { GovernanceV3Sepolia } from '@bgd-labs/aave-address-book'; - -export const command = 'simulate-proposal-v3 [proposalId]'; - -export const describe = 'simulates a aave v3 governance proposal'; - -export const handler = async function (argv) { - if (argv.proposalId == undefined) throw new Error('proposalId is required'); - const proposalId = BigInt(argv.proposalId); - const result = await simulateProposal(GovernanceV3Sepolia.GOVERNANCE, proposalId); - // console.log(result); -}; diff --git a/src/simulate/govv3/simulate.ts b/src/simulate/govv3/simulate.ts index 009e0b1..03484e7 100644 --- a/src/simulate/govv3/simulate.ts +++ b/src/simulate/govv3/simulate.ts @@ -1,11 +1,11 @@ -import { AaveV3Sepolia } from '@bgd-labs/aave-address-book'; -import { logError, logInfo, logSuccess } from '../../utils/logger'; +import { logInfo } from '../../utils/logger'; import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; import { getGovernance } from './governance'; import { Hex, createPublicClient, http } from 'viem'; import { sepolia, polygonMumbai, bscTestnet, avalancheFuji } from 'viem/chains'; import { PayloadsController, getPayloadsController } from './payloadsController'; import { generateReport } from './generatePayloadReport'; +import { sepoliaClient } from '../../utils/rpcClients'; const CHAIN_ID_CLIENT_MAP = { [sepolia.id]: { @@ -28,11 +28,7 @@ const CHAIN_ID_CLIENT_MAP = { export async function simulateProposal(governanceAddress: Hex, proposalId: bigint) { logInfo('General', `Running simulation for ${proposalId}`); - const governance = getGovernance( - governanceAddress, - createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }), - 3962575n - ); + const governance = getGovernance(governanceAddress, sepoliaClient, 3962575n); const logs = await governance.cacheLogs(); const proposal = await governance.getProposal(proposalId, logs); const payloads: { diff --git a/src/utils/rpcClients.ts b/src/utils/rpcClients.ts index f44c494..435234c 100644 --- a/src/utils/rpcClients.ts +++ b/src/utils/rpcClients.ts @@ -1,6 +1,6 @@ // import 'dotenv/config'; import { createPublicClient, http, fallback } from 'viem'; -import { mainnet, arbitrum, polygon, optimism, metis, base } from 'viem/chains'; +import { mainnet, arbitrum, polygon, optimism, metis, base, sepolia } from 'viem/chains'; export const mainnetClient = createPublicClient({ chain: mainnet, @@ -31,3 +31,5 @@ export const baseClient = createPublicClient({ chain: base, transport: http(process.env.RPC_BASE), }); + +export const sepoliaClient = createPublicClient({ chain: sepolia, transport: http() }); diff --git a/yarn-error.log b/yarn-error.log new file mode 100644 index 0000000..2523060 --- /dev/null +++ b/yarn-error.log @@ -0,0 +1,2774 @@ +Arguments: + /home/sakulstra/.nvm/versions/node/v18.15.0/bin/node /home/sakulstra/.yarn/bin/yarn.js add commander.js + +PATH: + /home/sakulstra/.yarn/bin:/home/sakulstra/.config/yarn/global/node_modules/.bin:/home/sakulstra/.meteor:/home/sakulstra/.nvm/versions/node/v18.15.0/bin:/home/sakulstra/.local/bin:/usr/local/bin:/usr/bin:/var/lib/snapd/snap/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin:/home/sakulstra/.foundry/bin + +Yarn version: + 1.22.19 + +Node version: + 18.15.0 + +Platform: + linux x64 + +Trace: + Error: https://registry.yarnpkg.com/commander.js: Not found + at params.callback [as _callback] (/home/sakulstra/.yarn/lib/cli.js:66145:18) + at self.callback (/home/sakulstra/.yarn/lib/cli.js:140890:22) + at Request.emit (node:events:513:28) + at Request. (/home/sakulstra/.yarn/lib/cli.js:141862:10) + at Request.emit (node:events:513:28) + at IncomingMessage. (/home/sakulstra/.yarn/lib/cli.js:141784:12) + at Object.onceWrapper (node:events:627:28) + at IncomingMessage.emit (node:events:525:35) + at endReadableNT (node:internal/streams/readable:1359:12) + at process.processTicksAndRejections (node:internal/process/task_queues:82:21) + +npm manifest: + { + "name": "@bgd-labs/aave-cli", + "version": "0.0.23", + "description": "A cli to perform various aave governance related tasks", + "private": false, + "scripts": { + "start": "tsx src/cli.ts", + "build": "tsup", + "test": "vitest", + "ci:publish": "npm run build && npm publish --access=public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/bgd-labs/report-engine.git" + }, + "author": "BGD labs", + "license": "MIT", + "bugs": { + "url": "https://github.com/bgd-labs/report-engine/issues" + }, + "homepage": "https://github.com/bgd-labs/report-engine#readme", + "devDependencies": { + "@types/node-fetch": "^2.6.4", + "@types/object-hash": "^3.0.3", + "@types/yargs": "^17.0.24", + "tsup": "^7.2.0", + "tsx": "^3.12.8", + "typescript": "^5.2.2", + "vitest": "^0.34.3" + }, + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "exports": { + ".": { + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + }, + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "bin": { + "aave-cli": "dist/cli.cjs" + }, + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@bgd-labs/aave-address-book": "2.3.0", + "bs58": "^5.0.0", + "chalk": "^4.1.2", + "dotenv": "^16.3.1", + "gray-matter": "^4.0.3", + "ipfs-only-hash": "^4.0.0", + "json-bigint": "^1.0.0", + "node-fetch": "^2.6.9", + "object-hash": "^3.0.0", + "viem": "^1.10.4", + "yargs": "^17.7.2", + "zod": "^3.21.4" + } + } + +yarn manifest: + No manifest + +Lockfile: + # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + # yarn lockfile v1 + + + "@adraffy/ens-normalize@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" + integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== + + "@assemblyscript/loader@^0.9.4": + version "0.9.4" + resolved "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.9.4.tgz" + integrity sha512-HazVq9zwTVwGmqdwYzu7WyQ6FQVZ7SwET0KKQuKm55jD0IfUpZgN0OPIiZG3zV1iSrVYcN0bdwLRXI/VNCYsUA== + + "@babel/code-frame@^7.0.0": + version "7.21.4" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz" + integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== + dependencies: + "@babel/highlight" "^7.18.6" + + "@babel/helper-validator-identifier@^7.18.6": + version "7.19.1" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + + "@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + + "@bgd-labs/aave-address-book@2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.3.0.tgz#ee937504ca5ec8c7a2d7750cd203aa601d9e04e9" + integrity sha512-P5t94rwHXakJIxtyM0MQWeVFtzkoupGcBcSZnLenRa8dRq1PsDbwDhMtvOMbr94/49Jv6KjTTon+axp158YK6A== + + "@esbuild-kit/cjs-loader@^2.4.2": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz#cb4dde00fbf744a68c4f20162ea15a8242d0fa54" + integrity sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg== + dependencies: + "@esbuild-kit/core-utils" "^3.0.0" + get-tsconfig "^4.4.0" + + "@esbuild-kit/core-utils@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz#49945d533dbd5e1b7620aa0fc522c15e6ec089c5" + integrity sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw== + dependencies: + esbuild "~0.17.6" + source-map-support "^0.5.21" + + "@esbuild-kit/core-utils@^3.2.2": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@esbuild-kit/core-utils/-/core-utils-3.2.2.tgz#ac3fe38d6ddcb3aa4658425034bb7a9cefa83495" + integrity sha512-Ub6LaRaAgF80dTSzUdXpFLM1pVDdmEVB9qb5iAzSpyDlX/mfJTFGOnZ516O05p5uWWteNviMKi4PAyEuRxI5gA== + dependencies: + esbuild "~0.18.20" + source-map-support "^0.5.21" + + "@esbuild-kit/esm-loader@^2.5.5": + version "2.5.5" + resolved "https://registry.yarnpkg.com/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz#b82da14fcee3fc1d219869756c06f43f67d1ca71" + integrity sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw== + dependencies: + "@esbuild-kit/core-utils" "^3.0.0" + get-tsconfig "^4.4.0" + + "@esbuild/android-arm64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz#15a8e2b407d03989b899e325151dc2e96d19c620" + integrity sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA== + + "@esbuild/android-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd" + integrity sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA== + + "@esbuild/android-arm64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622" + integrity sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ== + + "@esbuild/android-arm@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.12.tgz#677a09297e1f4f37aba7b4fc4f31088b00484985" + integrity sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ== + + "@esbuild/android-arm@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d" + integrity sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A== + + "@esbuild/android-arm@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.20.tgz#fedb265bc3a589c84cc11f810804f234947c3682" + integrity sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw== + + "@esbuild/android-x64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.12.tgz#b292729eef4e0060ae1941f6a021c4d2542a3521" + integrity sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w== + + "@esbuild/android-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1" + integrity sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww== + + "@esbuild/android-x64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.20.tgz#35cf419c4cfc8babe8893d296cd990e9e9f756f2" + integrity sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg== + + "@esbuild/darwin-arm64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz#efa35318df931da05825894e1787b976d55adbe3" + integrity sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg== + + "@esbuild/darwin-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" + integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg== + + "@esbuild/darwin-arm64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz#08172cbeccf95fbc383399a7f39cfbddaeb0d7c1" + integrity sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA== + + "@esbuild/darwin-x64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz#e7b54bb3f6dc81aadfd0485cd1623c648157e64d" + integrity sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA== + + "@esbuild/darwin-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb" + integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw== + + "@esbuild/darwin-x64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz#d70d5790d8bf475556b67d0f8b7c5bdff053d85d" + integrity sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ== + + "@esbuild/freebsd-arm64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz#99a18a8579d6299c449566fe91d9b6a54cf2a591" + integrity sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ== + + "@esbuild/freebsd-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2" + integrity sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ== + + "@esbuild/freebsd-arm64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz#98755cd12707f93f210e2494d6a4b51b96977f54" + integrity sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw== + + "@esbuild/freebsd-x64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz#0e090190fede307fb4022f671791a50dd5121abd" + integrity sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw== + + "@esbuild/freebsd-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4" + integrity sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ== + + "@esbuild/freebsd-x64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz#c1eb2bff03915f87c29cece4c1a7fa1f423b066e" + integrity sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ== + + "@esbuild/linux-arm64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz#7fe2a69f8a1a7153fa2b0f44aabcadb59475c7e0" + integrity sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg== + + "@esbuild/linux-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb" + integrity sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg== + + "@esbuild/linux-arm64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz#bad4238bd8f4fc25b5a021280c770ab5fc3a02a0" + integrity sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA== + + "@esbuild/linux-arm@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz#b87c76ebf1fe03e01fd6bb5cfc2f3c5becd5ee93" + integrity sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA== + + "@esbuild/linux-arm@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a" + integrity sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA== + + "@esbuild/linux-arm@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz#3e617c61f33508a27150ee417543c8ab5acc73b0" + integrity sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg== + + "@esbuild/linux-ia32@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz#9e9357090254524d32e6708883a47328f3037858" + integrity sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw== + + "@esbuild/linux-ia32@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a" + integrity sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ== + + "@esbuild/linux-ia32@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz#699391cccba9aee6019b7f9892eb99219f1570a7" + integrity sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA== + + "@esbuild/linux-loong64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz#9deb605f9e2c82f59412ddfefb4b6b96d54b5b5b" + integrity sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA== + + "@esbuild/linux-loong64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72" + integrity sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ== + + "@esbuild/linux-loong64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz#e6fccb7aac178dd2ffb9860465ac89d7f23b977d" + integrity sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg== + + "@esbuild/linux-mips64el@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz#6ef170b974ddf5e6acdfa5b05f22b6e9dfd2b003" + integrity sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA== + + "@esbuild/linux-mips64el@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289" + integrity sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A== + + "@esbuild/linux-mips64el@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz#eeff3a937de9c2310de30622a957ad1bd9183231" + integrity sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ== + + "@esbuild/linux-ppc64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz#1638d3d4acf1d34aaf37cf8908c2e1cefed16204" + integrity sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A== + + "@esbuild/linux-ppc64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7" + integrity sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg== + + "@esbuild/linux-ppc64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz#2f7156bde20b01527993e6881435ad79ba9599fb" + integrity sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA== + + "@esbuild/linux-riscv64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz#135b6e9270a8e2de2b9094bb21a287517df520ef" + integrity sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA== + + "@esbuild/linux-riscv64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09" + integrity sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA== + + "@esbuild/linux-riscv64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz#6628389f210123d8b4743045af8caa7d4ddfc7a6" + integrity sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A== + + "@esbuild/linux-s390x@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz#21e40830770c5d08368e300842bde382ce97d615" + integrity sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g== + + "@esbuild/linux-s390x@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829" + integrity sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q== + + "@esbuild/linux-s390x@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz#255e81fb289b101026131858ab99fba63dcf0071" + integrity sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ== + + "@esbuild/linux-x64@0.17.12": + version "0.17.12" + resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz" + integrity sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA== + + "@esbuild/linux-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4" + integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== + + "@esbuild/linux-x64@0.18.20": + version "0.18.20" + resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz" + integrity sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w== + + "@esbuild/netbsd-x64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz#c7c3b3017a4b938c76c35f66af529baf62eac527" + integrity sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg== + + "@esbuild/netbsd-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462" + integrity sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q== + + "@esbuild/netbsd-x64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz#30e8cd8a3dded63975e2df2438ca109601ebe0d1" + integrity sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A== + + "@esbuild/openbsd-x64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz#05d04217d980e049001afdbeacbb58d31bb5cefb" + integrity sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA== + + "@esbuild/openbsd-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691" + integrity sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g== + + "@esbuild/openbsd-x64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz#7812af31b205055874c8082ea9cf9ab0da6217ae" + integrity sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg== + + "@esbuild/sunos-x64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz#cf3862521600e4eb6c440ec3bad31ed40fb87ef3" + integrity sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg== + + "@esbuild/sunos-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273" + integrity sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg== + + "@esbuild/sunos-x64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz#d5c275c3b4e73c9b0ecd38d1ca62c020f887ab9d" + integrity sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ== + + "@esbuild/win32-arm64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz#43dd7fb5be77bf12a1550355ab2b123efd60868e" + integrity sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg== + + "@esbuild/win32-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f" + integrity sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag== + + "@esbuild/win32-arm64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz#73bc7f5a9f8a77805f357fab97f290d0e4820ac9" + integrity sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg== + + "@esbuild/win32-ia32@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz#9940963d0bff4ea3035a84e2b4c6e41c5e6296eb" + integrity sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng== + + "@esbuild/win32-ia32@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03" + integrity sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw== + + "@esbuild/win32-ia32@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz#ec93cbf0ef1085cc12e71e0d661d20569ff42102" + integrity sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g== + + "@esbuild/win32-x64@0.17.12": + version "0.17.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz#3a11d13e9a5b0c05db88991b234d8baba1f96487" + integrity sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw== + + "@esbuild/win32-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" + integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA== + + "@esbuild/win32-x64@0.18.20": + version "0.18.20" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d" + integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ== + + "@jest/schemas@^29.6.0": + version "29.6.0" + resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz" + integrity sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ== + dependencies: + "@sinclair/typebox" "^0.27.8" + + "@jridgewell/sourcemap-codec@^1.4.15": + version "1.4.15" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + + "@multiformats/base-x@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@multiformats/base-x/-/base-x-4.0.1.tgz" + integrity sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw== + + "@noble/curves@1.2.0", "@noble/curves@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + + "@noble/hashes@1.3.2", "@noble/hashes@~1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + + "@noble/hashes@~1.3.0": + version "1.3.1" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz" + integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== + + "@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + + "@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + + "@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + + "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== + + "@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + + "@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + + "@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== + + "@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + + "@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== + + "@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== + + "@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== + + "@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== + + "@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== + + "@scure/base@~1.1.0": + version "1.1.1" + resolved "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz" + integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== + + "@scure/base@~1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + + "@scure/bip32@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.2.tgz#90e78c027d5e30f0b22c1f8d50ff12f3fb7559f8" + integrity sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA== + dependencies: + "@noble/curves" "~1.2.0" + "@noble/hashes" "~1.3.2" + "@scure/base" "~1.1.2" + + "@scure/bip39@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" + integrity sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg== + dependencies: + "@noble/hashes" "~1.3.0" + "@scure/base" "~1.1.0" + + "@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + + "@types/chai-subset@^1.3.3": + version "1.3.3" + resolved "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz" + integrity sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw== + dependencies: + "@types/chai" "*" + + "@types/chai@*": + version "4.3.4" + resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz" + integrity sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw== + + "@types/chai@^4.3.5": + version "4.3.5" + resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz" + integrity sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng== + + "@types/long@^4.0.1": + version "4.0.2" + resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz" + integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== + + "@types/minimist@^1.2.0": + version "1.2.2" + resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz" + integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== + + "@types/node-fetch@^2.6.4": + version "2.6.4" + resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz" + integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== + dependencies: + "@types/node" "*" + form-data "^3.0.0" + + "@types/node@*": + version "18.15.3" + resolved "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz" + integrity sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw== + + "@types/node@>=13.7.0": + version "20.1.5" + resolved "https://registry.npmjs.org/@types/node/-/node-20.1.5.tgz" + integrity sha512-IvGD1CD/nego63ySR7vrAKEX3AJTcmrAN2kn+/sDNLi1Ff5kBzDeEdqWDplK+0HAEoLYej137Sk0cUU8OLOlMg== + + "@types/normalize-package-data@^2.4.0": + version "2.4.1" + resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz" + integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== + + "@types/object-hash@^3.0.3": + version "3.0.3" + resolved "https://registry.npmjs.org/@types/object-hash/-/object-hash-3.0.3.tgz" + integrity sha512-Mb0SDIhjhBAz4/rDNU0cYcQR4lSJIwy+kFlm0whXLkx+o0pXwEszwyrWD6gXWumxVbAS6XZ9gXK82LR+Uk+cKQ== + + "@types/ws@^8.5.5": + version "8.5.5" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" + integrity sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg== + dependencies: + "@types/node" "*" + + "@types/yargs-parser@*": + version "21.0.0" + resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz" + integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + + "@types/yargs@^17.0.24": + version "17.0.24" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz" + integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== + dependencies: + "@types/yargs-parser" "*" + + "@vitest/expect@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.34.3.tgz#576e1fd6a3a8b8b7a79a06477f3d450a77d67852" + integrity sha512-F8MTXZUYRBVsYL1uoIft1HHWhwDbSzwAU9Zgh8S6WFC3YgVb4AnFV2GXO3P5Em8FjEYaZtTnQYoNwwBrlOMXgg== + dependencies: + "@vitest/spy" "0.34.3" + "@vitest/utils" "0.34.3" + chai "^4.3.7" + + "@vitest/runner@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.34.3.tgz#ce09b777d133bbcf843e1a67f4a743365764e097" + integrity sha512-lYNq7N3vR57VMKMPLVvmJoiN4bqwzZ1euTW+XXYH5kzr3W/+xQG3b41xJn9ChJ3AhYOSoweu974S1V3qDcFESA== + dependencies: + "@vitest/utils" "0.34.3" + p-limit "^4.0.0" + pathe "^1.1.1" + + "@vitest/snapshot@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-0.34.3.tgz#cb4767aa44711a1072bd2e06204b659275c4f0f2" + integrity sha512-QyPaE15DQwbnIBp/yNJ8lbvXTZxS00kRly0kfFgAD5EYmCbYcA+1EEyRalc93M0gosL/xHeg3lKAClIXYpmUiQ== + dependencies: + magic-string "^0.30.1" + pathe "^1.1.1" + pretty-format "^29.5.0" + + "@vitest/spy@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.34.3.tgz#d4cf25e6ca9230991a0223ecd4ec2df30f0784ff" + integrity sha512-N1V0RFQ6AI7CPgzBq9kzjRdPIgThC340DGjdKdPSE8r86aUSmeliTUgkTqLSgtEwWWsGfBQ+UetZWhK0BgJmkQ== + dependencies: + tinyspy "^2.1.1" + + "@vitest/utils@0.34.3": + version "0.34.3" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.34.3.tgz#6e243189a358b736b9fc0216e6b6979bc857e897" + integrity sha512-kiSnzLG6m/tiT0XEl4U2H8JDBjFtwVlaE8I3QfGiMFR0QvnRDfYfdP3YvTBWM/6iJDAyaPY6yVQiCTUc7ZzTHA== + dependencies: + diff-sequences "^29.4.3" + loupe "^2.3.6" + pretty-format "^29.5.0" + + abitype@0.9.8: + version "0.9.8" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c" + integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ== + + acorn-walk@^8.2.0: + version "8.2.0" + resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + + acorn@^8.8.2: + version "8.8.2" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + + acorn@^8.9.0: + version "8.10.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + + ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + + ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + + ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + + ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + + any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz" + integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== + + anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + + argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + + array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + + arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" + integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== + + assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + + asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + + balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + + base-x@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz" + integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw== + + base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + + bignumber.js@^9.0.0: + version "9.1.1" + resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz" + integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== + + binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + + bl@^5.0.0: + version "5.1.0" + resolved "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz" + integrity sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ== + dependencies: + buffer "^6.0.3" + inherits "^2.0.4" + readable-stream "^3.4.0" + + blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + + brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + + braces@^3.0.2, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + + bs58@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz" + integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ== + dependencies: + base-x "^4.0.0" + + buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + + buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + + bundle-require@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/bundle-require/-/bundle-require-4.0.1.tgz" + integrity sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ== + dependencies: + load-tsconfig "^0.2.3" + + cac@^6.7.12, cac@^6.7.14: + version "6.7.14" + resolved "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz" + integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== + + camelcase-keys@^6.2.2: + version "6.2.2" + resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz" + integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== + dependencies: + camelcase "^5.3.1" + map-obj "^4.0.0" + quick-lru "^4.0.1" + + camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + + chai@^4.3.7: + version "4.3.7" + resolved "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz" + integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^4.1.2" + get-func-name "^2.0.0" + loupe "^2.3.1" + pathval "^1.1.1" + type-detect "^4.0.5" + + chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + + chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + + check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" + integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== + + chokidar@^3.5.1: + version "3.5.3" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + + cids@^1.0.0, cids@^1.1.5, cids@^1.1.6: + version "1.1.9" + resolved "https://registry.npmjs.org/cids/-/cids-1.1.9.tgz" + integrity sha512-l11hWRfugIcbGuTZwAM5PwpjPPjyb6UZOGwlHSnOBV5o07XhQ4gNpBN67FbODvpjyHtd+0Xs6KNvUcGBiDRsdg== + dependencies: + multibase "^4.0.1" + multicodec "^3.0.1" + multihashes "^4.0.1" + uint8arrays "^3.0.0" + + cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + + color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + + color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + + color-name@1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + + color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + + combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + + commander@^4.0.0: + version "4.1.1" + resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== + + concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + + cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + + debug@^4.3.1, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + + decamelize-keys@^1.1.0: + version "1.1.1" + resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz" + integrity sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg== + dependencies: + decamelize "^1.1.0" + map-obj "^1.0.0" + + decamelize@^1.1.0, decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== + + deep-eql@^4.1.2: + version "4.1.3" + resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + + delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + + diff-sequences@^29.4.3: + version "29.4.3" + resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz" + integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== + + dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + + dotenv@^16.3.1: + version "16.3.1" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz" + integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== + + emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + + err-code@^3.0.0, err-code@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz" + integrity sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA== + + error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + + esbuild@^0.17.5: + version "0.17.12" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.17.12.tgz" + integrity sha512-bX/zHl7Gn2CpQwcMtRogTTBf9l1nl+H6R8nUbjk+RuKqAE3+8FDulLA+pHvX7aA7Xe07Iwa+CWvy9I8Y2qqPKQ== + optionalDependencies: + "@esbuild/android-arm" "0.17.12" + "@esbuild/android-arm64" "0.17.12" + "@esbuild/android-x64" "0.17.12" + "@esbuild/darwin-arm64" "0.17.12" + "@esbuild/darwin-x64" "0.17.12" + "@esbuild/freebsd-arm64" "0.17.12" + "@esbuild/freebsd-x64" "0.17.12" + "@esbuild/linux-arm" "0.17.12" + "@esbuild/linux-arm64" "0.17.12" + "@esbuild/linux-ia32" "0.17.12" + "@esbuild/linux-loong64" "0.17.12" + "@esbuild/linux-mips64el" "0.17.12" + "@esbuild/linux-ppc64" "0.17.12" + "@esbuild/linux-riscv64" "0.17.12" + "@esbuild/linux-s390x" "0.17.12" + "@esbuild/linux-x64" "0.17.12" + "@esbuild/netbsd-x64" "0.17.12" + "@esbuild/openbsd-x64" "0.17.12" + "@esbuild/sunos-x64" "0.17.12" + "@esbuild/win32-arm64" "0.17.12" + "@esbuild/win32-ia32" "0.17.12" + "@esbuild/win32-x64" "0.17.12" + + esbuild@^0.18.2, esbuild@~0.18.20: + version "0.18.20" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz" + integrity sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA== + optionalDependencies: + "@esbuild/android-arm" "0.18.20" + "@esbuild/android-arm64" "0.18.20" + "@esbuild/android-x64" "0.18.20" + "@esbuild/darwin-arm64" "0.18.20" + "@esbuild/darwin-x64" "0.18.20" + "@esbuild/freebsd-arm64" "0.18.20" + "@esbuild/freebsd-x64" "0.18.20" + "@esbuild/linux-arm" "0.18.20" + "@esbuild/linux-arm64" "0.18.20" + "@esbuild/linux-ia32" "0.18.20" + "@esbuild/linux-loong64" "0.18.20" + "@esbuild/linux-mips64el" "0.18.20" + "@esbuild/linux-ppc64" "0.18.20" + "@esbuild/linux-riscv64" "0.18.20" + "@esbuild/linux-s390x" "0.18.20" + "@esbuild/linux-x64" "0.18.20" + "@esbuild/netbsd-x64" "0.18.20" + "@esbuild/openbsd-x64" "0.18.20" + "@esbuild/sunos-x64" "0.18.20" + "@esbuild/win32-arm64" "0.18.20" + "@esbuild/win32-ia32" "0.18.20" + "@esbuild/win32-x64" "0.18.20" + + esbuild@~0.17.6: + version "0.17.19" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955" + integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== + optionalDependencies: + "@esbuild/android-arm" "0.17.19" + "@esbuild/android-arm64" "0.17.19" + "@esbuild/android-x64" "0.17.19" + "@esbuild/darwin-arm64" "0.17.19" + "@esbuild/darwin-x64" "0.17.19" + "@esbuild/freebsd-arm64" "0.17.19" + "@esbuild/freebsd-x64" "0.17.19" + "@esbuild/linux-arm" "0.17.19" + "@esbuild/linux-arm64" "0.17.19" + "@esbuild/linux-ia32" "0.17.19" + "@esbuild/linux-loong64" "0.17.19" + "@esbuild/linux-mips64el" "0.17.19" + "@esbuild/linux-ppc64" "0.17.19" + "@esbuild/linux-riscv64" "0.17.19" + "@esbuild/linux-s390x" "0.17.19" + "@esbuild/linux-x64" "0.17.19" + "@esbuild/netbsd-x64" "0.17.19" + "@esbuild/openbsd-x64" "0.17.19" + "@esbuild/sunos-x64" "0.17.19" + "@esbuild/win32-arm64" "0.17.19" + "@esbuild/win32-ia32" "0.17.19" + "@esbuild/win32-x64" "0.17.19" + + escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + + escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + + esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + + execa@^5.0.0: + version "5.1.1" + resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + + extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz" + integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== + dependencies: + is-extendable "^0.1.0" + + fast-glob@^3.2.9: + version "3.2.12" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + + fastq@^1.6.0: + version "1.15.0" + resolved "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + dependencies: + reusify "^1.0.4" + + fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + + find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + + form-data@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + + fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + + fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + + function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + + get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + + get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" + integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== + + get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + + get-tsconfig@^4.4.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.0.tgz#06ce112a1463e93196aa90320c35df5039147e34" + integrity sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw== + dependencies: + resolve-pkg-maps "^1.0.0" + + glob-parent@^5.1.2, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + + glob@7.1.6: + version "7.1.6" + resolved "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + + globby@^11.0.3: + version "11.1.0" + resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + + gray-matter@^4.0.3: + version "4.0.3" + resolved "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz" + integrity sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q== + dependencies: + js-yaml "^3.13.1" + kind-of "^6.0.2" + section-matter "^1.0.0" + strip-bom-string "^1.0.0" + + hamt-sharding@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/hamt-sharding/-/hamt-sharding-2.0.1.tgz" + integrity sha512-vnjrmdXG9dDs1m/H4iJ6z0JFI2NtgsW5keRkTcM85NGak69Mkf5PHUqBz+Xs0T4sg0ppvj9O5EGAJo40FTxmmA== + dependencies: + sparse-array "^1.3.1" + uint8arrays "^3.0.0" + + hard-rejection@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz" + integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== + + has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + + has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + + has@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + + hosted-git-info@^2.1.4: + version "2.8.9" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + + hosted-git-info@^4.0.1: + version "4.1.0" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz" + integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== + dependencies: + lru-cache "^6.0.0" + + human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + + ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + + ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + + indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + + inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + + inherits@2, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + + interface-ipld-format@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/interface-ipld-format/-/interface-ipld-format-1.0.1.tgz" + integrity sha512-WV/ar+KQJVoQpqRDYdo7YPGYIUHJxCuOEhdvsRpzLqoOIVCqPKdMMYmsLL1nCRsF3yYNio+PAJbCKiv6drrEAg== + dependencies: + cids "^1.1.6" + multicodec "^3.0.1" + multihashes "^4.0.2" + + ipfs-only-hash@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/ipfs-only-hash/-/ipfs-only-hash-4.0.0.tgz" + integrity sha512-TE1DZCvfw8i3gcsTq3P4TFx3cKFJ3sluu/J3XINkJhIN9OwJgNMqKA+WnKx6ByCb1IoPXsTp1KM7tupElb6SyA== + dependencies: + ipfs-unixfs-importer "^7.0.1" + meow "^9.0.0" + + ipfs-unixfs-importer@^7.0.1: + version "7.0.3" + resolved "https://registry.npmjs.org/ipfs-unixfs-importer/-/ipfs-unixfs-importer-7.0.3.tgz" + integrity sha512-qeFOlD3AQtGzr90sr5Tq1Bi8pT5Nr2tSI8z310m7R4JDYgZc6J1PEZO3XZQ8l1kuGoqlAppBZuOYmPEqaHcVQQ== + dependencies: + bl "^5.0.0" + cids "^1.1.5" + err-code "^3.0.1" + hamt-sharding "^2.0.0" + ipfs-unixfs "^4.0.3" + ipld-dag-pb "^0.22.2" + it-all "^1.0.5" + it-batch "^1.0.8" + it-first "^1.0.6" + it-parallel-batch "^1.0.9" + merge-options "^3.0.4" + multihashing-async "^2.1.0" + rabin-wasm "^0.1.4" + uint8arrays "^2.1.2" + + ipfs-unixfs@^4.0.3: + version "4.0.3" + resolved "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-4.0.3.tgz" + integrity sha512-hzJ3X4vlKT8FQ3Xc4M1szaFVjsc1ZydN+E4VQ91aXxfpjFn9G2wsMo1EFdAXNq/BUnN5dgqIOMP5zRYr3DTsAw== + dependencies: + err-code "^3.0.1" + protobufjs "^6.10.2" + + ipld-dag-pb@^0.22.2: + version "0.22.3" + resolved "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.22.3.tgz" + integrity sha512-dfG5C5OVAR4FEP7Al2CrHWvAyIM7UhAQrjnOYOIxXGQz5NlEj6wGX0XQf6Ru6or1na6upvV3NQfstapQG8X2rg== + dependencies: + cids "^1.0.0" + interface-ipld-format "^1.0.0" + multicodec "^3.0.1" + multihashing-async "^2.0.0" + protobufjs "^6.10.2" + stable "^0.1.8" + uint8arrays "^2.0.5" + + is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + + is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + + is-core-module@^2.11.0, is-core-module@^2.5.0: + version "2.12.0" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz" + integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== + dependencies: + has "^1.0.3" + + is-core-module@^2.9.0: + version "2.11.0" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== + dependencies: + has "^1.0.3" + + is-extendable@^0.1.0: + version "0.1.1" + resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== + + is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + + is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + + is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + + is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + + is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz" + integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== + + is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + + is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + + isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + + isomorphic-ws@5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz" + integrity sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw== + + it-all@^1.0.5: + version "1.0.6" + resolved "https://registry.npmjs.org/it-all/-/it-all-1.0.6.tgz" + integrity sha512-3cmCc6Heqe3uWi3CVM/k51fa/XbMFpQVzFoDsV0IZNHSQDyAXl3c4MjHkFX5kF3922OGj7Myv1nSEUgRtcuM1A== + + it-batch@^1.0.8, it-batch@^1.0.9: + version "1.0.9" + resolved "https://registry.npmjs.org/it-batch/-/it-batch-1.0.9.tgz" + integrity sha512-7Q7HXewMhNFltTsAMdSz6luNhyhkhEtGGbYek/8Xb/GiqYMtwUmopE1ocPSiJKKp3rM4Dt045sNFoUu+KZGNyA== + + it-first@^1.0.6: + version "1.0.7" + resolved "https://registry.npmjs.org/it-first/-/it-first-1.0.7.tgz" + integrity sha512-nvJKZoBpZD/6Rtde6FXqwDqDZGF1sCADmr2Zoc0hZsIvnE449gRFnGctxDf09Bzc/FWnHXAdaHVIetY6lrE0/g== + + it-parallel-batch@^1.0.9: + version "1.0.11" + resolved "https://registry.npmjs.org/it-parallel-batch/-/it-parallel-batch-1.0.11.tgz" + integrity sha512-UWsWHv/kqBpMRmyZJzlmZeoAMA0F3SZr08FBdbhtbe+MtoEBgr/ZUAKrnenhXCBrsopy76QjRH2K/V8kNdupbQ== + dependencies: + it-batch "^1.0.9" + + joycon@^3.0.1: + version "3.1.1" + resolved "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz" + integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== + + js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + + js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + + js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + + json-bigint@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz" + integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== + dependencies: + bignumber.js "^9.0.0" + + json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + + jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + + kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: + version "6.0.3" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + + lilconfig@^2.0.5: + version "2.1.0" + resolved "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz" + integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== + + lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + + load-tsconfig@^0.2.3: + version "0.2.5" + resolved "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz" + integrity sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg== + + local-pkg@^0.4.3: + version "0.4.3" + resolved "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz" + integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g== + + locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + + lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz" + integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== + + long@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + + loupe@^2.3.1, loupe@^2.3.6: + version "2.3.6" + resolved "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz" + integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== + dependencies: + get-func-name "^2.0.0" + + lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + + magic-string@^0.30.1: + version "0.30.2" + resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.2.tgz" + integrity sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.15" + + map-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" + integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== + + map-obj@^4.0.0: + version "4.3.0" + resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz" + integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== + + meow@^9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz" + integrity sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ== + dependencies: + "@types/minimist" "^1.2.0" + camelcase-keys "^6.2.2" + decamelize "^1.2.0" + decamelize-keys "^1.1.0" + hard-rejection "^2.1.0" + minimist-options "4.1.0" + normalize-package-data "^3.0.0" + read-pkg-up "^7.0.1" + redent "^3.0.0" + trim-newlines "^3.0.0" + type-fest "^0.18.0" + yargs-parser "^20.2.3" + + merge-options@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz" + integrity sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ== + dependencies: + is-plain-obj "^2.1.0" + + merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + + merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + + micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + + mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + + mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + + mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + + min-indent@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" + integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== + + minimatch@^3.0.4: + version "3.1.2" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + + minimist-options@4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" + integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== + dependencies: + arrify "^1.0.1" + is-plain-obj "^1.1.0" + kind-of "^6.0.3" + + minimist@^1.2.5: + version "1.2.8" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + + mlly@^1.2.0: + version "1.2.1" + resolved "https://registry.npmjs.org/mlly/-/mlly-1.2.1.tgz" + integrity sha512-1aMEByaWgBPEbWV2BOPEMySRrzl7rIHXmQxam4DM8jVjalTQDjpN2ZKOLUrwyhfZQO7IXHml2StcHMhooDeEEQ== + dependencies: + acorn "^8.8.2" + pathe "^1.1.0" + pkg-types "^1.0.3" + ufo "^1.1.2" + + mlly@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/mlly/-/mlly-1.4.0.tgz" + integrity sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg== + dependencies: + acorn "^8.9.0" + pathe "^1.1.1" + pkg-types "^1.0.3" + ufo "^1.1.2" + + ms@2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + + multibase@^4.0.1: + version "4.0.6" + resolved "https://registry.npmjs.org/multibase/-/multibase-4.0.6.tgz" + integrity sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ== + dependencies: + "@multiformats/base-x" "^4.0.1" + + multicodec@^3.0.1: + version "3.2.1" + resolved "https://registry.npmjs.org/multicodec/-/multicodec-3.2.1.tgz" + integrity sha512-+expTPftro8VAW8kfvcuNNNBgb9gPeNYV9dn+z1kJRWF2vih+/S79f2RVeIwmrJBUJ6NT9IUPWnZDQvegEh5pw== + dependencies: + uint8arrays "^3.0.0" + varint "^6.0.0" + + multiformats@^9.4.2: + version "9.9.0" + resolved "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz" + integrity sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg== + + multihashes@^4.0.1, multihashes@^4.0.2: + version "4.0.3" + resolved "https://registry.npmjs.org/multihashes/-/multihashes-4.0.3.tgz" + integrity sha512-0AhMH7Iu95XjDLxIeuCOOE4t9+vQZsACyKZ9Fxw2pcsRmlX4iCn1mby0hS0bb+nQOVpdQYWPpnyusw4da5RPhA== + dependencies: + multibase "^4.0.1" + uint8arrays "^3.0.0" + varint "^5.0.2" + + multihashing-async@^2.0.0, multihashing-async@^2.1.0: + version "2.1.4" + resolved "https://registry.npmjs.org/multihashing-async/-/multihashing-async-2.1.4.tgz" + integrity sha512-sB1MiQXPSBTNRVSJc2zM157PXgDtud2nMFUEIvBrsq5Wv96sUclMRK/ecjoP1T/W61UJBqt4tCTwMkUpt2Gbzg== + dependencies: + blakejs "^1.1.0" + err-code "^3.0.0" + js-sha3 "^0.8.0" + multihashes "^4.0.1" + murmurhash3js-revisited "^3.0.0" + uint8arrays "^3.0.0" + + murmurhash3js-revisited@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz" + integrity sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g== + + mz@^2.7.0: + version "2.7.0" + resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + + nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== + + node-fetch@^2.6.1: + version "2.6.11" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz" + integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== + dependencies: + whatwg-url "^5.0.0" + + node-fetch@^2.6.9: + version "2.6.9" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz" + integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg== + dependencies: + whatwg-url "^5.0.0" + + normalize-package-data@^2.5.0: + version "2.5.0" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + + normalize-package-data@^3.0.0: + version "3.0.3" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz" + integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== + dependencies: + hosted-git-info "^4.0.1" + is-core-module "^2.5.0" + semver "^7.3.4" + validate-npm-package-license "^3.0.1" + + normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + + npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + + object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + + object-hash@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz" + integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== + + once@^1.3.0: + version "1.4.0" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + + onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + + p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + + p-limit@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz" + integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== + dependencies: + yocto-queue "^1.0.0" + + p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + + p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + + parse-json@^5.0.0: + version "5.2.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + + path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + + path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + + path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + + path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + + path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + + pathe@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/pathe/-/pathe-1.1.0.tgz" + integrity sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w== + + pathe@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz" + integrity sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q== + + pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + + picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + + pirates@^4.0.1: + version "4.0.5" + resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + + pkg-types@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz" + integrity sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A== + dependencies: + jsonc-parser "^3.2.0" + mlly "^1.2.0" + pathe "^1.1.0" + + postcss-load-config@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.1.tgz" + integrity sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA== + dependencies: + lilconfig "^2.0.5" + yaml "^2.1.1" + + postcss@^8.4.21: + version "8.4.21" + resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz" + integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + + pretty-format@^29.5.0: + version "29.6.2" + resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.2.tgz" + integrity sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg== + dependencies: + "@jest/schemas" "^29.6.0" + ansi-styles "^5.0.0" + react-is "^18.0.0" + + protobufjs@^6.10.2: + version "6.11.3" + resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz" + integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + + punycode@^2.1.0: + version "2.3.0" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + + queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + + quick-lru@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" + integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== + + rabin-wasm@^0.1.4: + version "0.1.5" + resolved "https://registry.npmjs.org/rabin-wasm/-/rabin-wasm-0.1.5.tgz" + integrity sha512-uWgQTo7pim1Rnj5TuWcCewRDTf0PEFTSlaUjWP4eY9EbLV9em08v89oCz/WO+wRxpYuO36XEHp4wgYQnAgOHzA== + dependencies: + "@assemblyscript/loader" "^0.9.4" + bl "^5.0.0" + debug "^4.3.1" + minimist "^1.2.5" + node-fetch "^2.6.1" + readable-stream "^3.6.0" + + react-is@^18.0.0: + version "18.2.0" + resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + + read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== + dependencies: + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" + + read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + dependencies: + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" + + readable-stream@^3.4.0, readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + + readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + + redent@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz" + integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== + dependencies: + indent-string "^4.0.0" + strip-indent "^3.0.0" + + require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + + resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + + resolve-pkg-maps@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" + integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== + + resolve@^1.10.0: + version "1.22.2" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz" + integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== + dependencies: + is-core-module "^2.11.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + + resolve@^1.22.1: + version "1.22.1" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + + reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + + rollup@^3.18.0, rollup@^3.2.5: + version "3.20.0" + resolved "https://registry.npmjs.org/rollup/-/rollup-3.20.0.tgz" + integrity sha512-YsIfrk80NqUDrxrjWPXUa7PWvAfegZEXHuPsEZg58fGCdjL1I9C1i/NaG+L+27kxxwkrG/QEDEQc8s/ynXWWGQ== + optionalDependencies: + fsevents "~2.3.2" + + run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + + safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + + section-matter@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz" + integrity sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA== + dependencies: + extend-shallow "^2.0.1" + kind-of "^6.0.0" + + "semver@2 || 3 || 4 || 5": + version "5.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + + semver@^7.3.4: + version "7.5.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz" + integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== + dependencies: + lru-cache "^6.0.0" + + shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + + shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + + siginfo@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz" + integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== + + signal-exit@^3.0.3: + version "3.0.7" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + + slash@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + + source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + + source-map-support@^0.5.21: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + + source-map@0.8.0-beta.0: + version "0.8.0-beta.0" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz" + integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== + dependencies: + whatwg-url "^7.0.0" + + source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + + sparse-array@^1.3.1: + version "1.3.2" + resolved "https://registry.npmjs.org/sparse-array/-/sparse-array-1.3.2.tgz" + integrity sha512-ZT711fePGn3+kQyLuv1fpd3rNSkNF8vd5Kv2D+qnOANeyKs3fx6bUMGWRPvgTTcYV64QMqZKZwcuaQSP3AZ0tg== + + spdx-correct@^3.0.0: + version "3.2.0" + resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz" + integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + + spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + + spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + + spdx-license-ids@^3.0.0: + version "3.0.13" + resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz" + integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== + + sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + + stable@^0.1.8: + version "0.1.8" + resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz" + integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== + + stackback@0.0.2: + version "0.0.2" + resolved "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz" + integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== + + std-env@^3.3.3: + version "3.3.3" + resolved "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz" + integrity sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg== + + string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + + string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + + strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + + strip-bom-string@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz" + integrity sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g== + + strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + + strip-indent@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz" + integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== + dependencies: + min-indent "^1.0.0" + + strip-literal@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz" + integrity sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q== + dependencies: + acorn "^8.8.2" + + sucrase@^3.20.3: + version "3.30.0" + resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.30.0.tgz" + integrity sha512-7d37d3vLF0IeH2dzvHpzDNDxUqpbDHJXTJOAnQ8jvMW04o2Czps6mxtaSnKWpE+hUS/eczqfWPUgQTrazKZPnQ== + dependencies: + commander "^4.0.0" + glob "7.1.6" + lines-and-columns "^1.1.6" + mz "^2.7.0" + pirates "^4.0.1" + ts-interface-checker "^0.1.9" + + supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + + supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + + supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + + thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz" + integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== + dependencies: + thenify ">= 3.1.0 < 4" + + "thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" + + tinybench@^2.5.0: + version "2.5.0" + resolved "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz" + integrity sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA== + + tinypool@^0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/tinypool/-/tinypool-0.7.0.tgz" + integrity sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww== + + tinyspy@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz" + integrity sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w== + + to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + + tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz" + integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== + dependencies: + punycode "^2.1.0" + + tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + + tree-kill@^1.2.2: + version "1.2.2" + resolved "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz" + integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== + + trim-newlines@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz" + integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== + + ts-interface-checker@^0.1.9: + version "0.1.13" + resolved "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz" + integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== + + tsup@^7.2.0: + version "7.2.0" + resolved "https://registry.npmjs.org/tsup/-/tsup-7.2.0.tgz" + integrity sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ== + dependencies: + bundle-require "^4.0.0" + cac "^6.7.12" + chokidar "^3.5.1" + debug "^4.3.1" + esbuild "^0.18.2" + execa "^5.0.0" + globby "^11.0.3" + joycon "^3.0.1" + postcss-load-config "^4.0.1" + resolve-from "^5.0.0" + rollup "^3.2.5" + source-map "0.8.0-beta.0" + sucrase "^3.20.3" + tree-kill "^1.2.2" + + tsx@^3.12.8: + version "3.12.8" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.12.8.tgz#e9ec95c6b116e28f0187467f839029a3ce17a851" + integrity sha512-Lt9KYaRGF023tlLInPj8rgHwsZU8qWLBj4iRXNWxTfjIkU7canGL806AqKear1j722plHuiYNcL2ZCo6uS9UJA== + dependencies: + "@esbuild-kit/cjs-loader" "^2.4.2" + "@esbuild-kit/core-utils" "^3.2.2" + "@esbuild-kit/esm-loader" "^2.5.5" + optionalDependencies: + fsevents "~2.3.2" + + type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + + type-fest@^0.18.0: + version "0.18.1" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz" + integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== + + type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + + type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + + typescript@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" + integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== + + ufo@^1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz" + integrity sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ== + + uint8arrays@^2.0.5, uint8arrays@^2.1.2: + version "2.1.10" + resolved "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz" + integrity sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A== + dependencies: + multiformats "^9.4.2" + + uint8arrays@^3.0.0: + version "3.1.1" + resolved "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz" + integrity sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg== + dependencies: + multiformats "^9.4.2" + + util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + + validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + + varint@^5.0.2: + version "5.0.2" + resolved "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz" + integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== + + varint@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" + integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== + + viem@^1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.10.4.tgz#0c08364192194b067cede4583ad8cf7b02d2dbeb" + integrity sha512-GRnz1KLWh7rDFvR0fMUBt8orVu/QbGJ3QqlLo7M71H4rig39TvjDoVyMp7eFK18+Zs6niqev1f8woX9fv3cwVg== + dependencies: + "@adraffy/ens-normalize" "1.9.4" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@scure/bip32" "1.3.2" + "@scure/bip39" "1.2.1" + "@types/ws" "^8.5.5" + abitype "0.9.8" + isomorphic-ws "5.0.0" + ws "8.13.0" + + vite-node@0.34.3: + version "0.34.3" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.34.3.tgz#de134fe38bc1555ac8ab5e489d7df6159a3e1a4c" + integrity sha512-+0TzJf1g0tYXj6tR2vEyiA42OPq68QkRZCu/ERSo2PtsDJfBpDyEfuKbRvLmZqi/CgC7SCBtyC+WjTGNMRIaig== + dependencies: + cac "^6.7.14" + debug "^4.3.4" + mlly "^1.4.0" + pathe "^1.1.1" + picocolors "^1.0.0" + vite "^3.0.0 || ^4.0.0" + + "vite@^3.0.0 || ^4.0.0": + version "4.2.0" + resolved "https://registry.npmjs.org/vite/-/vite-4.2.0.tgz" + integrity sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g== + dependencies: + esbuild "^0.17.5" + postcss "^8.4.21" + resolve "^1.22.1" + rollup "^3.18.0" + optionalDependencies: + fsevents "~2.3.2" + + vitest@^0.34.3: + version "0.34.3" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.34.3.tgz#863d61c133d01b16e49fd52d380c09fa5ac03188" + integrity sha512-7+VA5Iw4S3USYk+qwPxHl8plCMhA5rtfwMjgoQXMT7rO5ldWcdsdo3U1QD289JgglGK4WeOzgoLTsGFu6VISyQ== + dependencies: + "@types/chai" "^4.3.5" + "@types/chai-subset" "^1.3.3" + "@types/node" "*" + "@vitest/expect" "0.34.3" + "@vitest/runner" "0.34.3" + "@vitest/snapshot" "0.34.3" + "@vitest/spy" "0.34.3" + "@vitest/utils" "0.34.3" + acorn "^8.9.0" + acorn-walk "^8.2.0" + cac "^6.7.14" + chai "^4.3.7" + debug "^4.3.4" + local-pkg "^0.4.3" + magic-string "^0.30.1" + pathe "^1.1.1" + picocolors "^1.0.0" + std-env "^3.3.3" + strip-literal "^1.0.1" + tinybench "^2.5.0" + tinypool "^0.7.0" + vite "^3.0.0 || ^4.0.0" + vite-node "0.34.3" + why-is-node-running "^2.2.2" + + webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + + webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + + whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + + whatwg-url@^7.0.0: + version "7.1.0" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz" + integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + + which@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + + why-is-node-running@^2.2.2: + version "2.2.2" + resolved "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz" + integrity sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA== + dependencies: + siginfo "^2.0.0" + stackback "0.0.2" + + wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + + wrappy@1: + version "1.0.2" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + + ws@8.13.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + + y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + + yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + + yaml@^2.1.1: + version "2.3.1" + resolved "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz" + integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== + + yargs-parser@^20.2.3: + version "20.2.9" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + + yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + + yargs@^17.7.2: + version "17.7.2" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + + yocto-queue@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz" + integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== + + zod@^3.21.4: + version "3.21.4" + resolved "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz" + integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== diff --git a/yarn.lock b/yarn.lock index 66d13b4..cc1804a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -38,6 +38,11 @@ resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.3.0.tgz#ee937504ca5ec8c7a2d7750cd203aa601d9e04e9" integrity sha512-P5t94rwHXakJIxtyM0MQWeVFtzkoupGcBcSZnLenRa8dRq1PsDbwDhMtvOMbr94/49Jv6KjTTon+axp158YK6A== +"@commander-js/extra-typings@^11.0.0": + version "11.0.0" + resolved "https://registry.yarnpkg.com/@commander-js/extra-typings/-/extra-typings-11.0.0.tgz#eb922a59550454cad1f319d3d33e675e12e92fa0" + integrity sha512-06ol6Kn5gPjFY6v0vWOZ84nQwyqhZdaeZCHYH3vhwewjpOEjniF1KHZxh18887G3poWiJ8qyq5pb6ANuiddfPQ== + "@esbuild-kit/cjs-loader@^2.4.2": version "2.4.2" resolved "https://registry.yarnpkg.com/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz#cb4dde00fbf744a68c4f20162ea15a8242d0fa54" @@ -941,6 +946,11 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" +commander@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-11.0.0.tgz#43e19c25dbedc8256203538e8d7e9346877a6f67" + integrity sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ== + commander@^4.0.0: version "4.1.1" resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz" From 99666f8ccaa22113824c12069cf04814c9af7835 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 7 Sep 2023 12:29:15 +0200 Subject: [PATCH 31/94] feat: add initial vote impelmentation --- src/commands/governance-v3.ts | 28 +++++++++++++++++++++++++--- src/simulate/govv3/governance.ts | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/commands/governance-v3.ts b/src/commands/governance-v3.ts index d728326..4847cba 100644 --- a/src/commands/governance-v3.ts +++ b/src/commands/governance-v3.ts @@ -1,7 +1,7 @@ -import { Command } from '@commander-js/extra-typings'; +import { Command, Option } from '@commander-js/extra-typings'; import { simulateProposal } from '../simulate/govv3/simulate'; import { GovernanceV3Sepolia } from '@bgd-labs/aave-address-book'; -import { getGovernance } from '../simulate/govv3/governance'; +import { State, getGovernance } from '../simulate/govv3/governance'; import { createPublicClient } from 'viem'; import { sepoliaClient } from '../utils/rpcClients'; import { logInfo } from '../utils/logger'; @@ -95,6 +95,28 @@ export function addCommand(program: Command) { .description('generates the proof etc') .requiredOption('--proposalId ', 'proposalId to generate the proof for') .action((name, options) => { - console.log('simulate', options); + console.log('proof', options); + }); + + govV3 + .command('vote') + .description('vote for or against any given proposal') + .requiredOption('--proposalId ', 'proposalId to vote for') + .option('--for', 'Vote in favour of the proposal') + .option('--against', 'vote against the proposal') + .action(async (name, options) => { + const governance = getGovernance(GovernanceV3Sepolia.GOVERNANCE, sepoliaClient); + const proposalId = BigInt(options.getOptionValue('proposalId')); + const proposal = await governance.governanceContract.read.getProposal([proposalId]); + if (proposal.state !== State.Active) { + throw new Error('can only vote on active proposals'); + } + const voteFor = options.getOptionValue('for'); + const voteAgainst = options.getOptionValue('against'); + if (voteFor && voteAgainst) { + throw new Error('you must either vote --for, or --against'); + } + + logInfo('Vote', 'not yet implemented'); }); } diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index b64b8ca..5968b4e 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -62,7 +62,7 @@ const SLOTS = { PROPOSALS_MAPPING: 7n, }; -enum State { +export enum State { Null, // proposal does not exists Created, // created, waiting for a cooldown to initiate the balances snapshot Active, // balances snapshot set, voting in progress From a0f67661aec5a249d0159c69ce6e928a49b88fd7 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 7 Sep 2023 15:54:49 +0200 Subject: [PATCH 32/94] feat: add initial proof utils --- package.json | 2 +- src/commands/governance-v3.ts | 91 ++++++++++++++------------------ src/simulate/govv3/governance.ts | 46 +++++++++++++--- src/simulate/govv3/proofs.ts | 51 ++++++++++++++++++ src/simulate/govv3/simulate.ts | 2 +- src/utils/rpcClients.ts | 6 ++- src/utils/storageSlots.ts | 6 ++- yarn.lock | 8 +-- 8 files changed, 145 insertions(+), 67 deletions(-) create mode 100644 src/simulate/govv3/proofs.ts diff --git a/package.json b/package.json index 8926aac..51c6c69 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "access": "public" }, "dependencies": { - "@bgd-labs/aave-address-book": "2.3.0", + "@bgd-labs/aave-address-book": "2.3.1-fe0b9ce3f66235f2d3eb88a09531c1afeb68dfbf.0", "@commander-js/extra-typings": "^11.0.0", "bs58": "^5.0.0", "chalk": "^4.1.2", diff --git a/src/commands/governance-v3.ts b/src/commands/governance-v3.ts index 4847cba..191a4f8 100644 --- a/src/commands/governance-v3.ts +++ b/src/commands/governance-v3.ts @@ -1,48 +1,16 @@ import { Command, Option } from '@commander-js/extra-typings'; import { simulateProposal } from '../simulate/govv3/simulate'; -import { GovernanceV3Sepolia } from '@bgd-labs/aave-address-book'; +import { AaveV3Ethereum, GovernanceV3Sepolia, GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; import { State, getGovernance } from '../simulate/govv3/governance'; -import { createPublicClient } from 'viem'; -import { sepoliaClient } from '../utils/rpcClients'; -import { logInfo } from '../utils/logger'; +import { goerliClient, sepoliaClient } from '../utils/rpcClients'; +import { logError, logInfo } from '../utils/logger'; +import { Hex, createWalletClient, http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { VOTING_SLOTS, getProof } from '../simulate/govv3/proofs'; +import { getSolidityStorageSlotAddress } from '../utils/storageSlots'; -export const command = 'governance-v3 [proposalId]'; - -export const describe = 'interact with governance v3'; - -export const builder = (yargs) => - yargs - .option('chainId', { - type: 'number', - describe: 'the chainId to fork', - }) - .option('blockNumber', { - type: 'number', - describe: 'the blocknumber to fork (latest if omitted)', - }) - .option('alias', { - type: 'string', - describe: 'custom alias', - }) - .option('proposalId', { - type: 'number', - describe: 'Proposal or actionSetId', - }) - .option('payloadAddress', { - type: 'string', - describe: 'address of the payload to execute', - }) - .option('executor', { - type: 'string', - describe: '(optional) address of the executor', - }); - -export const handler = async function (argv) { - if (argv.proposalId == undefined) throw new Error('proposalId is required'); - const proposalId = BigInt(argv.proposalId); - const result = await simulateProposal(GovernanceV3Sepolia.GOVERNANCE, proposalId); - // console.log(result); -}; +const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; +const DEFAULT_CLIENT = goerliClient; export function addCommand(program: Command) { const govV3 = program.command('governanceV3').description('interact with governance v3 contracts'); @@ -53,14 +21,18 @@ export function addCommand(program: Command) { .requiredOption('--proposalId ', 'proposalId to simulate via tenderly') .action(async (name, options) => { const proposalId = BigInt(options.getOptionValue('proposalId')); - await simulateProposal(GovernanceV3Sepolia.GOVERNANCE, proposalId); + await simulateProposal(DEFAULT_GOVERNANCE, proposalId); }); govV3 .command('view') .description('shows all the proposals & state') .action(async () => { - const governance = getGovernance(GovernanceV3Sepolia.GOVERNANCE, sepoliaClient, 3962575n); + const governance = getGovernance({ + address: DEFAULT_GOVERNANCE, + publicClient: DEFAULT_CLIENT, + blockCreated: 9640498n, + }); const logs = await governance.cacheLogs(); const count = await governance.governanceContract.read.getProposalsCount(); const proposalIds = [...Array(Number(count)).keys()]; @@ -91,11 +63,27 @@ export function addCommand(program: Command) { }); govV3 - .command('generateProof') - .description('generates the proof etc') + .command('votingProof') + .description('generates the proofs for voting') .requiredOption('--proposalId ', 'proposalId to generate the proof for') - .action((name, options) => { - console.log('proof', options); + .requiredOption('--voter ', 'the address to vote') + .action(async (name, options) => { + const governance = getGovernance({ + address: DEFAULT_GOVERNANCE, + publicClient: DEFAULT_CLIENT, + }); + const proposalId = BigInt(options.getOptionValue('proposalId')); + const voter = options.getOptionValue('voter') as Hex; + + const proposal = await governance.governanceContract.read.getProposal([proposalId]); + + const aaveProof = await getProof( + DEFAULT_CLIENT, + AaveV3Ethereum.ASSETS.AAVE.UNDERLYING, + VOTING_SLOTS[AaveV3Ethereum.ASSETS.AAVE.UNDERLYING].map((slot) => getSolidityStorageSlotAddress(slot, voter)), + proposal.snapshotBlockHash + ); + console.log(aaveProof); }); govV3 @@ -105,7 +93,11 @@ export function addCommand(program: Command) { .option('--for', 'Vote in favour of the proposal') .option('--against', 'vote against the proposal') .action(async (name, options) => { - const governance = getGovernance(GovernanceV3Sepolia.GOVERNANCE, sepoliaClient); + const governance = getGovernance({ + address: DEFAULT_GOVERNANCE, + publicClient: DEFAULT_CLIENT, + walletClient: createWalletClient({ account: '0x0', chain: DEFAULT_CLIENT.chain, transport: http() }), + }); const proposalId = BigInt(options.getOptionValue('proposalId')); const proposal = await governance.governanceContract.read.getProposal([proposalId]); if (proposal.state !== State.Active) { @@ -116,7 +108,6 @@ export function addCommand(program: Command) { if (voteFor && voteAgainst) { throw new Error('you must either vote --for, or --against'); } - - logInfo('Vote', 'not yet implemented'); + logError('TODO', 'not yet implemented'); }); } diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index 5968b4e..23c7a5d 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -3,6 +3,7 @@ import { GetContractReturnType, Hex, PublicClient, + WalletClient, encodeFunctionData, fromHex, getContract, @@ -21,6 +22,7 @@ type CreatedLog = FilterLogWithTimestamp; type ExecutedLog = FilterLogWithTimestamp; type PayloadSentLog = FilterLogWithTimestamp; +type VotingActivatedLog = FilterLogWithTimestamp; export enum ProposalState { Null, // proposal does not exists @@ -33,22 +35,24 @@ export enum ProposalState { Expired, } -export interface Governance { - governanceContract: GetContractReturnType; +export interface Governance { + governanceContract: GetContractReturnType; cacheLogs: () => Promise<{ createdLogs: Array; queuedLogs: Array; executedLogs: Array; payloadSentLogs: Array; + votingActivatedLogs: Array; }>; getProposal: ( proposalId: bigint, - logs: Awaited> + logs: Awaited['cacheLogs']>> ) => Promise<{ proposal: ContractFunctionResult; createdLog: CreatedLog; queuedLog?: QueuedLog; executedLog?: ExecutedLog; + votingActivatedLog?: VotingActivatedLog; payloadSentLog: PayloadSentLog[]; }>; getSimulationPayloadForExecution: (proposalId: bigint) => Promise; @@ -73,8 +77,20 @@ export enum State { Expired, } -export const getGovernance = (address: Hex, publicClient: PublicClient, blockCreated?: bigint): Governance => { - const governanceContract = getContract({ abi: IGovernanceCore_ABI, address, publicClient }); +interface GetGovernanceParams { + address: Hex; + publicClient: PublicClient; + walletClient?: WalletClient; + blockCreated?: bigint; +} + +export const getGovernance = ({ + address, + publicClient, + blockCreated, + walletClient, +}: GetGovernanceParams): Governance => { + const governanceContract = getContract({ abi: IGovernanceCore_ABI, address, publicClient, walletClient }); async function getSimulationPayloadForExecution(proposalId: bigint) { const currentBlock = await publicClient.getBlock(); @@ -171,17 +187,33 @@ export const getGovernance = (address: Hex, publicClient: PublicClient, blockCre }, blockCreated ); - return { createdLogs, queuedLogs, executedLogs, payloadSentLogs }; + const votingActivatedLogs = await getLogs( + publicClient, + (fromBlock, toBlock) => { + return governanceContract.createEventFilter.VotingActivated( + {}, + { + fromBlock: fromBlock, + toBlock, + } + ); + }, + blockCreated + ); + return { createdLogs, queuedLogs, executedLogs, payloadSentLogs, votingActivatedLogs }; }, async getProposal(proposalId, logs) { const proposal = await governanceContract.read.getProposal([proposalId]); const createdLog = logs.createdLogs.find((log) => String(log.args.proposalId) === proposalId.toString())!; + const votingActivatedLog = logs.votingActivatedLogs.find( + (log) => String(log.args.proposalId) === proposalId.toString() + )!; const queuedLog = logs.queuedLogs.find((log) => String(log.args.proposalId) === proposalId.toString()); const executedLog = logs.executedLogs.find((log) => String(log.args.proposalId) === proposalId.toString()); const payloadSentLog = logs.payloadSentLogs.filter( (log) => String(log.args.proposalId) === proposalId.toString() ); - return { proposal, createdLog, queuedLog, executedLog, payloadSentLog }; + return { proposal, createdLog, votingActivatedLog, queuedLog, executedLog, payloadSentLog }; }, getSimulationPayloadForExecution, async simulateProposalExecutionOnTenderly(proposalId, { executedLog }) { diff --git a/src/simulate/govv3/proofs.ts b/src/simulate/govv3/proofs.ts new file mode 100644 index 0000000..23a78b2 --- /dev/null +++ b/src/simulate/govv3/proofs.ts @@ -0,0 +1,51 @@ +import { AaveSafetyModule, AaveV3Ethereum } from '@bgd-labs/aave-address-book'; +import { Block, Hex, PublicClient, toHex, toRlp } from 'viem'; + +const WAREHOUSE_SLOTS = { + [AaveSafetyModule.STK_AAVE]: [ + 81, // exchangeRate + ], +}; + +export const VOTING_SLOTS = { + [AaveSafetyModule.STK_AAVE]: [ + 0, // balance + ], + [AaveV3Ethereum.ASSETS.AAVE.A_TOKEN]: [ + 52, // balance + 64, // delegation + ], + [AaveV3Ethereum.ASSETS.AAVE.UNDERLYING]: [ + 0, // balance + ], +} as const; + +export async function getProof(publicClient: PublicClient, address: Hex, slots: readonly Hex[], blockHash: Hex) { + const block = await publicClient.getBlock({ blockHash }); + return publicClient.request({ method: 'eth_getProof' as any, params: [address, slots, toHex(block.number)] as any }); +} + +// IMPORTANT valid only for post-Shapella blocks, as it includes `withdrawalsRoot` +const prepareBLockRLP = (rawBlock: Block): Hex => { + const rawData = [ + rawBlock.parentHash, + rawBlock.sha3Uncles, + rawBlock.miner, + rawBlock.stateRoot, + rawBlock.transactionsRoot, + rawBlock.receiptsRoot, + rawBlock.logsBloom, + '0x', //toHex(rawBlock.difficulty), + toHex(rawBlock.number || 0), // 0 to account for type null + toHex(rawBlock.gasLimit), + toHex(rawBlock.gasUsed), + toHex(rawBlock.timestamp), + rawBlock.extraData, + rawBlock.mixHash, + rawBlock.nonce, + toHex(rawBlock.baseFeePerGas || 0), // 0 to account for type null + // @ts-ignore looks like this field is not yet added into the type + rawBlock.withdrawalsRoot, + ]; + return toRlp(rawData); +}; diff --git a/src/simulate/govv3/simulate.ts b/src/simulate/govv3/simulate.ts index 03484e7..73663db 100644 --- a/src/simulate/govv3/simulate.ts +++ b/src/simulate/govv3/simulate.ts @@ -28,7 +28,7 @@ const CHAIN_ID_CLIENT_MAP = { export async function simulateProposal(governanceAddress: Hex, proposalId: bigint) { logInfo('General', `Running simulation for ${proposalId}`); - const governance = getGovernance(governanceAddress, sepoliaClient, 3962575n); + const governance = getGovernance({ address: governanceAddress, publicClient: sepoliaClient, blockCreated: 3962575n }); const logs = await governance.cacheLogs(); const proposal = await governance.getProposal(proposalId, logs); const payloads: { diff --git a/src/utils/rpcClients.ts b/src/utils/rpcClients.ts index 435234c..bd193e7 100644 --- a/src/utils/rpcClients.ts +++ b/src/utils/rpcClients.ts @@ -1,6 +1,6 @@ // import 'dotenv/config'; import { createPublicClient, http, fallback } from 'viem'; -import { mainnet, arbitrum, polygon, optimism, metis, base, sepolia } from 'viem/chains'; +import { mainnet, arbitrum, polygon, optimism, metis, base, sepolia, goerli } from 'viem/chains'; export const mainnetClient = createPublicClient({ chain: mainnet, @@ -32,4 +32,6 @@ export const baseClient = createPublicClient({ transport: http(process.env.RPC_BASE), }); -export const sepoliaClient = createPublicClient({ chain: sepolia, transport: http() }); +export const sepoliaClient = createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }); + +export const goerliClient = createPublicClient({ chain: goerli, transport: http(process.env.RPC_GOERLI) }); diff --git a/src/utils/storageSlots.ts b/src/utils/storageSlots.ts index f594ff6..5708402 100644 --- a/src/utils/storageSlots.ts +++ b/src/utils/storageSlots.ts @@ -30,11 +30,13 @@ export function getSolidityStorageSlotBytes(mappingSlot: Hex, key: Hex) { * @returns Storage slot */ export function getSolidityStorageSlotUint(mappingSlot: bigint, key: bigint) { - // this will also work for address types, since address and uints are encoded the same way - // const slot = pad(mappingSlot, { size: 32 }); return keccak256(encodeAbiParameters(parseAbiParameters('uint256, uint256'), [key, mappingSlot])); } +export function getSolidityStorageSlotAddress(mappingSlot: bigint, key: Hex) { + return keccak256(encodeAbiParameters(parseAbiParameters('address, uint256'), [key, mappingSlot])); +} + export function getDynamicArraySlot(baseSlot: bigint, arrayIndex: number, itemSize: number): Hex { return pad( toHex( diff --git a/yarn.lock b/yarn.lock index cc1804a..45de25f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,10 +33,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@bgd-labs/aave-address-book@2.3.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.3.0.tgz#ee937504ca5ec8c7a2d7750cd203aa601d9e04e9" - integrity sha512-P5t94rwHXakJIxtyM0MQWeVFtzkoupGcBcSZnLenRa8dRq1PsDbwDhMtvOMbr94/49Jv6KjTTon+axp158YK6A== +"@bgd-labs/aave-address-book@2.3.1-fe0b9ce3f66235f2d3eb88a09531c1afeb68dfbf.0": + version "2.3.1-fe0b9ce3f66235f2d3eb88a09531c1afeb68dfbf.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.3.1-fe0b9ce3f66235f2d3eb88a09531c1afeb68dfbf.0.tgz#d290d0adf9ca313a7261999095157b5959bf4edc" + integrity sha512-R9k2hcYHj5Y26sHsay36uNDM4+HCECNDDgDYTzKjQLOK+NMir2YjY2YGhf1pgovy6aYLyKzD0GZpRCbtMDOEJw== "@commander-js/extra-typings@^11.0.0": version "11.0.0" From eef58efd42cf3c746f0cd1379bf998306bd432ff Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 7 Sep 2023 16:05:07 +0200 Subject: [PATCH 33/94] fix: proofs --- src/commands/governance-v3.ts | 18 ++++++++++-------- src/simulate/govv3/proofs.ts | 6 +++--- src/utils/storageSlots.ts | 4 ++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/commands/governance-v3.ts b/src/commands/governance-v3.ts index 191a4f8..a31a975 100644 --- a/src/commands/governance-v3.ts +++ b/src/commands/governance-v3.ts @@ -4,7 +4,7 @@ import { AaveV3Ethereum, GovernanceV3Sepolia, GovernanceV3Goerli } from '@bgd-la import { State, getGovernance } from '../simulate/govv3/governance'; import { goerliClient, sepoliaClient } from '../utils/rpcClients'; import { logError, logInfo } from '../utils/logger'; -import { Hex, createWalletClient, http } from 'viem'; +import { Hex, createWalletClient, http, toRlp } from 'viem'; import { sepolia } from 'viem/chains'; import { VOTING_SLOTS, getProof } from '../simulate/govv3/proofs'; import { getSolidityStorageSlotAddress } from '../utils/storageSlots'; @@ -77,13 +77,15 @@ export function addCommand(program: Command) { const proposal = await governance.governanceContract.read.getProposal([proposalId]); - const aaveProof = await getProof( - DEFAULT_CLIENT, - AaveV3Ethereum.ASSETS.AAVE.UNDERLYING, - VOTING_SLOTS[AaveV3Ethereum.ASSETS.AAVE.UNDERLYING].map((slot) => getSolidityStorageSlotAddress(slot, voter)), - proposal.snapshotBlockHash - ); - console.log(aaveProof); + for (const key of Object.keys(VOTING_SLOTS) as (keyof typeof VOTING_SLOTS)[]) { + console.log(key); + const proof = await getProof( + DEFAULT_CLIENT, + key, + VOTING_SLOTS[key].map((slot) => getSolidityStorageSlotAddress(slot, voter)), + proposal.snapshotBlockHash + ); + } }); govV3 diff --git a/src/simulate/govv3/proofs.ts b/src/simulate/govv3/proofs.ts index 23a78b2..f979da6 100644 --- a/src/simulate/govv3/proofs.ts +++ b/src/simulate/govv3/proofs.ts @@ -8,14 +8,14 @@ const WAREHOUSE_SLOTS = { }; export const VOTING_SLOTS = { - [AaveSafetyModule.STK_AAVE]: [ + ['0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' /*AaveSafetyModule.STK_AAVE*/]: [ 0, // balance ], - [AaveV3Ethereum.ASSETS.AAVE.A_TOKEN]: [ + ['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd' /*AaveV3Ethereum.ASSETS.AAVE.A_TOKEN*/]: [ 52, // balance 64, // delegation ], - [AaveV3Ethereum.ASSETS.AAVE.UNDERLYING]: [ + ['0xb6D88BfC5b145a558b279cf7692e6F02064889d0' /*AaveV3Ethereum.ASSETS.AAVE.UNDERLYING*/]: [ 0, // balance ], } as const; diff --git a/src/utils/storageSlots.ts b/src/utils/storageSlots.ts index 5708402..b96d261 100644 --- a/src/utils/storageSlots.ts +++ b/src/utils/storageSlots.ts @@ -33,8 +33,8 @@ export function getSolidityStorageSlotUint(mappingSlot: bigint, key: bigint) { return keccak256(encodeAbiParameters(parseAbiParameters('uint256, uint256'), [key, mappingSlot])); } -export function getSolidityStorageSlotAddress(mappingSlot: bigint, key: Hex) { - return keccak256(encodeAbiParameters(parseAbiParameters('address, uint256'), [key, mappingSlot])); +export function getSolidityStorageSlotAddress(mappingSlot: bigint | number, key: Hex) { + return keccak256(encodeAbiParameters(parseAbiParameters('address, uint256'), [key, BigInt(mappingSlot)])); } export function getDynamicArraySlot(baseSlot: bigint, arrayIndex: number, itemSize: number): Hex { From 53a605ea8d629e658918833c3ad3265efc441c3e Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 7 Sep 2023 16:31:09 +0200 Subject: [PATCH 34/94] fix: refactor diff snapshots --- src/cli.ts | 3 +- src/commands/diff-snaphots.ts | 54 ++++++++++++++--------------------- src/commands/governance-v3.ts | 11 ++++--- 3 files changed, 29 insertions(+), 39 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index a72b954..64c3dfc 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -4,7 +4,7 @@ import { Command } from '@commander-js/extra-typings'; import yargs from 'yargs/yargs'; import { hideBin } from 'yargs/helpers'; import * as ipfsCmd from './commands/ipfs-upload'; -import * as diffSnapshot from './commands/diff-snaphots'; +import { addCommand as addDiffSnapshots } from './commands/diff-snaphots'; import * as simulateProposal from './commands/simulate-proposal'; import { addCommand as addGovernanceV3 } from './commands/governance-v3'; import * as fork from './commands/fork'; @@ -21,5 +21,6 @@ const program = new Command(); program.name('aave-cli').description('CLI to interact with the aave ecosystem').version('0.0.0').showHelpAfterError(); addGovernanceV3(program); +addDiffSnapshots(program); program.parse(); diff --git a/src/commands/diff-snaphots.ts b/src/commands/diff-snaphots.ts index dff828f..40ff7d8 100644 --- a/src/commands/diff-snaphots.ts +++ b/src/commands/diff-snaphots.ts @@ -1,34 +1,24 @@ -import { diffReports } from "../reports/diff-reports"; -import { readJsonString, readJsonFile } from "../utils/json"; -import fs from "fs"; +import { Command } from '@commander-js/extra-typings'; +import { diffReports } from '../reports/diff-reports'; +import { readJsonString, readJsonFile } from '../utils/json'; +import fs from 'fs'; -export const command = "diff-snapshots [from] [to]"; - -export const describe = - "diffs two json snapshots and generates a markdown report"; - -export const builder = (yargs) => - yargs - .option("out", { - type: "string", - describe: "output path", - alias: "o", - }) - .option("stringMode", { - type: "boolean", - describe: "assumes in/out to be string instead of files", - default: false, +export function addCommand(program: Command) { + program + .command('diff-snapshots') + .description('generate a snapshot diff report') + .argument('') + .argument('') + .option('-o, --out ', 'output path') + .option('--stringMode', 'expects input to be a string, not paths') + .action(async (_from, _to, options) => { + const from = options.stringMode ? readJsonString(_from) : readJsonFile(_from); + const to = options.stringMode ? readJsonString(_to) : readJsonFile(_to); + const content = await diffReports(from, to); + if (options.out) { + fs.writeFileSync(options.out, content); + } else { + console.log(content); + } }); - -export const handler = async function (argv) { - const from = argv.stringMode - ? readJsonString(argv.from) - : readJsonFile(argv.from); - const to = argv.stringMode ? readJsonString(argv.to) : readJsonFile(argv.to); - const content = await diffReports(from, to); - if (argv.out) { - fs.writeFileSync(argv.out, content); - } else { - console.log(content); - } -}; +} diff --git a/src/commands/governance-v3.ts b/src/commands/governance-v3.ts index a31a975..e0d55b3 100644 --- a/src/commands/governance-v3.ts +++ b/src/commands/governance-v3.ts @@ -1,11 +1,10 @@ -import { Command, Option } from '@commander-js/extra-typings'; +import { Command } from '@commander-js/extra-typings'; import { simulateProposal } from '../simulate/govv3/simulate'; -import { AaveV3Ethereum, GovernanceV3Sepolia, GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; +import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; import { State, getGovernance } from '../simulate/govv3/governance'; -import { goerliClient, sepoliaClient } from '../utils/rpcClients'; +import { goerliClient } from '../utils/rpcClients'; import { logError, logInfo } from '../utils/logger'; -import { Hex, createWalletClient, http, toRlp } from 'viem'; -import { sepolia } from 'viem/chains'; +import { Hex, createWalletClient, http } from 'viem'; import { VOTING_SLOTS, getProof } from '../simulate/govv3/proofs'; import { getSolidityStorageSlotAddress } from '../utils/storageSlots'; @@ -63,7 +62,7 @@ export function addCommand(program: Command) { }); govV3 - .command('votingProof') + .command('votingProofs') .description('generates the proofs for voting') .requiredOption('--proposalId ', 'proposalId to generate the proof for') .requiredOption('--voter ', 'the address to vote') From 8e38663e82b9edbd202bc28dc1672136663a7fa7 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 7 Sep 2023 17:16:51 +0200 Subject: [PATCH 35/94] fix: add some comments --- src/commands/governance-v3.ts | 16 ++++++++++++++-- src/simulate/govv3/proofs.ts | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/commands/governance-v3.ts b/src/commands/governance-v3.ts index e0d55b3..b50c965 100644 --- a/src/commands/governance-v3.ts +++ b/src/commands/governance-v3.ts @@ -61,8 +61,16 @@ export function addCommand(program: Command) { } }); + /** + * + */ + govV3.command('getRoots'); + + /** + * TODO: TODO + */ govV3 - .command('votingProofs') + .command('getVotingProofs') .description('generates the proofs for voting') .requiredOption('--proposalId ', 'proposalId to generate the proof for') .requiredOption('--voter ', 'the address to vote') @@ -77,13 +85,16 @@ export function addCommand(program: Command) { const proposal = await governance.governanceContract.read.getProposal([proposalId]); for (const key of Object.keys(VOTING_SLOTS) as (keyof typeof VOTING_SLOTS)[]) { - console.log(key); const proof = await getProof( DEFAULT_CLIENT, key, VOTING_SLOTS[key].map((slot) => getSolidityStorageSlotAddress(slot, voter)), proposal.snapshotBlockHash ); + console.log(proof); + // TODO: prepare for etherscan / encode data for fields + // pint link to etherscan + // print summary } }); @@ -109,6 +120,7 @@ export function addCommand(program: Command) { if (voteFor && voteAgainst) { throw new Error('you must either vote --for, or --against'); } + // perhaps makes sense to show encoded data to vote? logError('TODO', 'not yet implemented'); }); } diff --git a/src/simulate/govv3/proofs.ts b/src/simulate/govv3/proofs.ts index f979da6..ffbc4b7 100644 --- a/src/simulate/govv3/proofs.ts +++ b/src/simulate/govv3/proofs.ts @@ -1,11 +1,11 @@ import { AaveSafetyModule, AaveV3Ethereum } from '@bgd-labs/aave-address-book'; import { Block, Hex, PublicClient, toHex, toRlp } from 'viem'; -const WAREHOUSE_SLOTS = { +export const WAREHOUSE_SLOTS = { [AaveSafetyModule.STK_AAVE]: [ 81, // exchangeRate ], -}; +} as const; export const VOTING_SLOTS = { ['0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' /*AaveSafetyModule.STK_AAVE*/]: [ From 74971e6f39f99943d056f85d5064e0efa1b8d750 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 11 Sep 2023 09:40:32 +0200 Subject: [PATCH 36/94] fix: refactor governance commands --- src/commands/governance-v3.ts | 19 ++----------------- src/simulate/govv3/governance.ts | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/commands/governance-v3.ts b/src/commands/governance-v3.ts index b50c965..89ce15d 100644 --- a/src/commands/governance-v3.ts +++ b/src/commands/governance-v3.ts @@ -4,9 +4,7 @@ import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; import { State, getGovernance } from '../simulate/govv3/governance'; import { goerliClient } from '../utils/rpcClients'; import { logError, logInfo } from '../utils/logger'; -import { Hex, createWalletClient, http } from 'viem'; -import { VOTING_SLOTS, getProof } from '../simulate/govv3/proofs'; -import { getSolidityStorageSlotAddress } from '../utils/storageSlots'; +import { Hex, createWalletClient, encodeAbiParameters, getContract, http } from 'viem'; const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; const DEFAULT_CLIENT = goerliClient; @@ -82,20 +80,7 @@ export function addCommand(program: Command) { const proposalId = BigInt(options.getOptionValue('proposalId')); const voter = options.getOptionValue('voter') as Hex; - const proposal = await governance.governanceContract.read.getProposal([proposalId]); - - for (const key of Object.keys(VOTING_SLOTS) as (keyof typeof VOTING_SLOTS)[]) { - const proof = await getProof( - DEFAULT_CLIENT, - key, - VOTING_SLOTS[key].map((slot) => getSolidityStorageSlotAddress(slot, voter)), - proposal.snapshotBlockHash - ); - console.log(proof); - // TODO: prepare for etherscan / encode data for fields - // pint link to etherscan - // print summary - } + const proofs = await governance.getVotingProofs(proposalId, voter); }); govV3 diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index 23c7a5d..ae9bf06 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -15,8 +15,9 @@ import { getLogs } from '../../utils/logs'; import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book'; import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../../utils/tenderlyClient'; import { EOA } from '../../utils/constants'; -import { getSolidityStorageSlotUint } from '../../utils/storageSlots'; +import { getSolidityStorageSlotAddress, getSolidityStorageSlotUint } from '../../utils/storageSlots'; import { setBits } from './utils/solidityUtils'; +import { VOTING_SLOTS, getProof } from './proofs'; type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; @@ -60,6 +61,13 @@ export interface Governance { proposalId: bigint, params: { executedLog?: ExecutedLog } ) => Promise; + /** + * Returns the proofs that are non-zero for a specified address + * @param proposalId + * @param voter + */ + getVotingProofs: (proposalId: bigint, voter: Hex) => any; + getRoots: (proposalId: bigint) => any; } const SLOTS = { @@ -225,5 +233,20 @@ export const getGovernance = ({ const payload = await getSimulationPayloadForExecution(proposalId); return tenderly.simulate(payload); }, + async getVotingProofs(proposalId: bigint, voter: Hex) { + const proposal = await governanceContract.read.getProposal([proposalId]); + + const proofs = (await Promise.all(Object.keys(VOTING_SLOTS) as (keyof typeof VOTING_SLOTS)[])).map((key) => { + getProof( + publicClient, + key, + VOTING_SLOTS[key].map((slot) => getSolidityStorageSlotAddress(slot, voter)), + proposal.snapshotBlockHash + ); + }); + + return proofs; + }, + async getRoots(proposalId: bigint) {}, }; }; From b9d41090530ffdd060f56dd7420434324391cc48 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 11 Sep 2023 10:41:04 +0200 Subject: [PATCH 37/94] feat: gov v3 --- src/commands/governance-v3.ts | 66 +++++++++++++++++++++++++------- src/simulate/govv3/governance.ts | 48 ++++++++++++++++++----- 2 files changed, 90 insertions(+), 24 deletions(-) diff --git a/src/commands/governance-v3.ts b/src/commands/governance-v3.ts index 89ce15d..450e9b2 100644 --- a/src/commands/governance-v3.ts +++ b/src/commands/governance-v3.ts @@ -1,7 +1,7 @@ import { Command } from '@commander-js/extra-typings'; import { simulateProposal } from '../simulate/govv3/simulate'; import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; -import { State, getGovernance } from '../simulate/govv3/governance'; +import { HUMAN_READABLE_STATE, State, getGovernance } from '../simulate/govv3/governance'; import { goerliClient } from '../utils/rpcClients'; import { logError, logInfo } from '../utils/logger'; import { Hex, createWalletClient, encodeAbiParameters, getContract, http } from 'viem'; @@ -34,38 +34,76 @@ export function addCommand(program: Command) { const count = await governance.governanceContract.read.getProposalsCount(); const proposalIds = [...Array(Number(count)).keys()]; for (const proposalId of proposalIds) { - const { createdLog, executedLog, payloadSentLog, queuedLog, proposal } = await governance.getProposal( - BigInt(proposalId), - logs - ); + const { createdLog, executedLog, payloadSentLog, votingActivatedLog, queuedLog, proposal } = + await governance.getProposal(BigInt(proposalId), logs); logInfo( `Proposal ${proposalId}`, - `Proposal created on ${new Date(createdLog.timestamp * 1000).toLocaleString()}` + `### Proposal ${proposalId} Summary ###\n` + + `State: ${HUMAN_READABLE_STATE[proposal.state as keyof typeof HUMAN_READABLE_STATE]}\n` + + `For Votes: ${proposal.forVotes}\n` + + `Against Votes: ${proposal.againstVotes}\n` + + `Creator: ${proposal.creator}\n` + + `Payloads: ${JSON.stringify( + proposal.payloads, + (key, value) => (typeof value === 'bigint' ? value.toString() : value), + 2 + )}` + ); + logInfo( + `Proposal ${proposalId} log`, + `${new Date(createdLog.timestamp * 1000).toLocaleString()} Proposal created` ); + if (votingActivatedLog) { + logInfo( + `Proposal ${proposalId} log`, + `${new Date(votingActivatedLog.timestamp * 1000).toLocaleString()} Voting activated` + ); + } if (queuedLog) { logInfo( - `Proposal ${proposalId}`, - `Proposal was queued with final votes of ${queuedLog.args.votesFor} to ${ - queuedLog.args.votesAgainst - } on ${new Date(queuedLog.timestamp * 1000).toLocaleString()}` + `Proposal ${proposalId} log`, + `${new Date(queuedLog.timestamp * 1000).toLocaleString()} Proposal queued` ); } if (executedLog) { logInfo( - `Proposal ${proposalId}`, - `Proposal was executed on ${new Date(executedLog.timestamp * 1000).toLocaleString()}` + `Proposal ${proposalId} log`, + `${new Date(executedLog.timestamp * 1000).toLocaleString()} Proposal executed` ); } + if (payloadSentLog) { + payloadSentLog.map((log) => { + logInfo( + `Proposal ${proposalId} log`, + `${new Date(log.timestamp * 1000).toLocaleString()} Payload ${log.args.payloadId}:${ + log.args.payloadsController + } sent to chainId:${log.args.chainId}` + ); + }); + } + console.log(`\n`); } }); /** * */ - govV3.command('getRoots'); + govV3 + .command('getWarehouseRoots') + .description('generate the roots for the warehouse') + .requiredOption('--proposalId ', 'proposalId to generate the proof for') + .action(async (name, options) => { + const governance = getGovernance({ + address: DEFAULT_GOVERNANCE, + publicClient: DEFAULT_CLIENT, + }); + const proposalId = BigInt(options.getOptionValue('proposalId')); + + const proofs = await governance.getRoots(proposalId); + }); /** - * TODO: TODO + * */ govV3 .command('getVotingProofs') diff --git a/src/simulate/govv3/governance.ts b/src/simulate/govv3/governance.ts index ae9bf06..9065036 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/simulate/govv3/governance.ts @@ -17,7 +17,7 @@ import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../../uti import { EOA } from '../../utils/constants'; import { getSolidityStorageSlotAddress, getSolidityStorageSlotUint } from '../../utils/storageSlots'; import { setBits } from './utils/solidityUtils'; -import { VOTING_SLOTS, getProof } from './proofs'; +import { VOTING_SLOTS, WAREHOUSE_SLOTS, getProof } from './proofs'; type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; @@ -85,6 +85,17 @@ export enum State { Expired, } +export const HUMAN_READABLE_STATE = { + [State.Null]: 'Null', + [State.Created]: 'Created', + [State.Active]: 'Active', + [State.Queued]: 'Queued', + [State.Executed]: 'Executed', + [State.Failed]: 'Failed', + [State.Cancelled]: 'Cancelled', + [State.Expired]: 'Expired', +}; + interface GetGovernanceParams { address: Hex; publicClient: PublicClient; @@ -236,17 +247,34 @@ export const getGovernance = ({ async getVotingProofs(proposalId: bigint, voter: Hex) { const proposal = await governanceContract.read.getProposal([proposalId]); - const proofs = (await Promise.all(Object.keys(VOTING_SLOTS) as (keyof typeof VOTING_SLOTS)[])).map((key) => { - getProof( - publicClient, - key, - VOTING_SLOTS[key].map((slot) => getSolidityStorageSlotAddress(slot, voter)), - proposal.snapshotBlockHash - ); - }); + const proofs = await Promise.all( + (Object.keys(VOTING_SLOTS) as (keyof typeof VOTING_SLOTS)[]).map((key) => + getProof( + publicClient, + key, + VOTING_SLOTS[key].map((slot) => getSolidityStorageSlotAddress(slot, voter)), + proposal.snapshotBlockHash + ) + ) + ); + + return proofs; + }, + async getRoots(proposalId: bigint) { + const proposal = await governanceContract.read.getProposal([proposalId]); + + const proofs = await Promise.all( + (Object.keys(WAREHOUSE_SLOTS) as (keyof typeof WAREHOUSE_SLOTS)[]).map((key) => + getProof( + publicClient, + key, + WAREHOUSE_SLOTS[key].map((slot) => toHex(slot)), + proposal.snapshotBlockHash + ) + ) + ); return proofs; }, - async getRoots(proposalId: bigint) {}, }; }; From b9f43f747719e444e1e902ba003b089a42724fc2 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 11 Sep 2023 10:45:38 +0200 Subject: [PATCH 38/94] fix: test fix --- src/simulate/govv3/utils/solidityUtils.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/simulate/govv3/utils/solidityUtils.spec.ts b/src/simulate/govv3/utils/solidityUtils.spec.ts index 703af6a..8ed929d 100644 --- a/src/simulate/govv3/utils/solidityUtils.spec.ts +++ b/src/simulate/govv3/utils/solidityUtils.spec.ts @@ -3,9 +3,9 @@ import { setBits } from './solidityUtils'; describe('solidityUtils', () => { it('setBits', async () => { - expect(setBits('0b11', 1n, 2n, 0n)).toBe('1'); - expect(setBits('0b111', 1n, 2n, 0n)).toBe('5'); - expect(setBits('0b111', 1n, 3n, 0n)).toBe('1'); - expect(setBits('0b111', 0n, 3n, 0n)).toBe('0'); + expect(setBits('0b11', 1n, 2n, 0n)).toBe(1n); + expect(setBits('0b111', 1n, 2n, 0n)).toBe(5n); + expect(setBits('0b111', 1n, 3n, 0n)).toBe(1n); + expect(setBits('0b111', 0n, 3n, 0n)).toBe(0n); }); }); From b0739103520a51f0edc0c6ae83641999836ee165 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Mon, 11 Sep 2023 14:07:49 +0200 Subject: [PATCH 39/94] feat: add npmrc --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..aaccf12 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.6.1 \ No newline at end of file From 0aa19037c99fbdc8a0393e66176920e1e87153db Mon Sep 17 00:00:00 2001 From: sakulstra Date: Mon, 11 Sep 2023 22:56:02 +0200 Subject: [PATCH 40/94] feat: fully migrate ci --- src/cli.ts | 21 +-- src/commands/fork.ts | 172 +++++++----------- .../{governance-v3.ts => governance.ts} | 2 +- src/commands/ipfs-upload.ts | 62 +++---- src/commands/simulate-proposal.ts | 18 -- src/utils/rpcClients.ts | 11 ++ 6 files changed, 105 insertions(+), 181 deletions(-) rename src/commands/{governance-v3.ts => governance.ts} (98%) delete mode 100644 src/commands/simulate-proposal.ts diff --git a/src/cli.ts b/src/cli.ts index 64c3dfc..e05bd63 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,26 +1,17 @@ #!/usr/bin/env node import 'dotenv/config'; import { Command } from '@commander-js/extra-typings'; -import yargs from 'yargs/yargs'; -import { hideBin } from 'yargs/helpers'; -import * as ipfsCmd from './commands/ipfs-upload'; +import { addCommand as addIpfsCommand } from './commands/ipfs-upload'; import { addCommand as addDiffSnapshots } from './commands/diff-snaphots'; -import * as simulateProposal from './commands/simulate-proposal'; -import { addCommand as addGovernanceV3 } from './commands/governance-v3'; -import * as fork from './commands/fork'; - -// yargs(hideBin(process.argv)) -// .command(ipfsCmd) -// .command(diffSnapshot) -// .command(simulateProposal) -// .command(fork) -// .command(governanceV3) -// .demandCommand().argv; +import { addCommand as addGovernance } from './commands/governance'; +import { addCommand as addFork } from './commands/fork'; const program = new Command(); program.name('aave-cli').description('CLI to interact with the aave ecosystem').version('0.0.0').showHelpAfterError(); -addGovernanceV3(program); +addGovernance(program); addDiffSnapshots(program); +addFork(program); +addIpfsCommand(program); program.parse(); diff --git a/src/commands/fork.ts b/src/commands/fork.ts index 08a8aa1..def14fd 100644 --- a/src/commands/fork.ts +++ b/src/commands/fork.ts @@ -1,115 +1,67 @@ -import { arbitrum, base, mainnet, optimism, polygon } from 'viem/chains'; -import { - getProposalStateById, - getTenderlyActionSetCreationPayload, - getTenderlyActionSetExecutionPayload, -} from '../simulate/govv2/networks/commonL2'; -import { polygonExecutorContract } from '../simulate/govv2/networks/polygon'; -import { arbitrumClient, baseClient, optimismClient, polygonClient } from '../utils/rpcClients'; +import { Command } from '@commander-js/extra-typings'; import { tenderly } from '../utils/tenderlyClient'; -import { arbitrumExecutorContract } from '../simulate/govv2/networks/arbitrum'; -import { optimismExecutorContract } from '../simulate/govv2/networks/optimism'; -import { polygon as modulePolygon } from '../simulate/govv2/networks/polygon'; -import { arbitrum as moduleArbitrum } from '../simulate/govv2/networks/arbitrum'; -import { optimism as moduleOptimism } from '../simulate/govv2/networks/optimism'; -import { base as moduleBase } from '../simulate/govv2/networks/base'; -import { ActionSetState } from '../simulate/govv2/networks/types'; -import { baseExecutorContract } from '../simulate/govv2/networks/base'; +import { getGovernance } from '../simulate/govv3/governance'; +import { GovernanceV3Ethereum } from '@bgd-labs/aave-address-book'; +import { RPC_MAP, mainnetClient } from '../utils/rpcClients'; +import { getPayloadsController } from '../simulate/govv3/payloadsController'; +import { Hex, PublicClient } from 'viem'; -export type ForkOptions = { - chainId: number; - alias: string; - blockNumber?: number; - proposalId?: number; - payloadAddress?: string; - executor?: string; -}; - -export const command = 'fork'; - -export const describe = 'creates a tenderly fork'; - -export const builder = (yargs) => - yargs - .option('chainId', { - type: 'number', - describe: 'the chainId to fork', - }) - .option('blockNumber', { - type: 'number', - describe: 'the blocknumber to fork (latest if omitted)', - }) - .option('alias', { - type: 'string', - describe: 'custom alias', - }) - .option('proposalId', { - type: 'number', - describe: 'Proposal or actionSetId', - }) - .option('payloadAddress', { - type: 'string', - describe: 'address of the payload to execute', - }) - .option('executor', { - type: 'string', - describe: '(optional) address of the executor', - }); - -const getL2 = (chainId: number) => { - if (chainId === polygon.id) return [polygonExecutorContract, polygonClient, modulePolygon] as const; - if (chainId === arbitrum.id) return [arbitrumExecutorContract, arbitrumClient, moduleArbitrum] as const; - if (chainId === optimism.id) return [optimismExecutorContract, optimismClient, moduleOptimism] as const; - if (chainId === base.id) return [baseExecutorContract, baseClient, moduleBase] as const; - throw new Error(`ChainId: ${chainId} not supported`); -}; - -function getAlias(options: ForkOptions) { - const unix = Math.floor(new Date().getTime() / 1000); - if (options.alias) { - return `${unix}-${options.alias}`; - } else if (options.proposalId) { - return `${unix}-proposalId-${options.proposalId}`; - } else if (options.payloadAddress) { - return `${unix}-payloadAddress-${options.payloadAddress}`; - } - // } else if (options.artifactPath) { - // return `${unix}-artifact-${options.artifactPath.replace(/^.*[\\\/]/, '')}`; - // } - return 'vanilla-fork'; -} +export function addCommand(program: Command) { + program + .command('fork') + .description('generates a fork (optionally with a proposal executeds') + .requiredOption('--chainId ', 'the chainId to fork offs') + .option('--blockNumber ', 'the blocknumber to fork of (latest if omitted)') + .option('--alias ', 'Set a custom alias') + .option('--proposalId ', 'ProposalId to execute') + .option('--payloadId ', 'PayloadId to execute') + .option('--payloadsController ', 'PayloadsController address') + .action(async (options) => { + const { + chainId, + blockNumber, + alias, + payloadId, + proposalId, + payloadsController: payloadsControllerAddress, + } = options; + function getAlias() { + const unix = Math.floor(new Date().getTime() / 1000); + if (options.alias) { + return `${unix}-${options.alias}`; + } else if (options.proposalId) { + return `${unix}-proposalId-${options.proposalId}`; + } else if (options.payloadId) { + return `${unix}-payloadAddress-${options.payloadId}`; + } + return 'vanilla-fork'; + } -export const handler = async function (argv) { - const forkConfig = { - chainId: argv.chainId, - alias: getAlias(argv), - }; - if (argv.chainId === mainnet.id) { - throw new Error('Mainnet proposal forking not yet supported'); - } else { - const [executor, client, networkModule] = getL2(argv.chainId); - if (argv.proposalId) { - const { executedLogs, queuedLogs } = await networkModule.cacheLogs(); - const response = await getProposalStateById({ proposalId: argv.proposalId, executedLogs, queuedLogs }); - if (response.state === ActionSetState.NOT_FOUND) { - throw new Error(`ActionSet ${argv.proposalId} not found`); - } else if (response.state === ActionSetState.EXECUTED) { - throw new Error(`ActionSet ${argv.proposalId} already executed`); - } else { - const payload = await getTenderlyActionSetExecutionPayload(executor, client, response.queuedLog); - const fork = await tenderly.fork({ ...forkConfig, blockNumber: payload.block_number }); + const forkConfig = { + chainId: Number(chainId), + alias: getAlias(), + blockNumber: Number(blockNumber), + }; + const governance = getGovernance({ address: GovernanceV3Ethereum.GOVERNANCE, publicClient: mainnetClient }); + if (proposalId) { + const payload = await governance.getSimulationPayloadForExecution(BigInt(proposalId)); + const fork = await tenderly.fork({ + ...forkConfig, + blockNumber: forkConfig.blockNumber || payload.block_number, + }); + await tenderly.unwrapAndExecuteSimulationPayloadOnFork(fork, payload); + } else if (payloadId) { + if (!payloadsControllerAddress) throw new Error('you need to provide a payloadsController'); + const payloadsController = getPayloadsController( + payloadsControllerAddress as Hex, + RPC_MAP[forkConfig.chainId as keyof typeof RPC_MAP] as PublicClient + ); + const payload = await payloadsController.getSimulationPayloadForExecution(Number(payloadId)); + const fork = await tenderly.fork({ + ...forkConfig, + blockNumber: forkConfig.blockNumber || payload.block_number, + }); await tenderly.unwrapAndExecuteSimulationPayloadOnFork(fork, payload); } - } else if (argv.payloadAddress) { - const payload = await getTenderlyActionSetCreationPayload(executor, client, { - calldatas: ['0x0'], - signatures: ['execute()'], - targets: [argv.payloadAddress], - values: [0n], - withDelegatecalls: [true], - }); - const fork = await tenderly.fork(forkConfig); - await tenderly.unwrapAndExecuteSimulationPayloadOnFork(fork, payload); - } - } -}; + }); +} diff --git a/src/commands/governance-v3.ts b/src/commands/governance.ts similarity index 98% rename from src/commands/governance-v3.ts rename to src/commands/governance.ts index 450e9b2..1379978 100644 --- a/src/commands/governance-v3.ts +++ b/src/commands/governance.ts @@ -10,7 +10,7 @@ const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; const DEFAULT_CLIENT = goerliClient; export function addCommand(program: Command) { - const govV3 = program.command('governanceV3').description('interact with governance v3 contracts'); + const govV3 = program.command('governance').description('interact with governance v3 contracts'); govV3 .command('simulate') diff --git a/src/commands/ipfs-upload.ts b/src/commands/ipfs-upload.ts index 6fe7c87..c7ea7c0 100644 --- a/src/commands/ipfs-upload.ts +++ b/src/commands/ipfs-upload.ts @@ -3,6 +3,7 @@ import path from 'path'; import Hash from 'ipfs-only-hash'; import bs58 from 'bs58'; import { validateAIPHeader } from '../ipfs/aip-validation'; +import { Command } from '@commander-js/extra-typings'; // https://ethereum.stackexchange.com/questions/44506/ipfs-hash-algorithm async function getHash(data: string) { @@ -45,43 +46,30 @@ async function uploadToTheGraph(source: string) { return await res.json(); } -export const command = 'ipfs '; +export function addCommand(program: Command) { + program + .command('ipfs') + .description('generates the ipfs hash for specified source') + .argument('') + .option('-u, --upload') + .option('--verbose') + .action(async (source, { upload, verbose }) => { + const filePath = path.join(process.cwd(), source); + const content = fs.readFileSync(filePath, 'utf8'); + validateAIPHeader(content); -export const describe = 'generates the ipfs hash for specified source'; + const hash = await getHash(content); + const bs58Hash = `0x${Buffer.from(bs58.decode(hash)).slice(2).toString('hex')}`; -export const builder = (yargs) => - yargs - // .positional('source', { - // describe: 'path to the source', - // type: 'string', - // }) - .option('upload', { - describe: 'upload to ipfs', - default: false, - alias: 'u', - type: 'boolean', - }) - .option('verbose', { - default: false, - type: 'boolean', - }); - -export const handler = async function (argv) { - const filePath = path.join(process.cwd(), argv.source); - const content = fs.readFileSync(filePath, 'utf8'); - validateAIPHeader(content); + if (upload) { + const [pinata, thegraph] = await Promise.all([uploadToPinata(content), uploadToTheGraph(content)]); + if (verbose) { + console.log('pinata response', pinata); + console.log('thegraph response', thegraph); + } + } - const hash = await getHash(content); - const bs58Hash = `0x${Buffer.from(bs58.decode(hash)).slice(2).toString('hex')}`; - - if (argv.upload) { - const [pinata, thegraph] = await Promise.all([uploadToPinata(content), uploadToTheGraph(content)]); - if (argv.verbose) { - console.log('pinata response', pinata); - console.log('thegraph response', thegraph); - } - } - - // log as hex to console so foundry can read the content - console.log(bs58Hash); -}; + // log as hex to console so foundry can read the content + console.log(bs58Hash); + }); +} diff --git a/src/commands/simulate-proposal.ts b/src/commands/simulate-proposal.ts deleted file mode 100644 index 6273bfc..0000000 --- a/src/commands/simulate-proposal.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { simulateProposal } from '../simulate/govv2/simulate'; - -export const command = 'simulate-proposal [proposalId]'; - -export const describe = 'simulates a aave v2 governance proposal'; - -export const builder = (yargs) => - yargs.option('chainId', { - type: 'string', - describe: 'TODO: implement', - }); - -export const handler = async function (argv) { - if (argv.proposalId == undefined) throw new Error('proposalId is required'); - const proposalId = BigInt(argv.proposalId); - const result = await simulateProposal(proposalId); - // console.log(result); -}; diff --git a/src/utils/rpcClients.ts b/src/utils/rpcClients.ts index bd193e7..63729fe 100644 --- a/src/utils/rpcClients.ts +++ b/src/utils/rpcClients.ts @@ -35,3 +35,14 @@ export const baseClient = createPublicClient({ export const sepoliaClient = createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }); export const goerliClient = createPublicClient({ chain: goerli, transport: http(process.env.RPC_GOERLI) }); + +export const RPC_MAP = { + [mainnet.id]: mainnetClient, + [arbitrum.id]: arbitrumClient, + [polygon.id]: polygonClient, + [optimism.id]: optimismClient, + [metis.id]: metisClient, + [base.id]: baseClient, + [sepolia.id]: sepoliaClient, + [goerli.id]: goerliClient, +} as const; From 41fb3fe0d5c180305da691d78280a317b6ba1d3e Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 09:44:18 +0200 Subject: [PATCH 41/94] fix: remove gov v2 --- src/commands/fork.ts | 4 +- src/commands/governance.ts | 4 +- src/{simulate => }/govv3/abis/ERC20.ts | 0 src/{simulate => }/govv3/checks/logs.ts | 2 +- .../govv3/checks/selfDestruct.ts | 0 .../govv3/checks/targets-verified.ts | 2 +- src/{simulate => }/govv3/checks/types.ts | 2 +- .../govv3/generatePayloadReport.ts | 2 +- src/{simulate => }/govv3/governance.ts | 38 +- .../govv3/payloadsController.ts | 9 +- src/{simulate => }/govv3/proofs.ts | 0 src/{simulate => }/govv3/simulate.ts | 6 +- .../govv3/utils/markdownUtils.ts | 0 .../govv3/utils/solidityUtils.spec.ts | 0 .../govv3/utils/solidityUtils.ts | 2 +- .../govv3/utils/stateDiffInterpreter.ts | 0 .../govv3/utils/tenderlyDeepDiff.ts | 0 src/index.ts | 10 +- src/simulate/govv2/abis/AaveGovernanceV2.ts | 72 --- .../govv2/abis/ArbitrumBridgeExecutor.ts | 423 ---------------- src/simulate/govv2/abis/ArcTimelock.ts | 267 ---------- src/simulate/govv2/abis/Executor.ts | 468 ------------------ .../govv2/abis/MetisBridgeExecutor.ts | 340 ------------- .../govv2/abis/OptimismBridgeExecutor.ts | 421 ---------------- .../govv2/abis/PolygonBridgeExecutor.ts | 462 ----------------- src/simulate/govv2/networks/arbitrum.ts | 75 --- src/simulate/govv2/networks/base.ts | 76 --- src/simulate/govv2/networks/commonL2.ts | 347 ------------- src/simulate/govv2/networks/mainnet.ts | 231 --------- src/simulate/govv2/networks/metis.ts | 137 ----- src/simulate/govv2/networks/optimism.ts | 75 --- src/simulate/govv2/networks/polygon.ts | 90 ---- src/simulate/govv2/networks/types.ts | 113 ----- src/simulate/govv2/simulate.ts | 67 --- src/utils/logs.ts | 9 +- 35 files changed, 41 insertions(+), 3713 deletions(-) rename src/{simulate => }/govv3/abis/ERC20.ts (100%) rename src/{simulate => }/govv3/checks/logs.ts (96%) rename src/{simulate => }/govv3/checks/selfDestruct.ts (100%) rename src/{simulate => }/govv3/checks/targets-verified.ts (97%) rename src/{simulate => }/govv3/checks/types.ts (85%) rename src/{simulate => }/govv3/generatePayloadReport.ts (98%) rename src/{simulate => }/govv3/governance.ts (89%) rename src/{simulate => }/govv3/payloadsController.ts (95%) rename src/{simulate => }/govv3/proofs.ts (100%) rename src/{simulate => }/govv3/simulate.ts (93%) rename src/{simulate => }/govv3/utils/markdownUtils.ts (100%) rename src/{simulate => }/govv3/utils/solidityUtils.spec.ts (100%) rename src/{simulate => }/govv3/utils/solidityUtils.ts (97%) rename src/{simulate => }/govv3/utils/stateDiffInterpreter.ts (100%) rename src/{simulate => }/govv3/utils/tenderlyDeepDiff.ts (100%) delete mode 100644 src/simulate/govv2/abis/AaveGovernanceV2.ts delete mode 100644 src/simulate/govv2/abis/ArbitrumBridgeExecutor.ts delete mode 100644 src/simulate/govv2/abis/ArcTimelock.ts delete mode 100644 src/simulate/govv2/abis/Executor.ts delete mode 100644 src/simulate/govv2/abis/MetisBridgeExecutor.ts delete mode 100644 src/simulate/govv2/abis/OptimismBridgeExecutor.ts delete mode 100644 src/simulate/govv2/abis/PolygonBridgeExecutor.ts delete mode 100644 src/simulate/govv2/networks/arbitrum.ts delete mode 100644 src/simulate/govv2/networks/base.ts delete mode 100644 src/simulate/govv2/networks/commonL2.ts delete mode 100644 src/simulate/govv2/networks/mainnet.ts delete mode 100644 src/simulate/govv2/networks/metis.ts delete mode 100644 src/simulate/govv2/networks/optimism.ts delete mode 100644 src/simulate/govv2/networks/polygon.ts delete mode 100644 src/simulate/govv2/networks/types.ts delete mode 100644 src/simulate/govv2/simulate.ts diff --git a/src/commands/fork.ts b/src/commands/fork.ts index def14fd..32affa4 100644 --- a/src/commands/fork.ts +++ b/src/commands/fork.ts @@ -1,9 +1,9 @@ import { Command } from '@commander-js/extra-typings'; import { tenderly } from '../utils/tenderlyClient'; -import { getGovernance } from '../simulate/govv3/governance'; +import { getGovernance } from '../govv3/governance'; import { GovernanceV3Ethereum } from '@bgd-labs/aave-address-book'; import { RPC_MAP, mainnetClient } from '../utils/rpcClients'; -import { getPayloadsController } from '../simulate/govv3/payloadsController'; +import { getPayloadsController } from '../govv3/payloadsController'; import { Hex, PublicClient } from 'viem'; export function addCommand(program: Command) { diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 1379978..295fa38 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -1,7 +1,7 @@ import { Command } from '@commander-js/extra-typings'; -import { simulateProposal } from '../simulate/govv3/simulate'; +import { simulateProposal } from '../govv3/simulate'; import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; -import { HUMAN_READABLE_STATE, State, getGovernance } from '../simulate/govv3/governance'; +import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/governance'; import { goerliClient } from '../utils/rpcClients'; import { logError, logInfo } from '../utils/logger'; import { Hex, createWalletClient, encodeAbiParameters, getContract, http } from 'viem'; diff --git a/src/simulate/govv3/abis/ERC20.ts b/src/govv3/abis/ERC20.ts similarity index 100% rename from src/simulate/govv3/abis/ERC20.ts rename to src/govv3/abis/ERC20.ts diff --git a/src/simulate/govv3/checks/logs.ts b/src/govv3/checks/logs.ts similarity index 96% rename from src/simulate/govv3/checks/logs.ts rename to src/govv3/checks/logs.ts index c7e0ffa..c2527fa 100644 --- a/src/simulate/govv3/checks/logs.ts +++ b/src/govv3/checks/logs.ts @@ -1,6 +1,6 @@ import { getAddress } from 'viem'; import { ProposalCheck } from './types'; -import { Log } from '../../../utils/tenderlyClient'; +import { Log } from '../../utils/tenderlyClient'; import { getContractName } from '../utils/solidityUtils'; /** diff --git a/src/simulate/govv3/checks/selfDestruct.ts b/src/govv3/checks/selfDestruct.ts similarity index 100% rename from src/simulate/govv3/checks/selfDestruct.ts rename to src/govv3/checks/selfDestruct.ts diff --git a/src/simulate/govv3/checks/targets-verified.ts b/src/govv3/checks/targets-verified.ts similarity index 97% rename from src/simulate/govv3/checks/targets-verified.ts rename to src/govv3/checks/targets-verified.ts index 2bd062b..6577255 100644 --- a/src/simulate/govv3/checks/targets-verified.ts +++ b/src/govv3/checks/targets-verified.ts @@ -1,6 +1,6 @@ import { Hex, PublicClient } from 'viem'; import { ProposalCheck } from './types'; -import { TenderlySimulationResponse } from '../../../utils/tenderlyClient'; +import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; /** * Check all targets with code are verified on Etherscan diff --git a/src/simulate/govv3/checks/types.ts b/src/govv3/checks/types.ts similarity index 85% rename from src/simulate/govv3/checks/types.ts rename to src/govv3/checks/types.ts index 56e9e9d..81afb4e 100644 --- a/src/simulate/govv3/checks/types.ts +++ b/src/govv3/checks/types.ts @@ -1,6 +1,6 @@ import { PublicClient } from 'viem'; import { PayloadsController } from '../payloadsController'; -import { TenderlySimulationResponse } from '../../../utils/tenderlyClient'; +import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; export type CheckResult = { info: string[]; diff --git a/src/simulate/govv3/generatePayloadReport.ts b/src/govv3/generatePayloadReport.ts similarity index 98% rename from src/simulate/govv3/generatePayloadReport.ts rename to src/govv3/generatePayloadReport.ts index 5c4e2a4..81a15d1 100644 --- a/src/simulate/govv3/generatePayloadReport.ts +++ b/src/govv3/generatePayloadReport.ts @@ -1,5 +1,5 @@ import { Hex, PublicClient, getAddress } from 'viem'; -import { StateDiff, TenderlySimulationResponse } from '../../utils/tenderlyClient'; +import { StateDiff, TenderlySimulationResponse } from '../utils/tenderlyClient'; import { PayloadsController } from './payloadsController'; import { tenderlyDeepDiff } from './utils/tenderlyDeepDiff'; import { interpretStateChange } from './utils/stateDiffInterpreter'; diff --git a/src/simulate/govv3/governance.ts b/src/govv3/governance.ts similarity index 89% rename from src/simulate/govv3/governance.ts rename to src/govv3/governance.ts index 9065036..9a50753 100644 --- a/src/simulate/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -10,12 +10,11 @@ import { parseEther, toHex, } from 'viem'; -import { FilterLogWithTimestamp } from '../govv2/networks/types'; -import { getLogs } from '../../utils/logs'; +import { FilterLogWithTimestamp, getLogs } from '../utils/logs'; import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book'; -import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../../utils/tenderlyClient'; -import { EOA } from '../../utils/constants'; -import { getSolidityStorageSlotAddress, getSolidityStorageSlotUint } from '../../utils/storageSlots'; +import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../utils/tenderlyClient'; +import { EOA } from '../utils/constants'; +import { getSolidityStorageSlotAddress, getSolidityStorageSlotUint } from '../utils/storageSlots'; import { setBits } from './utils/solidityUtils'; import { VOTING_SLOTS, WAREHOUSE_SLOTS, getProof } from './proofs'; @@ -74,26 +73,15 @@ const SLOTS = { PROPOSALS_MAPPING: 7n, }; -export enum State { - Null, // proposal does not exists - Created, // created, waiting for a cooldown to initiate the balances snapshot - Active, // balances snapshot set, voting in progress - Queued, // voting results submitted, but proposal is under grace period when guardian can cancel it - Executed, // results sent to the execution chain(s) - Failed, // voting was not successful - Cancelled, // got cancelled by guardian, or because proposition power of creator dropped below allowed minimum - Expired, -} - export const HUMAN_READABLE_STATE = { - [State.Null]: 'Null', - [State.Created]: 'Created', - [State.Active]: 'Active', - [State.Queued]: 'Queued', - [State.Executed]: 'Executed', - [State.Failed]: 'Failed', - [State.Cancelled]: 'Cancelled', - [State.Expired]: 'Expired', + [ProposalState.Null]: 'Null', + [ProposalState.Created]: 'Created', + [ProposalState.Active]: 'Active', + [ProposalState.Queued]: 'Queued', + [ProposalState.Executed]: 'Executed', + [ProposalState.Failed]: 'Failed', + [ProposalState.Cancelled]: 'Cancelled', + [ProposalState.Expired]: 'Expired', }; interface GetGovernanceParams { @@ -121,7 +109,7 @@ export const getGovernance = ({ let bigIntData = fromHex(data!, { to: 'bigint' }); // manipulate storage // set queued - bigIntData = setBits(bigIntData, 0n, 8n, State.Queued); + bigIntData = setBits(bigIntData, 0n, 8n, ProposalState.Queued); // set creation time bigIntData = setBits( bigIntData, diff --git a/src/simulate/govv3/payloadsController.ts b/src/govv3/payloadsController.ts similarity index 95% rename from src/simulate/govv3/payloadsController.ts rename to src/govv3/payloadsController.ts index 8110eee..02280aa 100644 --- a/src/simulate/govv3/payloadsController.ts +++ b/src/govv3/payloadsController.ts @@ -7,11 +7,10 @@ import { encodePacked, getContract, } from 'viem'; -import { getLogs } from '../../utils/logs'; -import { FilterLogWithTimestamp } from '../govv2/networks/types'; -import { TenderlyRequest, tenderly, TenderlySimulationResponse } from '../../utils/tenderlyClient'; -import { EOA } from '../../utils/constants'; -import { getSolidityStorageSlotUint } from '../../utils/storageSlots'; +import { FilterLogWithTimestamp, getLogs } from '../utils/logs'; +import { TenderlyRequest, tenderly, TenderlySimulationResponse } from '../utils/tenderlyClient'; +import { EOA } from '../utils/constants'; +import { getSolidityStorageSlotUint } from '../utils/storageSlots'; import { IPayloadsControllerCore_ABI } from '@bgd-labs/aave-address-book'; type PayloadCreatedLog = FilterLogWithTimestamp; diff --git a/src/simulate/govv3/proofs.ts b/src/govv3/proofs.ts similarity index 100% rename from src/simulate/govv3/proofs.ts rename to src/govv3/proofs.ts diff --git a/src/simulate/govv3/simulate.ts b/src/govv3/simulate.ts similarity index 93% rename from src/simulate/govv3/simulate.ts rename to src/govv3/simulate.ts index 73663db..b9574bb 100644 --- a/src/simulate/govv3/simulate.ts +++ b/src/govv3/simulate.ts @@ -1,11 +1,11 @@ -import { logInfo } from '../../utils/logger'; -import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; +import { logInfo } from '../utils/logger'; +import { TenderlySimulationResponse } from '../utils/tenderlyClient'; import { getGovernance } from './governance'; import { Hex, createPublicClient, http } from 'viem'; import { sepolia, polygonMumbai, bscTestnet, avalancheFuji } from 'viem/chains'; import { PayloadsController, getPayloadsController } from './payloadsController'; import { generateReport } from './generatePayloadReport'; -import { sepoliaClient } from '../../utils/rpcClients'; +import { sepoliaClient } from '../utils/rpcClients'; const CHAIN_ID_CLIENT_MAP = { [sepolia.id]: { diff --git a/src/simulate/govv3/utils/markdownUtils.ts b/src/govv3/utils/markdownUtils.ts similarity index 100% rename from src/simulate/govv3/utils/markdownUtils.ts rename to src/govv3/utils/markdownUtils.ts diff --git a/src/simulate/govv3/utils/solidityUtils.spec.ts b/src/govv3/utils/solidityUtils.spec.ts similarity index 100% rename from src/simulate/govv3/utils/solidityUtils.spec.ts rename to src/govv3/utils/solidityUtils.spec.ts diff --git a/src/simulate/govv3/utils/solidityUtils.ts b/src/govv3/utils/solidityUtils.ts similarity index 97% rename from src/simulate/govv3/utils/solidityUtils.ts rename to src/govv3/utils/solidityUtils.ts index 24fa5e4..4fd3683 100644 --- a/src/simulate/govv3/utils/solidityUtils.ts +++ b/src/govv3/utils/solidityUtils.ts @@ -1,5 +1,5 @@ import { getAddress } from 'viem'; -import { TenderlySimulationResponse } from '../../../utils/tenderlyClient'; +import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; /** * Returns the selected bits of a uint256 diff --git a/src/simulate/govv3/utils/stateDiffInterpreter.ts b/src/govv3/utils/stateDiffInterpreter.ts similarity index 100% rename from src/simulate/govv3/utils/stateDiffInterpreter.ts rename to src/govv3/utils/stateDiffInterpreter.ts diff --git a/src/simulate/govv3/utils/tenderlyDeepDiff.ts b/src/govv3/utils/tenderlyDeepDiff.ts similarity index 100% rename from src/simulate/govv3/utils/tenderlyDeepDiff.ts rename to src/govv3/utils/tenderlyDeepDiff.ts diff --git a/src/index.ts b/src/index.ts index ee61c47..141010e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,7 @@ export * from './reports/diff-reports'; -export { simulateProposal } from './simulate/govv2/simulate'; -export { simulateProposal as simulateProposalV3 } from './simulate/govv3/simulate'; -export * from './simulate/govv2/networks/mainnet'; -export * from './simulate/govv3/governance'; -export * from './simulate/govv3/payloadsController'; -export * from './simulate/govv3/generatePayloadReport'; +export { simulateProposal } from './govv3/simulate'; +export * from './govv3/governance'; +export * from './govv3/payloadsController'; +export * from './govv3/generatePayloadReport'; export * from './utils/tenderlyClient'; export * from './utils/logger'; diff --git a/src/simulate/govv2/abis/AaveGovernanceV2.ts b/src/simulate/govv2/abis/AaveGovernanceV2.ts deleted file mode 100644 index 7152726..0000000 --- a/src/simulate/govv2/abis/AaveGovernanceV2.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { Address, Hex, fromHex, pad, toHex } from 'viem'; -import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; -import { getSolidityStorageSlotUint } from '../../../utils/storageSlots'; - -export enum PROPOSAL_STATES { - PENDING, - CANCELED, - ACTIVE, - FAILED, - SUCCEEDED, - QUEUED, - EXPIRED, - EXECUTED, -} - -export const AAVE_GOVERNANCE_V2_START_BLOCK = 11427398n; -/** - * @notice Returns an object containing various AaveGovernanceV2 slots - * @param id Proposal ID - */ -export function getAaveGovernanceV2Slots(proposalId: bigint, executor: Address) { - // TODO generalize this for other storage layouts - - // struct Proposal { - // uint256 id; - // address creator; - // IExecutorWithTimelock executor; - // address[] targets; - // uint256[] values; - // string[] signatures; - // bytes[] calldatas; - // bool[] withDelegatecalls; - // uint256 startBlock; - // uint256 endBlock; - // uint256 executionTime; - // uint256 forVotes; - // uint256 againstVotes; - // bool executed; - // bool canceled; - // address strategy; - // bytes32 ipfsHash; - // mapping(address => Vote) votes; - // } - - const etaOffset = 10n; - const forVotesOffset = 11n; - const againstVotesOffset = 12n; - const canceledSlotOffset = 13n; // this is packed with `executed` - - // Compute and return slot numbers - const votingStrategySlot: Hex = '0x1'; - let queuedTxsSlot: Hex; - if (executor === AaveGovernanceV2.SHORT_EXECUTOR) { - queuedTxsSlot = '0x3'; - } - if (executor === AaveGovernanceV2.LONG_EXECUTOR) { - queuedTxsSlot = '0x07'; - } - if (!queuedTxsSlot!) throw new Error('unknown executor'); - const proposalsMapSlot = 4n; // proposals ID to proposal struct mapping - const proposalSlot = fromHex(getSolidityStorageSlotUint(proposalsMapSlot, proposalId), 'bigint'); - return { - queuedTxsSlot, - votingStrategySlot, - proposalsMapSlot: proposalsMapSlot, - proposalSlot: proposalSlot, - canceled: pad(toHex(proposalSlot + canceledSlotOffset), { size: 32 }), - eta: pad(toHex(proposalSlot + etaOffset), { size: 32 }), - forVotes: pad(toHex(proposalSlot + forVotesOffset), { size: 32 }), - againstVotes: pad(toHex(proposalSlot + againstVotesOffset), { size: 32 }), - }; -} diff --git a/src/simulate/govv2/abis/ArbitrumBridgeExecutor.ts b/src/simulate/govv2/abis/ArbitrumBridgeExecutor.ts deleted file mode 100644 index 95dec8c..0000000 --- a/src/simulate/govv2/abis/ArbitrumBridgeExecutor.ts +++ /dev/null @@ -1,423 +0,0 @@ -export const ARBITRUM_BRIDGE_EXECUTOR_ABI = [ - { - inputs: [ - { - internalType: "address", - name: "ethereumGovernanceExecutor", - type: "address", - }, - { internalType: "uint256", name: "delay", type: "uint256" }, - { internalType: "uint256", name: "gracePeriod", type: "uint256" }, - { internalType: "uint256", name: "minimumDelay", type: "uint256" }, - { internalType: "uint256", name: "maximumDelay", type: "uint256" }, - { internalType: "address", name: "guardian", type: "address" }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { inputs: [], name: "DelayLongerThanMax", type: "error" }, - { inputs: [], name: "DelayShorterThanMin", type: "error" }, - { inputs: [], name: "DuplicateAction", type: "error" }, - { inputs: [], name: "EmptyTargets", type: "error" }, - { inputs: [], name: "FailedActionExecution", type: "error" }, - { inputs: [], name: "GracePeriodTooShort", type: "error" }, - { inputs: [], name: "InconsistentParamsLength", type: "error" }, - { inputs: [], name: "InsufficientBalance", type: "error" }, - { inputs: [], name: "InvalidActionsSetId", type: "error" }, - { inputs: [], name: "InvalidInitParams", type: "error" }, - { inputs: [], name: "MaximumDelayTooShort", type: "error" }, - { inputs: [], name: "MinimumDelayTooLong", type: "error" }, - { inputs: [], name: "NotGuardian", type: "error" }, - { inputs: [], name: "OnlyCallableByThis", type: "error" }, - { inputs: [], name: "OnlyQueuedActions", type: "error" }, - { inputs: [], name: "TimelockNotFinished", type: "error" }, - { inputs: [], name: "UnauthorizedEthereumExecutor", type: "error" }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "uint256", name: "id", type: "uint256" }, - ], - name: "ActionsSetCanceled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "uint256", name: "id", type: "uint256" }, - { - indexed: true, - internalType: "address", - name: "initiatorExecution", - type: "address", - }, - { - indexed: false, - internalType: "bytes[]", - name: "returnedData", - type: "bytes[]", - }, - ], - name: "ActionsSetExecuted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "uint256", name: "id", type: "uint256" }, - { - indexed: false, - internalType: "address[]", - name: "targets", - type: "address[]", - }, - { - indexed: false, - internalType: "uint256[]", - name: "values", - type: "uint256[]", - }, - { - indexed: false, - internalType: "string[]", - name: "signatures", - type: "string[]", - }, - { - indexed: false, - internalType: "bytes[]", - name: "calldatas", - type: "bytes[]", - }, - { - indexed: false, - internalType: "bool[]", - name: "withDelegatecalls", - type: "bool[]", - }, - { - indexed: false, - internalType: "uint256", - name: "executionTime", - type: "uint256", - }, - ], - name: "ActionsSetQueued", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "oldDelay", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "newDelay", - type: "uint256", - }, - ], - name: "DelayUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "oldEthereumGovernanceExecutor", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "newEthereumGovernanceExecutor", - type: "address", - }, - ], - name: "EthereumGovernanceExecutorUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "oldGracePeriod", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "newGracePeriod", - type: "uint256", - }, - ], - name: "GracePeriodUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "oldGuardian", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "newGuardian", - type: "address", - }, - ], - name: "GuardianUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "oldMaximumDelay", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "newMaximumDelay", - type: "uint256", - }, - ], - name: "MaximumDelayUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "oldMinimumDelay", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "newMinimumDelay", - type: "uint256", - }, - ], - name: "MinimumDelayUpdate", - type: "event", - }, - { - inputs: [ - { internalType: "uint256", name: "actionsSetId", type: "uint256" }, - ], - name: "cancel", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "actionsSetId", type: "uint256" }, - ], - name: "execute", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "target", type: "address" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "executeDelegateCall", - outputs: [ - { internalType: "bool", name: "", type: "bool" }, - { internalType: "bytes", name: "", type: "bytes" }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "actionsSetId", type: "uint256" }, - ], - name: "getActionsSetById", - outputs: [ - { - components: [ - { internalType: "address[]", name: "targets", type: "address[]" }, - { internalType: "uint256[]", name: "values", type: "uint256[]" }, - { internalType: "string[]", name: "signatures", type: "string[]" }, - { internalType: "bytes[]", name: "calldatas", type: "bytes[]" }, - { internalType: "bool[]", name: "withDelegatecalls", type: "bool[]" }, - { internalType: "uint256", name: "executionTime", type: "uint256" }, - { internalType: "bool", name: "executed", type: "bool" }, - { internalType: "bool", name: "canceled", type: "bool" }, - ], - internalType: "struct IExecutorBase.ActionsSet", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getActionsSetCount", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "actionsSetId", type: "uint256" }, - ], - name: "getCurrentState", - outputs: [ - { - internalType: "enum IExecutorBase.ActionsSetState", - name: "", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getDelay", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getEthereumGovernanceExecutor", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getGracePeriod", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getGuardian", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getMaximumDelay", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getMinimumDelay", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "bytes32", name: "actionHash", type: "bytes32" }], - name: "isActionQueued", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address[]", name: "targets", type: "address[]" }, - { internalType: "uint256[]", name: "values", type: "uint256[]" }, - { internalType: "string[]", name: "signatures", type: "string[]" }, - { internalType: "bytes[]", name: "calldatas", type: "bytes[]" }, - { internalType: "bool[]", name: "withDelegatecalls", type: "bool[]" }, - ], - name: "queue", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "receiveFunds", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "delay", type: "uint256" }], - name: "updateDelay", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "ethereumGovernanceExecutor", - type: "address", - }, - ], - name: "updateEthereumGovernanceExecutor", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "gracePeriod", type: "uint256" }], - name: "updateGracePeriod", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "guardian", type: "address" }], - name: "updateGuardian", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "maximumDelay", type: "uint256" }, - ], - name: "updateMaximumDelay", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "minimumDelay", type: "uint256" }, - ], - name: "updateMinimumDelay", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -] as const; - -// block when the bridge executor was deployed -export const ARBITRUM_BRIDGE_EXECUTOR_START_BLOCK = 20057725n; diff --git a/src/simulate/govv2/abis/ArcTimelock.ts b/src/simulate/govv2/abis/ArcTimelock.ts deleted file mode 100644 index bdba403..0000000 --- a/src/simulate/govv2/abis/ArcTimelock.ts +++ /dev/null @@ -1,267 +0,0 @@ -export const ARC_TIMELOCK_ABI = [ - { - inputs: [ - { internalType: 'address', name: 'ethereumGovernanceExecutor', type: 'address' }, - { internalType: 'uint256', name: 'delay', type: 'uint256' }, - { internalType: 'uint256', name: 'gracePeriod', type: 'uint256' }, - { internalType: 'uint256', name: 'minimumDelay', type: 'uint256' }, - { internalType: 'uint256', name: 'maximumDelay', type: 'uint256' }, - { internalType: 'address', name: 'guardian', type: 'address' }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [{ indexed: false, internalType: 'uint256', name: 'id', type: 'uint256' }], - name: 'ActionsSetCanceled', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'id', type: 'uint256' }, - { indexed: true, internalType: 'address', name: 'initiatorExecution', type: 'address' }, - { indexed: false, internalType: 'bytes[]', name: 'returnedData', type: 'bytes[]' }, - ], - name: 'ActionsSetExecuted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'id', type: 'uint256' }, - { indexed: false, internalType: 'address[]', name: 'targets', type: 'address[]' }, - { indexed: false, internalType: 'uint256[]', name: 'values', type: 'uint256[]' }, - { indexed: false, internalType: 'string[]', name: 'signatures', type: 'string[]' }, - { indexed: false, internalType: 'bytes[]', name: 'calldatas', type: 'bytes[]' }, - { indexed: false, internalType: 'bool[]', name: 'withDelegatecalls', type: 'bool[]' }, - { indexed: false, internalType: 'uint256', name: 'executionTime', type: 'uint256' }, - ], - name: 'ActionsSetQueued', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'previousDelay', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'newDelay', type: 'uint256' }, - ], - name: 'DelayUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'address', name: 'previousEthereumGovernanceExecutor', type: 'address' }, - { indexed: false, internalType: 'address', name: 'newEthereumGovernanceExecutor', type: 'address' }, - ], - name: 'EthereumGovernanceExecutorUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'previousGracePeriod', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'newGracePeriod', type: 'uint256' }, - ], - name: 'GracePeriodUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'address', name: 'previousGuardian', type: 'address' }, - { indexed: false, internalType: 'address', name: 'newGuardian', type: 'address' }, - ], - name: 'GuardianUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'previousMaximumDelay', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'newMaximumDelay', type: 'uint256' }, - ], - name: 'MaximumDelayUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: 'uint256', name: 'previousMinimumDelay', type: 'uint256' }, - { indexed: false, internalType: 'uint256', name: 'newMinimumDelay', type: 'uint256' }, - ], - name: 'MinimumDelayUpdate', - type: 'event', - }, - { - inputs: [{ internalType: 'uint256', name: 'actionsSetId', type: 'uint256' }], - name: 'cancel', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'actionsSetId', type: 'uint256' }], - name: 'execute', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - ], - name: 'executeDelegateCall', - outputs: [ - { internalType: 'bool', name: '', type: 'bool' }, - { internalType: 'bytes', name: '', type: 'bytes' }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'actionsSetId', type: 'uint256' }], - name: 'getActionsSetById', - outputs: [ - { - components: [ - { internalType: 'address[]', name: 'targets', type: 'address[]' }, - { internalType: 'uint256[]', name: 'values', type: 'uint256[]' }, - { internalType: 'string[]', name: 'signatures', type: 'string[]' }, - { internalType: 'bytes[]', name: 'calldatas', type: 'bytes[]' }, - { internalType: 'bool[]', name: 'withDelegatecalls', type: 'bool[]' }, - { internalType: 'uint256', name: 'executionTime', type: 'uint256' }, - { internalType: 'bool', name: 'executed', type: 'bool' }, - { internalType: 'bool', name: 'canceled', type: 'bool' }, - ], - internalType: 'struct ITimelockExecutor.ActionsSet', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getActionsSetCount', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'actionsSetId', type: 'uint256' }], - name: 'getCurrentState', - outputs: [{ internalType: 'enum ITimelockExecutor.ActionsSetState', name: '', type: 'uint8' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getDelay', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getEthereumGovernanceExecutor', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getGracePeriod', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getGuardian', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getMaximumDelay', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getMinimumDelay', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'bytes32', name: 'actionHash', type: 'bytes32' }], - name: 'isActionQueued', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address[]', name: 'targets', type: 'address[]' }, - { internalType: 'uint256[]', name: 'values', type: 'uint256[]' }, - { internalType: 'string[]', name: 'signatures', type: 'string[]' }, - { internalType: 'bytes[]', name: 'calldatas', type: 'bytes[]' }, - { internalType: 'bool[]', name: 'withDelegatecalls', type: 'bool[]' }, - ], - name: 'queue', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { inputs: [], name: 'receiveFunds', outputs: [], stateMutability: 'payable', type: 'function' }, - { - inputs: [{ internalType: 'uint256', name: 'delay', type: 'uint256' }], - name: 'updateDelay', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'ethereumGovernanceExecutor', type: 'address' }], - name: 'updateEthereumGovernanceExecutor', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'gracePeriod', type: 'uint256' }], - name: 'updateGracePeriod', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'guardian', type: 'address' }], - name: 'updateGuardian', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'maximumDelay', type: 'uint256' }], - name: 'updateMaximumDelay', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'minimumDelay', type: 'uint256' }], - name: 'updateMinimumDelay', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; diff --git a/src/simulate/govv2/abis/Executor.ts b/src/simulate/govv2/abis/Executor.ts deleted file mode 100644 index 7c9f451..0000000 --- a/src/simulate/govv2/abis/Executor.ts +++ /dev/null @@ -1,468 +0,0 @@ -export const EXECUTOR_ABI = [ - { - inputs: [ - { internalType: 'address', name: 'admin', type: 'address' }, - { internalType: 'uint256', name: 'delay', type: 'uint256' }, - { internalType: 'uint256', name: 'gracePeriod', type: 'uint256' }, - { internalType: 'uint256', name: 'minimumDelay', type: 'uint256' }, - { internalType: 'uint256', name: 'maximumDelay', type: 'uint256' }, - { - internalType: 'uint256', - name: 'propositionThreshold', - type: 'uint256', - }, - { internalType: 'uint256', name: 'voteDuration', type: 'uint256' }, - { internalType: 'uint256', name: 'voteDifferential', type: 'uint256' }, - { internalType: 'uint256', name: 'minimumQuorum', type: 'uint256' }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'actionHash', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'target', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'string', - name: 'signature', - type: 'string', - }, - { indexed: false, internalType: 'bytes', name: 'data', type: 'bytes' }, - { - indexed: false, - internalType: 'uint256', - name: 'executionTime', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bool', - name: 'withDelegatecall', - type: 'bool', - }, - ], - name: 'CancelledAction', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'actionHash', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'target', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'string', - name: 'signature', - type: 'string', - }, - { indexed: false, internalType: 'bytes', name: 'data', type: 'bytes' }, - { - indexed: false, - internalType: 'uint256', - name: 'executionTime', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bool', - name: 'withDelegatecall', - type: 'bool', - }, - { - indexed: false, - internalType: 'bytes', - name: 'resultData', - type: 'bytes', - }, - ], - name: 'ExecutedAction', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newAdmin', - type: 'address', - }, - ], - name: 'NewAdmin', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'delay', - type: 'uint256', - }, - ], - name: 'NewDelay', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newPendingAdmin', - type: 'address', - }, - ], - name: 'NewPendingAdmin', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'actionHash', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'target', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'string', - name: 'signature', - type: 'string', - }, - { indexed: false, internalType: 'bytes', name: 'data', type: 'bytes' }, - { - indexed: false, - internalType: 'uint256', - name: 'executionTime', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bool', - name: 'withDelegatecall', - type: 'bool', - }, - ], - name: 'QueuedAction', - type: 'event', - }, - { - inputs: [], - name: 'GRACE_PERIOD', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAXIMUM_DELAY', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MINIMUM_DELAY', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MINIMUM_QUORUM', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'ONE_HUNDRED_WITH_PRECISION', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'PROPOSITION_THRESHOLD', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'VOTE_DIFFERENTIAL', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'VOTING_DURATION', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'acceptAdmin', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'string', name: 'signature', type: 'string' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - { internalType: 'uint256', name: 'executionTime', type: 'uint256' }, - { internalType: 'bool', name: 'withDelegatecall', type: 'bool' }, - ], - name: 'cancelTransaction', - outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'string', name: 'signature', type: 'string' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - { internalType: 'uint256', name: 'executionTime', type: 'uint256' }, - { internalType: 'bool', name: 'withDelegatecall', type: 'bool' }, - ], - name: 'executeTransaction', - outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [], - name: 'getAdmin', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getDelay', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveGovernanceV2', - name: 'governance', - type: 'address', - }, - { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, - ], - name: 'getMinimumPropositionPowerNeeded', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'votingSupply', type: 'uint256' }], - name: 'getMinimumVotingPowerNeeded', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPendingAdmin', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'bytes32', name: 'actionHash', type: 'bytes32' }], - name: 'isActionQueued', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveGovernanceV2', - name: 'governance', - type: 'address', - }, - { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - ], - name: 'isProposalOverGracePeriod', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveGovernanceV2', - name: 'governance', - type: 'address', - }, - { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - ], - name: 'isProposalPassed', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveGovernanceV2', - name: 'governance', - type: 'address', - }, - { internalType: 'address', name: 'user', type: 'address' }, - { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, - ], - name: 'isPropositionPowerEnough', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveGovernanceV2', - name: 'governance', - type: 'address', - }, - { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - ], - name: 'isQuorumValid', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveGovernanceV2', - name: 'governance', - type: 'address', - }, - { internalType: 'uint256', name: 'proposalId', type: 'uint256' }, - ], - name: 'isVoteDifferentialValid', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'string', name: 'signature', type: 'string' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - { internalType: 'uint256', name: 'executionTime', type: 'uint256' }, - { internalType: 'bool', name: 'withDelegatecall', type: 'bool' }, - ], - name: 'queueTransaction', - outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'delay', type: 'uint256' }], - name: 'setDelay', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'newPendingAdmin', type: 'address' }], - name: 'setPendingAdmin', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveGovernanceV2', - name: 'governance', - type: 'address', - }, - { internalType: 'address', name: 'user', type: 'address' }, - { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, - ], - name: 'validateCreatorOfProposal', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveGovernanceV2', - name: 'governance', - type: 'address', - }, - { internalType: 'address', name: 'user', type: 'address' }, - { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, - ], - name: 'validateProposalCancellation', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { stateMutability: 'payable', type: 'receive' }, -] as const; diff --git a/src/simulate/govv2/abis/MetisBridgeExecutor.ts b/src/simulate/govv2/abis/MetisBridgeExecutor.ts deleted file mode 100644 index aafe224..0000000 --- a/src/simulate/govv2/abis/MetisBridgeExecutor.ts +++ /dev/null @@ -1,340 +0,0 @@ -export const METIS_BRIDGE_EXECUTOR_ABI = [ - { - type: "constructor", - inputs: [ - { - type: "address", - name: "ovmL2CrossDomainMessenger", - internalType: "address", - }, - { - type: "address", - name: "ethereumGovernanceExecutor", - internalType: "address", - }, - { type: "uint256", name: "delay", internalType: "uint256" }, - { type: "uint256", name: "gracePeriod", internalType: "uint256" }, - { type: "uint256", name: "minimumDelay", internalType: "uint256" }, - { type: "uint256", name: "maximumDelay", internalType: "uint256" }, - { type: "address", name: "guardian", internalType: "address" }, - ], - }, - { - type: "function", - stateMutability: "view", - outputs: [{ type: "address", name: "", internalType: "address" }], - name: "OVM_L2_CROSS_DOMAIN_MESSENGER", - inputs: [], - }, - { - type: "function", - stateMutability: "nonpayable", - outputs: [], - name: "cancel", - inputs: [ - { type: "uint256", name: "actionsSetId", internalType: "uint256" }, - ], - }, - { - type: "function", - stateMutability: "payable", - outputs: [], - name: "execute", - inputs: [ - { type: "uint256", name: "actionsSetId", internalType: "uint256" }, - ], - }, - { - type: "function", - stateMutability: "payable", - outputs: [ - { type: "bool", name: "", internalType: "bool" }, - { type: "bytes", name: "", internalType: "bytes" }, - ], - name: "executeDelegateCall", - inputs: [ - { type: "address", name: "target", internalType: "address" }, - { type: "bytes", name: "data", internalType: "bytes" }, - ], - }, - { - type: "function", - stateMutability: "view", - outputs: [ - { - type: "tuple", - name: "", - internalType: "struct IExecutorBase.ActionsSet", - components: [ - { type: "address[]" }, - { type: "uint256[]" }, - { type: "string[]" }, - { type: "bytes[]" }, - { type: "bool[]" }, - { type: "uint256" }, - { type: "bool" }, - { type: "bool" }, - ], - }, - ], - name: "getActionsSetById", - inputs: [ - { type: "uint256", name: "actionsSetId", internalType: "uint256" }, - ], - }, - { - type: "function", - stateMutability: "view", - outputs: [{ type: "uint256", name: "", internalType: "uint256" }], - name: "getActionsSetCount", - inputs: [], - }, - { - type: "function", - stateMutability: "view", - outputs: [ - { - type: "uint8", - name: "", - internalType: "enum IExecutorBase.ActionsSetState", - }, - ], - name: "getCurrentState", - inputs: [ - { type: "uint256", name: "actionsSetId", internalType: "uint256" }, - ], - }, - { - type: "function", - stateMutability: "view", - outputs: [{ type: "uint256", name: "", internalType: "uint256" }], - name: "getDelay", - inputs: [], - }, - { - type: "function", - stateMutability: "view", - outputs: [{ type: "address", name: "", internalType: "address" }], - name: "getEthereumGovernanceExecutor", - inputs: [], - }, - { - type: "function", - stateMutability: "view", - outputs: [{ type: "uint256", name: "", internalType: "uint256" }], - name: "getGracePeriod", - inputs: [], - }, - { - type: "function", - stateMutability: "view", - outputs: [{ type: "address", name: "", internalType: "address" }], - name: "getGuardian", - inputs: [], - }, - { - type: "function", - stateMutability: "view", - outputs: [{ type: "uint256", name: "", internalType: "uint256" }], - name: "getMaximumDelay", - inputs: [], - }, - { - type: "function", - stateMutability: "view", - outputs: [{ type: "uint256", name: "", internalType: "uint256" }], - name: "getMinimumDelay", - inputs: [], - }, - { - type: "function", - stateMutability: "view", - outputs: [{ type: "bool", name: "", internalType: "bool" }], - name: "isActionQueued", - inputs: [{ type: "bytes32", name: "actionHash", internalType: "bytes32" }], - }, - { - type: "function", - stateMutability: "nonpayable", - outputs: [], - name: "queue", - inputs: [ - { type: "address[]", name: "targets", internalType: "address[]" }, - { type: "uint256[]", name: "values", internalType: "uint256[]" }, - { type: "string[]", name: "signatures", internalType: "string[]" }, - { type: "bytes[]", name: "calldatas", internalType: "bytes[]" }, - { type: "bool[]", name: "withDelegatecalls", internalType: "bool[]" }, - ], - }, - { - type: "function", - stateMutability: "payable", - outputs: [], - name: "receiveFunds", - inputs: [], - }, - { - type: "function", - stateMutability: "nonpayable", - outputs: [], - name: "updateDelay", - inputs: [{ type: "uint256", name: "delay", internalType: "uint256" }], - }, - { - type: "function", - stateMutability: "nonpayable", - outputs: [], - name: "updateEthereumGovernanceExecutor", - inputs: [ - { - type: "address", - name: "ethereumGovernanceExecutor", - internalType: "address", - }, - ], - }, - { - type: "function", - stateMutability: "nonpayable", - outputs: [], - name: "updateGracePeriod", - inputs: [{ type: "uint256", name: "gracePeriod", internalType: "uint256" }], - }, - { - type: "function", - stateMutability: "nonpayable", - outputs: [], - name: "updateGuardian", - inputs: [{ type: "address", name: "guardian", internalType: "address" }], - }, - { - type: "function", - stateMutability: "nonpayable", - outputs: [], - name: "updateMaximumDelay", - inputs: [ - { type: "uint256", name: "maximumDelay", internalType: "uint256" }, - ], - }, - { - type: "function", - stateMutability: "nonpayable", - outputs: [], - name: "updateMinimumDelay", - inputs: [ - { type: "uint256", name: "minimumDelay", internalType: "uint256" }, - ], - }, - { - type: "event", - name: "ActionsSetCanceled", - inputs: [{ type: "uint256", name: "id", indexed: true }], - anonymous: false, - }, - { - type: "event", - name: "ActionsSetExecuted", - inputs: [ - { type: "uint256", name: "id", indexed: true }, - { type: "address", name: "initiatorExecution", indexed: true }, - { type: "bytes[]", name: "returnedData", indexed: false }, - ], - anonymous: false, - }, - { - type: "event", - name: "ActionsSetQueued", - inputs: [ - { type: "uint256", name: "id", indexed: true }, - { type: "address[]", name: "targets", indexed: false }, - { type: "uint256[]", name: "values", indexed: false }, - { type: "string[]", name: "signatures", indexed: false }, - { type: "bytes[]", name: "calldatas", indexed: false }, - { type: "bool[]", name: "withDelegatecalls", indexed: false }, - { type: "uint256", name: "executionTime", indexed: false }, - ], - anonymous: false, - }, - { - type: "event", - name: "DelayUpdate", - inputs: [ - { type: "uint256", name: "oldDelay", indexed: false }, - { type: "uint256", name: "newDelay", indexed: false }, - ], - anonymous: false, - }, - { - type: "event", - name: "EthereumGovernanceExecutorUpdate", - inputs: [ - { - type: "address", - name: "oldEthereumGovernanceExecutor", - indexed: false, - }, - { - type: "address", - name: "newEthereumGovernanceExecutor", - indexed: false, - }, - ], - anonymous: false, - }, - { - type: "event", - name: "GracePeriodUpdate", - inputs: [ - { type: "uint256", name: "oldGracePeriod", indexed: false }, - { type: "uint256", name: "newGracePeriod", indexed: false }, - ], - anonymous: false, - }, - { - type: "event", - name: "GuardianUpdate", - inputs: [ - { type: "address", name: "oldGuardian", indexed: false }, - { type: "address", name: "newGuardian", indexed: false }, - ], - anonymous: false, - }, - { - type: "event", - name: "MaximumDelayUpdate", - inputs: [ - { type: "uint256", name: "oldMaximumDelay", indexed: false }, - { type: "uint256", name: "newMaximumDelay", indexed: false }, - ], - anonymous: false, - }, - { - type: "event", - name: "MinimumDelayUpdate", - inputs: [ - { type: "uint256", name: "oldMinimumDelay", indexed: false }, - { type: "uint256", name: "newMinimumDelay", indexed: false }, - ], - anonymous: false, - }, - { type: "error", name: "DelayLongerThanMax", inputs: [] }, - { type: "error", name: "DelayShorterThanMin", inputs: [] }, - { type: "error", name: "DuplicateAction", inputs: [] }, - { type: "error", name: "EmptyTargets", inputs: [] }, - { type: "error", name: "FailedActionExecution", inputs: [] }, - { type: "error", name: "GracePeriodTooShort", inputs: [] }, - { type: "error", name: "InconsistentParamsLength", inputs: [] }, - { type: "error", name: "InsufficientBalance", inputs: [] }, - { type: "error", name: "InvalidActionsSetId", inputs: [] }, - { type: "error", name: "InvalidInitParams", inputs: [] }, - { type: "error", name: "MaximumDelayTooShort", inputs: [] }, - { type: "error", name: "MinimumDelayTooLong", inputs: [] }, - { type: "error", name: "NotGuardian", inputs: [] }, - { type: "error", name: "OnlyCallableByThis", inputs: [] }, - { type: "error", name: "OnlyQueuedActions", inputs: [] }, - { type: "error", name: "TimelockNotFinished", inputs: [] }, - { type: "error", name: "UnauthorizedEthereumExecutor", inputs: [] }, -] as const; - -// block when the bridge executor was deployed -export const METIS_BRIDGE_EXECUTOR_START_BLOCK = 5401596n; diff --git a/src/simulate/govv2/abis/OptimismBridgeExecutor.ts b/src/simulate/govv2/abis/OptimismBridgeExecutor.ts deleted file mode 100644 index b79caf6..0000000 --- a/src/simulate/govv2/abis/OptimismBridgeExecutor.ts +++ /dev/null @@ -1,421 +0,0 @@ -export const OPTIMISM_BRIDGE_EXECUTOR_ABI = [ - { - inputs: [ - { - internalType: 'address', - name: 'ovmL2CrossDomainMessenger', - type: 'address', - }, - { - internalType: 'address', - name: 'ethereumGovernanceExecutor', - type: 'address', - }, - { internalType: 'uint256', name: 'delay', type: 'uint256' }, - { internalType: 'uint256', name: 'gracePeriod', type: 'uint256' }, - { internalType: 'uint256', name: 'minimumDelay', type: 'uint256' }, - { internalType: 'uint256', name: 'maximumDelay', type: 'uint256' }, - { internalType: 'address', name: 'guardian', type: 'address' }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { inputs: [], name: 'DelayLongerThanMax', type: 'error' }, - { inputs: [], name: 'DelayShorterThanMin', type: 'error' }, - { inputs: [], name: 'DuplicateAction', type: 'error' }, - { inputs: [], name: 'EmptyTargets', type: 'error' }, - { inputs: [], name: 'FailedActionExecution', type: 'error' }, - { inputs: [], name: 'GracePeriodTooShort', type: 'error' }, - { inputs: [], name: 'InconsistentParamsLength', type: 'error' }, - { inputs: [], name: 'InsufficientBalance', type: 'error' }, - { inputs: [], name: 'InvalidActionsSetId', type: 'error' }, - { inputs: [], name: 'InvalidInitParams', type: 'error' }, - { inputs: [], name: 'MaximumDelayTooShort', type: 'error' }, - { inputs: [], name: 'MinimumDelayTooLong', type: 'error' }, - { inputs: [], name: 'NotGuardian', type: 'error' }, - { inputs: [], name: 'OnlyCallableByThis', type: 'error' }, - { inputs: [], name: 'OnlyQueuedActions', type: 'error' }, - { inputs: [], name: 'TimelockNotFinished', type: 'error' }, - { inputs: [], name: 'UnauthorizedEthereumExecutor', type: 'error' }, - { - anonymous: false, - inputs: [{ indexed: true, internalType: 'uint256', name: 'id', type: 'uint256' }], - name: 'ActionsSetCanceled', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'id', type: 'uint256' }, - { - indexed: true, - internalType: 'address', - name: 'initiatorExecution', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes[]', - name: 'returnedData', - type: 'bytes[]', - }, - ], - name: 'ActionsSetExecuted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'id', type: 'uint256' }, - { - indexed: false, - internalType: 'address[]', - name: 'targets', - type: 'address[]', - }, - { - indexed: false, - internalType: 'uint256[]', - name: 'values', - type: 'uint256[]', - }, - { - indexed: false, - internalType: 'string[]', - name: 'signatures', - type: 'string[]', - }, - { - indexed: false, - internalType: 'bytes[]', - name: 'calldatas', - type: 'bytes[]', - }, - { - indexed: false, - internalType: 'bool[]', - name: 'withDelegatecalls', - type: 'bool[]', - }, - { - indexed: false, - internalType: 'uint256', - name: 'executionTime', - type: 'uint256', - }, - ], - name: 'ActionsSetQueued', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'oldDelay', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newDelay', - type: 'uint256', - }, - ], - name: 'DelayUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldEthereumGovernanceExecutor', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newEthereumGovernanceExecutor', - type: 'address', - }, - ], - name: 'EthereumGovernanceExecutorUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'oldGracePeriod', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newGracePeriod', - type: 'uint256', - }, - ], - name: 'GracePeriodUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldGuardian', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newGuardian', - type: 'address', - }, - ], - name: 'GuardianUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'oldMaximumDelay', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newMaximumDelay', - type: 'uint256', - }, - ], - name: 'MaximumDelayUpdate', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'oldMinimumDelay', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newMinimumDelay', - type: 'uint256', - }, - ], - name: 'MinimumDelayUpdate', - type: 'event', - }, - { - inputs: [], - name: 'OVM_L2_CROSS_DOMAIN_MESSENGER', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'actionsSetId', type: 'uint256' }], - name: 'cancel', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'actionsSetId', type: 'uint256' }], - name: 'execute', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - ], - name: 'executeDelegateCall', - outputs: [ - { internalType: 'bool', name: '', type: 'bool' }, - { internalType: 'bytes', name: '', type: 'bytes' }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'actionsSetId', type: 'uint256' }], - name: 'getActionsSetById', - outputs: [ - { - components: [ - { internalType: 'address[]', name: 'targets', type: 'address[]' }, - { internalType: 'uint256[]', name: 'values', type: 'uint256[]' }, - { internalType: 'string[]', name: 'signatures', type: 'string[]' }, - { internalType: 'bytes[]', name: 'calldatas', type: 'bytes[]' }, - { internalType: 'bool[]', name: 'withDelegatecalls', type: 'bool[]' }, - { internalType: 'uint256', name: 'executionTime', type: 'uint256' }, - { internalType: 'bool', name: 'executed', type: 'bool' }, - { internalType: 'bool', name: 'canceled', type: 'bool' }, - ], - internalType: 'struct IExecutorBase.ActionsSet', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getActionsSetCount', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'actionsSetId', type: 'uint256' }], - name: 'getCurrentState', - outputs: [ - { - internalType: 'enum IExecutorBase.ActionsSetState', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getDelay', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getEthereumGovernanceExecutor', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getGracePeriod', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getGuardian', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getMaximumDelay', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getMinimumDelay', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'bytes32', name: 'actionHash', type: 'bytes32' }], - name: 'isActionQueued', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address[]', name: 'targets', type: 'address[]' }, - { internalType: 'uint256[]', name: 'values', type: 'uint256[]' }, - { internalType: 'string[]', name: 'signatures', type: 'string[]' }, - { internalType: 'bytes[]', name: 'calldatas', type: 'bytes[]' }, - { internalType: 'bool[]', name: 'withDelegatecalls', type: 'bool[]' }, - ], - name: 'queue', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'receiveFunds', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'delay', type: 'uint256' }], - name: 'updateDelay', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'ethereumGovernanceExecutor', - type: 'address', - }, - ], - name: 'updateEthereumGovernanceExecutor', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'gracePeriod', type: 'uint256' }], - name: 'updateGracePeriod', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'address', name: 'guardian', type: 'address' }], - name: 'updateGuardian', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'maximumDelay', type: 'uint256' }], - name: 'updateMaximumDelay', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'uint256', name: 'minimumDelay', type: 'uint256' }], - name: 'updateMinimumDelay', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -// block when the bridge executor was deployed -export const OPTIMISM_BRIDGE_EXECUTOR_START_BLOCK = 18825397n; diff --git a/src/simulate/govv2/abis/PolygonBridgeExecutor.ts b/src/simulate/govv2/abis/PolygonBridgeExecutor.ts deleted file mode 100644 index 559e82a..0000000 --- a/src/simulate/govv2/abis/PolygonBridgeExecutor.ts +++ /dev/null @@ -1,462 +0,0 @@ -export const POLYGON_BRIDGE_EXECUTOR_ABI = [ - { - inputs: [ - { internalType: "address", name: "fxRootSender", type: "address" }, - { internalType: "address", name: "fxChild", type: "address" }, - { internalType: "uint256", name: "delay", type: "uint256" }, - { internalType: "uint256", name: "gracePeriod", type: "uint256" }, - { internalType: "uint256", name: "minimumDelay", type: "uint256" }, - { internalType: "uint256", name: "maximumDelay", type: "uint256" }, - { internalType: "address", name: "guardian", type: "address" }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: "uint256", name: "id", type: "uint256" }, - ], - name: "ActionsSetCanceled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: "uint256", name: "id", type: "uint256" }, - { - indexed: true, - internalType: "address", - name: "initiatorExecution", - type: "address", - }, - { - indexed: false, - internalType: "bytes[]", - name: "returnedData", - type: "bytes[]", - }, - ], - name: "ActionsSetExecuted", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: "uint256", name: "id", type: "uint256" }, - { - indexed: false, - internalType: "address[]", - name: "targets", - type: "address[]", - }, - { - indexed: false, - internalType: "uint256[]", - name: "values", - type: "uint256[]", - }, - { - indexed: false, - internalType: "string[]", - name: "signatures", - type: "string[]", - }, - { - indexed: false, - internalType: "bytes[]", - name: "calldatas", - type: "bytes[]", - }, - { - indexed: false, - internalType: "bool[]", - name: "withDelegatecalls", - type: "bool[]", - }, - { - indexed: false, - internalType: "uint256", - name: "executionTime", - type: "uint256", - }, - ], - name: "ActionsSetQueued", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "previousDelay", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "newDelay", - type: "uint256", - }, - ], - name: "DelayUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "previousFxChild", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "newFxChild", - type: "address", - }, - ], - name: "FxChildUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "previousFxRootSender", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "newFxRootSender", - type: "address", - }, - ], - name: "FxRootSenderUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "previousGracePeriod", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "newGracePeriod", - type: "uint256", - }, - ], - name: "GracePeriodUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "previousGuardian", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "newGuardian", - type: "address", - }, - ], - name: "GuardianUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "previousMaximumDelay", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "newMaximumDelay", - type: "uint256", - }, - ], - name: "MaximumDelayUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint256", - name: "previousMinimumDelay", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "newMinimumDelay", - type: "uint256", - }, - ], - name: "MinimumDelayUpdate", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "newAdmin", - type: "address", - }, - ], - name: "NewAdmin", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "bridge", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "initiatorChange", - type: "address", - }, - ], - name: "NewBridge", - type: "event", - }, - { - inputs: [ - { internalType: "uint256", name: "actionsSetId", type: "uint256" }, - ], - name: "cancel", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "actionsSetId", type: "uint256" }, - ], - name: "execute", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "target", type: "address" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "executeDelegateCall", - outputs: [ - { internalType: "bool", name: "", type: "bool" }, - { internalType: "bytes", name: "", type: "bytes" }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "actionsSetId", type: "uint256" }, - ], - name: "getActionsSetById", - outputs: [ - { - components: [ - { internalType: "address[]", name: "targets", type: "address[]" }, - { internalType: "uint256[]", name: "values", type: "uint256[]" }, - { internalType: "string[]", name: "signatures", type: "string[]" }, - { internalType: "bytes[]", name: "calldatas", type: "bytes[]" }, - { internalType: "bool[]", name: "withDelegatecalls", type: "bool[]" }, - { internalType: "uint256", name: "executionTime", type: "uint256" }, - { internalType: "bool", name: "executed", type: "bool" }, - { internalType: "bool", name: "canceled", type: "bool" }, - ], - internalType: "struct IBridgeExecutor.ActionsSet", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getActionsSetCount", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "actionsSetId", type: "uint256" }, - ], - name: "getCurrentState", - outputs: [ - { - internalType: "enum IBridgeExecutor.ActionsSetState", - name: "", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getDelay", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getFxChild", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getFxRootSender", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getGracePeriod", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getGuardian", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getMaximumDelay", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getMinimumDelay", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "bytes32", name: "actionHash", type: "bytes32" }], - name: "isActionQueued", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "stateId", type: "uint256" }, - { internalType: "address", name: "rootMessageSender", type: "address" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "processMessageFromRoot", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "receiveFunds", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "delay", type: "uint256" }], - name: "updateDelay", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "fxChild", type: "address" }], - name: "updateFxChild", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "fxRootSender", type: "address" }, - ], - name: "updateFxRootSender", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "gracePeriod", type: "uint256" }], - name: "updateGracePeriod", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "guardian", type: "address" }], - name: "updateGuardian", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "maximumDelay", type: "uint256" }, - ], - name: "updateMaximumDelay", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "minimumDelay", type: "uint256" }, - ], - name: "updateMinimumDelay", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -] as const; - -// block when the bridge executor was deployed -export const POLYGON_BRIDGE_EXECUTOR_START_BLOCK = 20939532n; diff --git a/src/simulate/govv2/networks/arbitrum.ts b/src/simulate/govv2/networks/arbitrum.ts deleted file mode 100644 index 3416c06..0000000 --- a/src/simulate/govv2/networks/arbitrum.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; -import { ActionSetState, L2NetworkModule } from './types'; -import { getContract } from 'viem'; -import { ARBITRUM_BRIDGE_EXECUTOR_ABI, ARBITRUM_BRIDGE_EXECUTOR_START_BLOCK } from '../abis/ArbitrumBridgeExecutor'; -import { arbitrumClient } from '../../../utils/rpcClients'; -import { getLogs } from '../../../utils/logs'; -import { Trace, tenderly } from '../../../utils/tenderlyClient'; -import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; - -const ARBITRUM_INBOX = '0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f'; // TODO: should probably be on address-book - -export const arbitrumExecutorContract = getContract({ - address: AaveGovernanceV2.ARBITRUM_BRIDGE_EXECUTOR, - abi: ARBITRUM_BRIDGE_EXECUTOR_ABI, - publicClient: arbitrumClient, -}); - -export const arbitrum: L2NetworkModule = - { - name: 'Arbitrum', - async cacheLogs() { - const queuedLogs = await getLogs(arbitrumClient, (fromBLock, toBlock) => - arbitrumExecutorContract.createEventFilter.ActionsSetQueued( - {}, - { - fromBlock: fromBLock || ARBITRUM_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock, - } - ) - ); - const executedLogs = await getLogs(arbitrumClient, (fromBLock, toBlock) => - arbitrumExecutorContract.createEventFilter.ActionsSetExecuted( - {}, - { - fromBlock: fromBLock || ARBITRUM_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock, - } - ) - ); - - return { queuedLogs, executedLogs }; - }, - findBridgeInMainnetCalls(calls) { - return calls.reduce((acc, call) => { - if ( - call.to?.toLowerCase() === ARBITRUM_INBOX.toLowerCase() && - call.function_name === 'unsafeCreateRetryableTicket' - ) { - return [...acc, call]; - } - if (call?.calls) { - return [...acc, ...arbitrum.findBridgeInMainnetCalls(call?.calls)]; - } - return acc; - }, [] as Array); - }, - getProposalState: (args) => - getProposalState({ - ...args, - dataValue: args.trace.decoded_input.find((input) => input.soltype!.name === 'data')!.value as `0x${string}`, - }), - async simulateOnTenderly({ state, executedLog, queuedLog, args }) { - if (state === ActionSetState.EXECUTED) { - const tx = await arbitrumClient.getTransaction({ hash: executedLog.transactionHash! }); - return tenderly.simulateTx(arbitrumClient.chain.id, tx); - } - if (state === ActionSetState.QUEUED) { - return simulateQueuedActionSet(arbitrumExecutorContract, arbitrumClient, queuedLog); - } - if (state === ActionSetState.NOT_FOUND) { - return simulateNewActionSet(arbitrumExecutorContract, arbitrumClient, args); - } - throw new Error(`Unexpected ActionSetState: ${state}`); - }, - }; diff --git a/src/simulate/govv2/networks/base.ts b/src/simulate/govv2/networks/base.ts deleted file mode 100644 index 512003f..0000000 --- a/src/simulate/govv2/networks/base.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; -import { ActionSetState, L2NetworkModule } from './types'; -import { getContract } from 'viem'; -import { OPTIMISM_BRIDGE_EXECUTOR_ABI } from '../abis/OptimismBridgeExecutor'; -import { baseClient } from '../../../utils/rpcClients'; -import { getLogs } from '../../../utils/logs'; -import { Trace, tenderly } from '../../../utils/tenderlyClient'; -import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; - -const BASE_L1_CROSS_DOMAIN_MESSENGER = '0x866E82a600A1414e583f7F13623F1aC5d58b0Afa'; - -const BASE_BRIDGE_EXECUTOR_START_BLOCK = 2135076n; - -export const baseExecutorContract = getContract({ - address: AaveGovernanceV2.BASE_BRIDGE_EXECUTOR, - abi: OPTIMISM_BRIDGE_EXECUTOR_ABI, - publicClient: baseClient, -}); - -export const base: L2NetworkModule = { - name: 'Base', - async cacheLogs() { - const queuedLogs = await getLogs(baseClient, (fromBLock, toBlock) => - baseExecutorContract.createEventFilter.ActionsSetQueued( - {}, - { - fromBlock: fromBLock || BASE_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock || BASE_BRIDGE_EXECUTOR_START_BLOCK + 1n, - } - ) - ); - const executedLogs = await getLogs(baseClient, (fromBLock, toBlock) => - baseExecutorContract.createEventFilter.ActionsSetExecuted( - {}, - { - fromBlock: fromBLock || BASE_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock || BASE_BRIDGE_EXECUTOR_START_BLOCK + 1n, - } - ) - ); - - return { queuedLogs, executedLogs }; - }, - findBridgeInMainnetCalls(calls) { - return calls.reduce((acc, call) => { - if ( - call.from?.toLowerCase() === BASE_L1_CROSS_DOMAIN_MESSENGER.toLowerCase() && - call.function_name == 'sendMessage' - ) { - return [...acc, call]; - } - if (call.calls) { - return [...acc, ...base.findBridgeInMainnetCalls(call.calls)]; - } - return acc; - }, [] as Array); - }, - getProposalState: ({ trace, ...args }) => - getProposalState({ - ...args, - dataValue: trace.decoded_input.find((input) => input.soltype!.name === '_message')!.value as `0x${string}`, - }), - async simulateOnTenderly({ state, executedLog, queuedLog, args }) { - if (state === ActionSetState.EXECUTED) { - const tx = await baseClient.getTransaction({ hash: executedLog.transactionHash! }); - return tenderly.simulateTx(baseClient.chain.id, tx); - } - if (state === ActionSetState.QUEUED) { - return simulateQueuedActionSet(baseExecutorContract, baseClient, queuedLog); - } - if (state === ActionSetState.NOT_FOUND) { - return simulateNewActionSet(baseExecutorContract, baseClient, args); - } - throw new Error(`Unexpected ActionSetState: ${state}`); - }, -}; diff --git a/src/simulate/govv2/networks/commonL2.ts b/src/simulate/govv2/networks/commonL2.ts deleted file mode 100644 index d18dc8b..0000000 --- a/src/simulate/govv2/networks/commonL2.ts +++ /dev/null @@ -1,347 +0,0 @@ -import { - Abi, - GetContractReturnType, - Hex, - PublicClient, - decodeFunctionData, - encodeAbiParameters, - encodeFunctionData, - fromHex, - keccak256, - pad, - toHex, -} from 'viem'; -import { Trace, tenderly } from '../../../utils/tenderlyClient'; -import { EOA } from '../../../utils/constants'; -import { - getBytesValue, - getDynamicArraySlot, - getSolidityStorageSlotBytes, - getSolidityStorageSlotUint, -} from '../../../utils/storageSlots'; -import { ActionSetState, FilterLogWithTimestamp, FormattedArgs } from './types'; - -/** - * The executors are slightly different, but the execute signature is always the same - */ -const executorABI = [ - { - inputs: [], - name: 'getActionsSetCount', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getGracePeriod', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - stateMutability: 'view', - type: 'function', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'id', type: 'uint256' }, - { - indexed: true, - internalType: 'address', - name: 'initiatorExecution', - type: 'address', - }, - { - indexed: false, - internalType: 'bytes[]', - name: 'returnedData', - type: 'bytes[]', - }, - ], - name: 'ActionsSetExecuted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'uint256', name: 'id', type: 'uint256' }, - { - indexed: false, - internalType: 'address[]', - name: 'targets', - type: 'address[]', - }, - { - indexed: false, - internalType: 'uint256[]', - name: 'values', - type: 'uint256[]', - }, - { - indexed: false, - internalType: 'string[]', - name: 'signatures', - type: 'string[]', - }, - { - indexed: false, - internalType: 'bytes[]', - name: 'calldatas', - type: 'bytes[]', - }, - { - indexed: false, - internalType: 'bool[]', - name: 'withDelegatecalls', - type: 'bool[]', - }, - { - indexed: false, - internalType: 'uint256', - name: 'executionTime', - type: 'uint256', - }, - ], - name: 'ActionsSetQueued', - type: 'event', - }, - { - inputs: [{ internalType: 'uint256', name: 'actionsSetId', type: 'uint256' }], - name: 'execute', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { internalType: 'address[]', name: 'targets', type: 'address[]' }, - { internalType: 'uint256[]', name: 'values', type: 'uint256[]' }, - { internalType: 'string[]', name: 'signatures', type: 'string[]' }, - { internalType: 'bytes[]', name: 'calldatas', type: 'bytes[]' }, - { internalType: 'bool[]', name: 'withDelegatecalls', type: 'bool[]' }, - ], - name: 'queue', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export interface GetProposalStateProps { - queuedLogs: Array>; - executedLogs: Array>; - dataValue: Hex; - // earliest timestamp to look for events (latest mainnet event) - fromTimestamp: number; -} - -export function formatArgs(rawArgs: any): FormattedArgs { - return { - targets: rawArgs[0], - values: rawArgs[1], - signatures: rawArgs[2], - calldatas: rawArgs[3], - withDelegatecalls: rawArgs[4], - }; -} - -export async function getProposalStateById({ - queuedLogs, - executedLogs, - proposalId, -}: GetProposalStateProps & { proposalId: number }) { - const queuedLog = queuedLogs.find((event) => Number(event.args.id) === Number(proposalId)); - if (queuedLog) { - const executedLog = executedLogs.find((event) => Number(event.args.id) == Number(proposalId)); - if (executedLog) { - return { executedLog: executedLog, queuedLog: queuedLog, state: ActionSetState.EXECUTED }; - } else { - return { queuedLog: queuedLog, state: ActionSetState.QUEUED }; - } - } - return { state: ActionSetState.NOT_FOUND }; -} - -export async function getProposalState({ - queuedLogs, - executedLogs, - dataValue, - fromTimestamp, -}: GetProposalStateProps) { - const { args: rawArgs } = decodeFunctionData({ - abi: executorABI, - data: dataValue, - }); - if (!rawArgs) throw new Error('Error: cannot decode trace'); - const args = formatArgs(rawArgs); - const queuedLog = queuedLogs.find( - (event) => - event.timestamp > fromTimestamp && - JSON.stringify(event.args.targets) == JSON.stringify(args.targets) && - JSON.stringify(event.args.calldatas) == JSON.stringify(args.calldatas) - ); - if (queuedLog) { - args.proposalId = queuedLog.args.id; - const executedLog = executedLogs.find((event) => event.args.id == queuedLog.args.id); - if (executedLog) { - return { executedLog: executedLog, queuedLog: queuedLog, state: ActionSetState.EXECUTED, args }; - } else { - return { queuedLog: queuedLog, state: ActionSetState.QUEUED, args }; - } - } - return { state: ActionSetState.NOT_FOUND, args }; -} - -export async function getTenderlyActionSetExecutionPayload( - executorContract: GetContractReturnType, - client: PublicClient, - log: any -) { - const gracePeriod = await executorContract.read.getGracePeriod(); - const currentBlock = await client.getBlock(); - /** - * When the proposal is expired, simulate one block after queuing - * When the proposal could still be executed, simulate on current block - */ - const simulationBlock = - currentBlock.timestamp > BigInt(log.args.executionTime!) + gracePeriod - ? Number(log!.blockNumber) + 1 - : (currentBlock.number as bigint) - BigInt(1); - - const simulationPayload = { - network_id: String(client.chain!.id), - from: EOA, - to: executorContract.address, - block_number: Number(simulationBlock), - input: encodeFunctionData({ - abi: executorABI, - functionName: 'execute', - args: [log!.args.id!], - }), - block_header: { - timestamp: toHex(BigInt(log.args.executionTime!)), - }, - }; - return simulationPayload; -} - -export async function simulateQueuedActionSet( - executorContract: GetContractReturnType, - client: PublicClient, - log: any -) { - const payload = await getTenderlyActionSetExecutionPayload(executorContract, client, log); - return tenderly.simulate(payload); -} - -export async function getTenderlyActionSetCreationPayload( - executorContract: GetContractReturnType, - client: PublicClient, - args: FormattedArgs -) { - const latestBlock = await client.getBlock(); - const currentCount = await executorContract.read.getActionsSetCount(); - const actionSetHash = fromHex(getSolidityStorageSlotUint(6n, currentCount), 'bigint'); - /** - * struct ActionsSet { - * address[] targets; //0 - * uint256[] values; //1 - * string[] signatures; //2 - * bytes[] calldatas; //3 - * bool[] withDelegatecalls; //4 - * uint256 executionTime; //5 - * bool executed; //6 - * bool canceled; - * } - */ - const proposalStorage: { [key: `0x${string}`]: number | string | boolean } = {}; - // targets - proposalStorage[toHex(actionSetHash)] = pad(toHex(args.targets.length), { size: 32 }); - args.targets.map((target, index) => { - proposalStorage[getDynamicArraySlot(actionSetHash, index, 1)] = pad(target, { size: 32 }) as Hex; - }); - // values - proposalStorage[toHex(actionSetHash + 1n)] = pad(toHex(args.values.length), { size: 32 }); - args.values.map((value, index) => { - proposalStorage[getDynamicArraySlot(actionSetHash + 1n, index, 1)] = pad(toHex(value), { size: 32 }); - }); - // signatures - proposalStorage[toHex(actionSetHash + 2n)] = pad(toHex(args.signatures.length), { size: 32 }); - args.signatures.map((signature, index) => { - proposalStorage[getDynamicArraySlot(actionSetHash + 2n, index, 1)] = getBytesValue(signature); - }); - // calldatas - proposalStorage[toHex(actionSetHash + 3n)] = pad(toHex(args.calldatas.length), { size: 32 }); - args.calldatas.map((calldata, index) => { - proposalStorage[getDynamicArraySlot(actionSetHash + 3n, index, 1)] = getBytesValue(calldata); - }); - // withDelegateCalls - proposalStorage[toHex(actionSetHash + 4n)] = pad(toHex(args.withDelegatecalls.length), { size: 32 }); - args.withDelegatecalls.map((withDelegateCalls, index) => { - proposalStorage[getDynamicArraySlot(actionSetHash + 4n, index, 1)] = pad(toHex(withDelegateCalls), { - size: 32, - }); - }); - // executionTime - proposalStorage[pad(toHex(actionSetHash + 5n), { size: 32 })] = pad(toHex(latestBlock.timestamp), { size: 32 }); - // queued hashes - const hashes = args.targets.reduce((acc, target, index) => { - const actionHash = keccak256( - encodeAbiParameters( - [ - { name: 'target', type: 'address' }, - { name: 'value', type: 'uint256' }, - { name: 'signature', type: 'string' }, - { name: 'calldata', type: 'bytes' }, - { name: 'executionTime', type: 'uint256' }, - { name: 'withDelegatecall', type: 'bool' }, - ], - [ - args.targets[index], - args.values[index], - args.signatures[index], - args.calldatas[index], - latestBlock.timestamp, - args.withDelegatecalls[index], - ] - ) - ); - acc[getSolidityStorageSlotBytes(toHex(7), actionHash)] = pad(toHex(true), { size: 32 }); - return acc; - }, {} as { [key: Hex]: Hex }); - - const payload = { - network_id: String(client.chain!.id), - from: EOA, - to: executorContract.address, - state_objects: { - [executorContract.address]: { - storage: { - // _actionsSetCounter slot - [pad(toHex(5), { size: 32 })]: pad(toHex(currentCount + 1n), { size: 32 }), - // _actionsSets - ...proposalStorage, - // _queuedActions - ...hashes, - }, - }, - }, - input: encodeFunctionData({ - abi: executorABI, - functionName: 'execute', - args: [currentCount], - }), - block_header: { - timestamp: toHex(latestBlock.timestamp), - number: toHex(latestBlock.number!), - }, - }; - return payload; -} - -export async function simulateNewActionSet( - executorContract: GetContractReturnType, - client: PublicClient, - args: FormattedArgs -) { - const payload = await getTenderlyActionSetCreationPayload(executorContract, client, args); - return tenderly.simulate(payload); -} diff --git a/src/simulate/govv2/networks/mainnet.ts b/src/simulate/govv2/networks/mainnet.ts deleted file mode 100644 index 6aeb2a2..0000000 --- a/src/simulate/govv2/networks/mainnet.ts +++ /dev/null @@ -1,231 +0,0 @@ -import { AaveGovernanceV2, IAaveGovernanceV2_ABI } from '@bgd-labs/aave-address-book'; -import { ActionSetState, L2NetworkModule, MainnetModule, ProposalState } from './types'; -import { - PublicClient, - WalletClient, - concat, - encodeAbiParameters, - encodeFunctionData, - fromHex, - getContract, - keccak256, - pad, - parseAbiParameters, - parseEther, - toHex, -} from 'viem'; -import { mainnetClient } from '../../../utils/rpcClients'; -import { getLogs } from '../../../utils/logs'; -import { Trace, tenderly } from '../../../utils/tenderlyClient'; -import { EOA } from '../../../utils/constants'; -import { AAVE_GOVERNANCE_V2_START_BLOCK, getAaveGovernanceV2Slots } from '../abis/AaveGovernanceV2'; -import { EXECUTOR_ABI } from '../abis/Executor'; -import { getSolidityStorageSlotBytes } from '../../../utils/storageSlots'; -import { ARC_TIMELOCK_ABI } from '../abis/ArcTimelock'; -import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; - -export const getGovernanceV2Contract = ({ - publicClient, - walletClient, -}: { - publicClient: PublicClient; - walletClient?: WalletClient; -}) => { - if (walletClient) { - return getContract({ - address: AaveGovernanceV2.GOV, - abi: IAaveGovernanceV2_ABI, - walletClient, - publicClient, - }); - } - return getContract({ - address: AaveGovernanceV2.GOV, - abi: IAaveGovernanceV2_ABI, - publicClient, - }); -}; - -const aaveGovernanceV2Contract = getGovernanceV2Contract({ publicClient: mainnetClient }); - -export const mainnet: MainnetModule = { - name: 'Mainnet', - async cacheLogs() { - const createdLogs = await getLogs(mainnetClient, (fromBlock, toBlock) => - aaveGovernanceV2Contract.createEventFilter.ProposalCreated( - {}, - { - fromBlock: fromBlock || AAVE_GOVERNANCE_V2_START_BLOCK, - toBlock: toBlock, - } - ) - ); - const queuedLogs = await getLogs(mainnetClient, (fromBlock, toBlock) => - aaveGovernanceV2Contract.createEventFilter.ProposalQueued( - {}, - { - fromBlock: fromBlock || AAVE_GOVERNANCE_V2_START_BLOCK, - toBlock: toBlock, - } - ) - ); - const executedLogs = await getLogs(mainnetClient, (fromBlock, toBlock) => - aaveGovernanceV2Contract.createEventFilter.ProposalExecuted( - {}, - { - fromBlock: fromBlock || AAVE_GOVERNANCE_V2_START_BLOCK, - toBlock: toBlock, - } - ) - ); - - return { queuedLogs, executedLogs, createdLogs }; - }, - getProposalState({ proposalId, createdLogs, queuedLogs, executedLogs }) { - const executedLog = executedLogs.find((log) => log.args.id == proposalId); - if (executedLog) return { log: executedLog, state: ProposalState.EXECUTED }; - const queuedLog = queuedLogs.find((log) => log.args.id == proposalId); - if (queuedLog) return { log: queuedLog, state: ProposalState.QUEUED }; - const createdLog = createdLogs.find((log) => log.args.id == proposalId); - if (createdLog) return { log: createdLog, state: ProposalState.CREATED }; - throw new Error('Proposal not found'); - }, - async simulateOnTenderly({ state, log, proposalId }) { - const proposal = await aaveGovernanceV2Contract.read.getProposalById([proposalId]); - if (state === ProposalState.EXECUTED) { - const tx = await mainnetClient.getTransaction({ hash: log.transactionHash! }); - return { proposal, simulation: await tenderly.simulateTx(mainnetClient.chain.id, tx) }; - } - const slots = getAaveGovernanceV2Slots(proposalId, proposal.executor); - const executorContract = getContract({ - address: proposal.executor, - abi: EXECUTOR_ABI, - publicClient: mainnetClient, - }); - const duration = await executorContract.read.VOTING_DURATION(); - const delay = await executorContract.read.getDelay(); - /** - * For proposals that are still pending it might happen that the startBlock is not mined yet. - * Therefore in this case we need to estimate the startTimestamp. - */ - const latestBlock = await mainnetClient.getBlock(); - const isStartBlockMinted = latestBlock.number! < proposal.startBlock; - const startTimestamp = isStartBlockMinted - ? latestBlock.timestamp + (proposal.startBlock - latestBlock.number!) * 12n - : (await mainnetClient.getBlock({ blockNumber: proposal.startBlock })).timestamp; - - const endBlockNumber = proposal.startBlock + duration + 2n; - const isEndBlockMinted = latestBlock.number! > endBlockNumber; - - // construct earliest possible header for execution - const blockHeader = { - timestamp: toHex(startTimestamp + (duration + 1n) * 12n + delay + 1n), - number: toHex(endBlockNumber), - }; - - const simulationPayload = { - network_id: String(mainnetClient.chain.id), - block_number: Number(isEndBlockMinted ? endBlockNumber : latestBlock.number), - from: EOA, - to: AaveGovernanceV2.GOV, - gas_price: '0', - value: proposal.values.reduce((sum, cur) => sum + cur).toString(), - gas: 30_000_000, - input: encodeFunctionData({ - abi: IAaveGovernanceV2_ABI, - functionName: 'execute', - args: [proposalId], - }), - block_header: blockHeader, - state_objects: { - // Give `from` address 10 ETH to send transaction - [EOA]: { balance: parseEther('10').toString() }, - // Ensure transactions are queued in the executor - [proposal.executor]: { - storage: proposal.targets.reduce((acc, target, i) => { - const hash = keccak256( - encodeAbiParameters(parseAbiParameters('address, uint256, string, bytes, uint256, bool'), [ - target, - proposal.values[i], - proposal.signatures[i], - proposal.calldatas[i], - fromHex(blockHeader.timestamp, 'bigint'), - proposal.withDelegatecalls[i], - ]) - ); - const slot = getSolidityStorageSlotBytes(slots.queuedTxsSlot, hash); - acc[slot] = pad('0x1', { size: 32 }); - return acc; - }, {} as any), - }, - [AaveGovernanceV2.GOV]: { - storage: { - [slots.eta]: pad(blockHeader.timestamp, { size: 32 }), - [slots.forVotes]: pad(toHex(parseEther('3000000')), { size: 32 }), - [slots.againstVotes]: pad('0x0', { size: 32 }), - [slots.canceled]: pad(concat([AaveGovernanceV2.GOV_STRATEGY, '0x0000']), { size: 32 }), - }, - }, - }, - }; - return { proposal, simulation: await tenderly.simulate(simulationPayload) }; - }, -}; - -const arcContract = getContract({ - address: AaveGovernanceV2.ARC_TIMELOCK, - abi: ARC_TIMELOCK_ABI, - publicClient: mainnetClient, -}); - -export const arc: L2NetworkModule = { - name: 'Arc', - async cacheLogs() { - const queuedLogs = await getLogs(mainnetClient, (fromBLock, toBlock) => - arcContract.createEventFilter.ActionsSetQueued({ - fromBlock: fromBLock || 13581293n, - toBlock: toBlock, - }) - ); - const executedLogs = await getLogs(mainnetClient, (fromBLock, toBlock) => - arcContract.createEventFilter.ActionsSetExecuted( - {}, - { - fromBlock: fromBLock || 13581293n, - toBlock: toBlock, - } - ) - ); - - return { queuedLogs, executedLogs }; - }, - findBridgeInMainnetCalls(calls) { - return calls.reduce((acc, call) => { - if (call.to?.toLowerCase() === AaveGovernanceV2.ARC_TIMELOCK.toLowerCase() && call.function_name == 'queue') { - return [...acc, call]; - } - if (call?.calls) { - return [...acc, ...arc.findBridgeInMainnetCalls(call?.calls)]; - } - return acc; - }, [] as Array); - }, - getProposalState: ({ trace, ...args }) => - getProposalState({ - ...args, - dataValue: trace.input, - } as any), - async simulateOnTenderly({ state, executedLog, queuedLog, args }) { - if (state === ActionSetState.EXECUTED) { - const tx = await mainnetClient.getTransaction({ hash: executedLog.transactionHash! }); - return tenderly.simulateTx(mainnetClient.chain.id, tx); - } - if (state === ActionSetState.QUEUED) { - return simulateQueuedActionSet(arcContract as any, mainnetClient, queuedLog); - } - if (state === ActionSetState.NOT_FOUND) { - return simulateNewActionSet(arcContract as any, mainnetClient, args); - } - throw new Error(`Unexpected ActionSetState: ${state}`); - }, -}; diff --git a/src/simulate/govv2/networks/metis.ts b/src/simulate/govv2/networks/metis.ts deleted file mode 100644 index 96723ec..0000000 --- a/src/simulate/govv2/networks/metis.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; -import { L2NetworkModule } from './types'; -import { getContract } from 'viem'; -import { METIS_BRIDGE_EXECUTOR_START_BLOCK, METIS_BRIDGE_EXECUTOR_ABI } from '../abis/MetisBridgeExecutor'; -import { metisClient } from '../../../utils/rpcClients'; -import { getLogs } from '../../../utils/logs'; -import { Trace } from '../../../utils/tenderlyClient'; -import { getProposalState } from './commonL2'; -import { OPTIMISM_BRIDGE_EXECUTOR_ABI } from '../abis/OptimismBridgeExecutor'; - -const METIS_L1_CROSS_COMAIN_MESSENGER = '0x081D1101855bD523bA69A9794e0217F0DB6323ff'; - -const arbitrumExecutorContract = getContract({ - address: AaveGovernanceV2.METIS_BRIDGE_EXECUTOR, - abi: METIS_BRIDGE_EXECUTOR_ABI, - publicClient: metisClient, -}); - -export const metis: L2NetworkModule = { - name: 'Metis', - async cacheLogs() { - const queuedLogs = await getLogs(metisClient, (fromBLock, toBlock) => - arbitrumExecutorContract.createEventFilter.ActionsSetQueued( - {}, - { - fromBlock: fromBLock || METIS_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock, - } - ) - ); - const executedLogs = await getLogs(metisClient, (fromBLock, toBlock) => - arbitrumExecutorContract.createEventFilter.ActionsSetExecuted( - {}, - { - fromBlock: fromBLock || METIS_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock, - } - ) - ); - - return { queuedLogs, executedLogs }; - }, - findBridgeInMainnetCalls(calls) { - return calls.reduce((acc, call) => { - if ( - call.from?.toLowerCase() === METIS_L1_CROSS_COMAIN_MESSENGER.toLowerCase() && - call.function_name == 'sendMessage' - ) { - return [...acc, call]; - } - if (call?.calls) { - return [...acc, ...metis.findBridgeInMainnetCalls(call?.calls)]; - } - return acc; - }, [] as Array); - }, - getProposalState: (args) => - getProposalState({ - ...args, - dataValue: args.trace.decoded_input.find((input) => input.soltype!.name === '_message')!.value as `0x${string}`, - }), - // Tenderly doesn't support metis - // async simulateOnTenderly({ state, log, trace }) { - // if (state === ActionSetState.EXECUTED) { - // return tenderly.trace(metisClient.chain.id, log.transactionHash!); - // } - // if (state === ActionSetState.QUEUED) { - // const gracePeriod = await arbitrumExecutorContract.read.getGracePeriod(); - // const currentBlock = await metisClient.getBlock(); - // /** - // * When the proposal is expired, simulate one block after queuing - // * When the proposal could still be executed, simulate on current block - // */ - // const simulationBlock = - // currentBlock.timestamp > BigInt(log.args.executionTime!) + gracePeriod - // ? Number(log!.blockNumber) + 1 - // : (currentBlock.number as bigint) - BigInt(1); - - // const simulationPayload = { - // network_id: String(metisClient.chain.id), - // from: EOA, - // to: AaveGovernanceV2.METIS_BRIDGE_EXECUTOR, - // block_number: Number(simulationBlock), - // input: encodeFunctionData({ - // abi: METIS_BRIDGE_EXECUTOR_ABI, - // functionName: 'execute', - // args: [log!.args.id!], - // }), - // block_header: { - // timestamp: toHex(BigInt(log.args.executionTime!)), - // }, - // }; - // return tenderly.simulate(simulationPayload); - // } - // if (state === ActionSetState.NOT_FOUND) { - // const dataValue = trace.decoded_input.find((input) => input.soltype.name === '_message').value as `0x${string}`; - // const simulationPayload = { - // network_id: String(metisClient.chain.id), - // from: EOA, - // to: AaveGovernanceV2.METIS_BRIDGE_EXECUTOR, - // input: dataValue, - // state_objects: { - // [AaveGovernanceV2.METIS_BRIDGE_EXECUTOR]: { - // code: MOCK_EXECUTOR_BYTECODE, - // }, - // }, - // }; - // const queueResult = await tenderly.simulate(simulationPayload); - - // const queueState = queueResult.transaction.transaction_info.state_diff.reduce((acc, diff) => { - // diff.raw.forEach((raw) => { - // if (!acc[raw.address]) acc[raw.address] = { storage: {} }; - // acc[raw.address].storage![raw.key] = raw.dirty; - // }); - // return acc; - // }, {} as Record); - // queueState[AaveGovernanceV2.METIS_BRIDGE_EXECUTOR] = { - // code: MOCK_EXECUTOR_BYTECODE, - // }; - // const id = queueResult.transaction.transaction_info.state_diff.find( - // (diff) => - // diff.address.toLowerCase() === AaveGovernanceV2.METIS_BRIDGE_EXECUTOR.toLowerCase() && - // diff.soltype?.name === '_actionsSetCounter' - // ); - - // return await tenderly.simulate({ - // ...simulationPayload, - // state_objects: queueState, - // input: encodeFunctionData({ - // abi: METIS_BRIDGE_EXECUTOR_ABI, - // functionName: 'execute', - // args: [id.original], - // }), - // }); - // } - // }, -}; diff --git a/src/simulate/govv2/networks/optimism.ts b/src/simulate/govv2/networks/optimism.ts deleted file mode 100644 index 811c728..0000000 --- a/src/simulate/govv2/networks/optimism.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; -import { ActionSetState, L2NetworkModule } from './types'; -import { getContract } from 'viem'; -import { OPTIMISM_BRIDGE_EXECUTOR_ABI, OPTIMISM_BRIDGE_EXECUTOR_START_BLOCK } from '../abis/OptimismBridgeExecutor'; -import { mainnetClient, optimismClient } from '../../../utils/rpcClients'; -import { getLogs } from '../../../utils/logs'; -import { Trace, tenderly } from '../../../utils/tenderlyClient'; -import { getProposalState, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; - -const OPTIMISM_L1_CROSS_COMAIN_MESSENGER = '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1'; - -export const optimismExecutorContract = getContract({ - address: AaveGovernanceV2.OPTIMISM_BRIDGE_EXECUTOR, - abi: OPTIMISM_BRIDGE_EXECUTOR_ABI, - publicClient: optimismClient, -}); - -export const optimism: L2NetworkModule = - { - name: 'Optimism', - async cacheLogs() { - const queuedLogs = await getLogs(optimismClient, (fromBLock, toBlock) => - optimismExecutorContract.createEventFilter.ActionsSetQueued( - {}, - { - fromBlock: fromBLock || OPTIMISM_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock, - } - ) - ); - const executedLogs = await getLogs(optimismClient, (fromBLock, toBlock) => - optimismExecutorContract.createEventFilter.ActionsSetExecuted( - {}, - { - fromBlock: fromBLock || OPTIMISM_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock, - } - ) - ); - - return { queuedLogs, executedLogs }; - }, - findBridgeInMainnetCalls(calls) { - return calls.reduce((acc, call) => { - if ( - call.from?.toLowerCase() === OPTIMISM_L1_CROSS_COMAIN_MESSENGER.toLowerCase() && - call.function_name == 'sendMessage' - ) { - return [...acc, call]; - } - if (call.calls) { - return [...acc, ...optimism.findBridgeInMainnetCalls(call.calls)]; - } - return acc; - }, [] as Array); - }, - getProposalState: ({ trace, ...args }) => - getProposalState({ - ...args, - dataValue: trace.decoded_input.find((input) => input.soltype!.name === '_message')!.value as `0x${string}`, - }), - async simulateOnTenderly({ state, executedLog, queuedLog, args }) { - if (state === ActionSetState.EXECUTED) { - const tx = await optimismClient.getTransaction({ hash: executedLog.transactionHash! }); - return tenderly.simulateTx(optimismClient.chain.id, tx); - } - if (state === ActionSetState.QUEUED) { - return simulateQueuedActionSet(optimismExecutorContract, optimismClient, queuedLog); - } - if (state === ActionSetState.NOT_FOUND) { - return simulateNewActionSet(optimismExecutorContract, optimismClient, args); - } - throw new Error(`Unexpected ActionSetState: ${state}`); - }, - }; diff --git a/src/simulate/govv2/networks/polygon.ts b/src/simulate/govv2/networks/polygon.ts deleted file mode 100644 index 42e8113..0000000 --- a/src/simulate/govv2/networks/polygon.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { AaveGovernanceV2 } from '@bgd-labs/aave-address-book'; -import { ActionSetState, L2NetworkModule } from './types'; -import { decodeAbiParameters, getContract } from 'viem'; -import { polygonClient } from '../../../utils/rpcClients'; -import { getLogs } from '../../../utils/logs'; -import { Trace, tenderly } from '../../../utils/tenderlyClient'; -import { POLYGON_BRIDGE_EXECUTOR_ABI, POLYGON_BRIDGE_EXECUTOR_START_BLOCK } from '../abis/PolygonBridgeExecutor'; -import { formatArgs, simulateNewActionSet, simulateQueuedActionSet } from './commonL2'; - -const POLYGON_FX_ROOT = '0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2'; - -export const polygonExecutorContract = getContract({ - address: AaveGovernanceV2.POLYGON_BRIDGE_EXECUTOR, - abi: POLYGON_BRIDGE_EXECUTOR_ABI, - publicClient: polygonClient, -}); - -export const polygon: L2NetworkModule = { - name: 'Polygon', - async cacheLogs() { - const queuedLogs = await getLogs(polygonClient, (fromBLock, toBlock) => - polygonExecutorContract.createEventFilter.ActionsSetQueued({ - fromBlock: fromBLock || POLYGON_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock, - }) - ); - const executedLogs = await getLogs(polygonClient, (fromBLock, toBlock) => - polygonExecutorContract.createEventFilter.ActionsSetExecuted( - {}, - { - fromBlock: fromBLock || POLYGON_BRIDGE_EXECUTOR_START_BLOCK, - toBlock: toBlock, - } - ) - ); - - return { queuedLogs, executedLogs }; - }, - findBridgeInMainnetCalls(calls) { - return calls.reduce((acc, call) => { - if (call.to?.toLowerCase() === POLYGON_FX_ROOT.toLowerCase() && call.function_name === 'sendMessageToChild') { - return [...acc, call]; - } - if (call.calls) { - return [...acc, ...polygon.findBridgeInMainnetCalls(call.calls)]; - } - return acc; - }, [] as Array); - }, - getProposalState({ trace, queuedLogs, executedLogs }) { - const dataValue = trace.decoded_input.find((input) => input.soltype.name === '_data').value as `0x${string}`; - const rawArgs = decodeAbiParameters( - [ - { name: 'targets', type: 'address[]' }, - { name: 'values', type: 'uint256[]' }, - { name: 'signatures', type: 'string[]' }, - { name: 'calldatas', type: 'bytes[]' }, - { name: 'withDelegatecalls', type: 'bool[]' }, - ], - dataValue - ); - if (!rawArgs) throw new Error('Error: cannot decode trace'); - const args = formatArgs(rawArgs); - - const queuedLog = queuedLogs.find((event) => JSON.stringify(event.args.targets) == JSON.stringify(args.targets)); - if (queuedLog) { - args.proposalId = queuedLog.args.id; - const executedLog = executedLogs.find((event) => event.args.id == queuedLog.args.id); - if (executedLog) { - return { executedLog: executedLog, queuedLog: queuedLog, state: ActionSetState.EXECUTED, args }; - } else { - return { queuedLog: queuedLog, state: ActionSetState.QUEUED, args }; - } - } - return { state: ActionSetState.NOT_FOUND, args }; - }, - async simulateOnTenderly({ state, executedLog, queuedLog, args }) { - if (state === ActionSetState.EXECUTED) { - const tx = await polygonClient.getTransaction({ hash: executedLog.transactionHash! }); - return tenderly.simulateTx(polygonClient.chain.id, tx); - } - if (state === ActionSetState.QUEUED) { - return simulateQueuedActionSet(polygonExecutorContract, polygonClient, queuedLog); - } - if (state === ActionSetState.NOT_FOUND) { - return simulateNewActionSet(polygonExecutorContract, polygonClient, args); - } - throw new Error(`Unexpected ActionSetState: ${state}`); - }, -}; diff --git a/src/simulate/govv2/networks/types.ts b/src/simulate/govv2/networks/types.ts deleted file mode 100644 index 0dc1722..0000000 --- a/src/simulate/govv2/networks/types.ts +++ /dev/null @@ -1,113 +0,0 @@ -import type { Abi } from 'abitype'; -import { TenderlySimulationResponse, Trace } from '../../../utils/tenderlyClient'; -import { GetFilterLogsReturnType, Hex, ReadContractReturnType } from 'viem'; -import { GetProposalStateProps, getProposalState } from './commonL2'; -import { IAaveGovernanceV2_ABI } from '@bgd-labs/aave-address-book'; - -export type FormattedArgs = { - targets: Hex[]; - values: bigint[]; - signatures: string[]; - calldatas: Hex[]; - withDelegatecalls: boolean[]; - proposalId?: bigint; -}; - -type ArrayElement = ArrayType extends readonly (infer ElementType)[] - ? ElementType - : never; - -export enum ActionSetState { - NOT_FOUND, - QUEUED, - EXECUTED, -} - -export type FilterLogWithTimestamp = ArrayElement< - GetFilterLogsReturnType -> & { timestamp: number }; - -export interface L2NetworkModule { - name: 'Optimism' | 'Polygon' | 'Arbitrum' | 'Metis' | 'Arc'; - cacheLogs: () => Promise<{ - queuedLogs: Array>; - executedLogs: Array>; - }>; - findBridgeInMainnetCalls: ( - calls: TenderlySimulationResponse['transaction']['transaction_info']['call_trace']['calls'] - ) => Array; - getProposalState: ( - args: Omit, 'dataValue'> & { trace: Trace; fromTimestamp: number } - ) => ReturnType; - simulateOnTenderly?: ( - args: { - args: FormattedArgs; - } & ( - | { - state: ActionSetState.EXECUTED; - executedLog: FilterLogWithTimestamp; - queuedLog: FilterLogWithTimestamp; - } - | { - state: ActionSetState.QUEUED; - queuedLog: FilterLogWithTimestamp; - executedLog?: undefined; - } - | { state: ActionSetState.NOT_FOUND; queuedLog?: undefined; executedLog?: undefined } - ) - ) => Promise; -} - -export enum ProposalState { - CREATED, - QUEUED, - EXECUTED, -} - -export interface MainnetModule { - name: string; - cacheLogs: () => Promise<{ - createdLogs: Array>; - queuedLogs: Array>; - executedLogs: Array>; - }>; - getProposalState: (args: { - proposalId: bigint; - createdLogs: Array>; - queuedLogs: Array>; - executedLogs: Array>; - }) => - | { - state: ProposalState.EXECUTED; - log: FilterLogWithTimestamp; - } - | { - state: ProposalState.QUEUED; - log: FilterLogWithTimestamp; - } - | { - state: ProposalState.CREATED; - log: FilterLogWithTimestamp; - }; - simulateOnTenderly: ( - args: { - proposalId: bigint; - } & ( - | { - state: ProposalState.EXECUTED; - log: FilterLogWithTimestamp; - } - | { - state: ProposalState.QUEUED; - log: FilterLogWithTimestamp; - } - | { - state: ProposalState.CREATED; - log: FilterLogWithTimestamp; - } - ) - ) => Promise<{ - proposal: ReadContractReturnType; - simulation: TenderlySimulationResponse; - }>; -} diff --git a/src/simulate/govv2/simulate.ts b/src/simulate/govv2/simulate.ts deleted file mode 100644 index f325376..0000000 --- a/src/simulate/govv2/simulate.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { logError, logInfo, logSuccess } from '../../utils/logger'; -import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; -import { arbitrum } from './networks/arbitrum'; -import { arc, mainnet } from './networks/mainnet'; -import { optimism } from './networks/optimism'; -import { polygon } from './networks/polygon'; -import { base } from './networks/base'; -import { ActionSetState, FormattedArgs } from './networks/types'; - -const l2Modules = [arbitrum, polygon, optimism, arc, base]; - -export async function simulateProposal(proposalId: bigint) { - logInfo(mainnet.name, 'Updating events cache'); - const mainnetCache = await mainnet.cacheLogs(); - - logInfo(mainnet.name, 'Fetching latest known proposal state'); - const mainnetState = await mainnet.getProposalState({ - ...mainnetCache, - proposalId, - }); - - logInfo(mainnet.name, 'Simulate on tenderly'); - const { proposal, simulation: mainnetSimulationResult } = await mainnet.simulateOnTenderly({ - ...mainnetState, - proposalId, - }); - const subResults: { - name: string; - simulation: TenderlySimulationResponse; - state: ActionSetState; - args: FormattedArgs; - }[] = []; - for (const module of l2Modules) { - logInfo(module.name, 'Updating events cache'); - const moduleBridgeTraces = await module.findBridgeInMainnetCalls( - mainnetSimulationResult.transaction?.transaction_info.call_trace.calls - ); - - if (moduleBridgeTraces.length > 0) { - logInfo(module.name, `Found ${moduleBridgeTraces.length} bridge messages in mainnet trace`); - - logInfo(module.name, 'Updating events cache'); - const moduleCache = await module.cacheLogs(); - - for (const trace of moduleBridgeTraces) { - logInfo(module.name, 'Fetching latest known proposal state'); - // any casts needed as types are slightly different on polygon vs others - const moduleState = await module.getProposalState({ - trace: trace, - fromTimestamp: mainnetState.log.timestamp, - ...moduleCache, - } as any); - if (module.simulateOnTenderly) { - logInfo(module.name, 'Simulate on tenderly'); - const simulation = await module.simulateOnTenderly(moduleState as any); - logSuccess(module.name, 'Simulation finished'); - subResults.push({ name: module.name, simulation, state: moduleState.state, args: moduleState.args }); - } else { - logError(module.name, 'Simulation on tenderly not supported'); - } - } - } else { - logInfo(module.name, 'Did not find bridge messages in mainnet trace'); - } - } - return { proposal, simulation: mainnetSimulationResult, subSimulations: subResults }; -} diff --git a/src/utils/logs.ts b/src/utils/logs.ts index 5a6f0dc..cce7d3c 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -3,7 +3,14 @@ import type { Abi } from 'abitype'; import fs from 'fs'; import path from 'path'; import { logInfo } from './logger'; -import { FilterLogWithTimestamp } from '../simulate/govv2/networks/types'; + +type ArrayElement = ArrayType extends readonly (infer ElementType)[] + ? ElementType + : never; + +export type FilterLogWithTimestamp = ArrayElement< + GetFilterLogsReturnType +> & { timestamp: number }; /** * Fetches the logs and stores them in a cache folder. From 17b899727ac30d87d6a5f27053a15bd303dc051a Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 10:25:47 +0200 Subject: [PATCH 42/94] fix: expand to 32bytes --- .env.example | 1 + src/govv3/proofs.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index fce36c4..3ffa05f 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ RPC_ARBITRUM= RPC_POLYGON= RPC_OPTIMISM= RPC_BASE= +RPC_GOERLI= TENDERLY_ACCESS_TOKEN= TENDERLY_PROJECT_SLUG= diff --git a/src/govv3/proofs.ts b/src/govv3/proofs.ts index ffbc4b7..60f3e6b 100644 --- a/src/govv3/proofs.ts +++ b/src/govv3/proofs.ts @@ -22,7 +22,10 @@ export const VOTING_SLOTS = { export async function getProof(publicClient: PublicClient, address: Hex, slots: readonly Hex[], blockHash: Hex) { const block = await publicClient.getBlock({ blockHash }); - return publicClient.request({ method: 'eth_getProof' as any, params: [address, slots, toHex(block.number)] as any }); + return publicClient.request({ + method: 'eth_getProof' as any, + params: [address, slots.map((slot) => toHex(slot, { size: 32 })), toHex(block.number)] as any, + }); } // IMPORTANT valid only for post-Shapella blocks, as it includes `withdrawalsRoot` From b2b7d6c6123d2a45b72e743666af5d0c3cfb4f22 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 14:07:20 +0200 Subject: [PATCH 43/94] feat: stash proofing --- package.json | 2 +- src/commands/governance.ts | 82 +++++++++++++++++++++++++++++++------- src/govv3/governance.ts | 23 ++++++----- src/govv3/proofs.ts | 47 +++++++++++++++++----- yarn.lock | 8 ++-- 5 files changed, 123 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 51c6c69..7c65fd7 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "access": "public" }, "dependencies": { - "@bgd-labs/aave-address-book": "2.3.1-fe0b9ce3f66235f2d3eb88a09531c1afeb68dfbf.0", + "@bgd-labs/aave-address-book": "2.3.1-dfb6302aa92b55201141b7d43094327c4a646cf1.0", "@commander-js/extra-typings": "^11.0.0", "bs58": "^5.0.0", "chalk": "^4.1.2", diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 295fa38..c890c19 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -1,10 +1,19 @@ import { Command } from '@commander-js/extra-typings'; import { simulateProposal } from '../govv3/simulate'; -import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; +import { GovernanceV3Goerli, IVotingMachineWithProofs_ABI, IVotingPortal_ABI } from '@bgd-labs/aave-address-book'; import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/governance'; -import { goerliClient } from '../utils/rpcClients'; +import { RPC_MAP, goerliClient } from '../utils/rpcClients'; import { logError, logInfo } from '../utils/logger'; -import { Hex, createWalletClient, encodeAbiParameters, getContract, http } from 'viem'; +import { + Hex, + PublicClient, + createWalletClient, + encodeAbiParameters, + encodeFunctionData, + getContract, + http, +} from 'viem'; +import { getAccountRPL } from '../govv3/proofs'; const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; const DEFAULT_CLIENT = goerliClient; @@ -125,25 +134,70 @@ export function addCommand(program: Command) { .command('vote') .description('vote for or against any given proposal') .requiredOption('--proposalId ', 'proposalId to vote for') - .option('--for', 'Vote in favour of the proposal') - .option('--against', 'vote against the proposal') - .action(async (name, options) => { + .requiredOption('--voter ', 'the address to vote') + .option('--voteFor', 'Vote in favour of the proposal') + .option('--voteAgainst', 'vote against the proposal') + .action(async ({ voter, proposalId: _proposalId, voteAgainst, voteFor }) => { const governance = getGovernance({ address: DEFAULT_GOVERNANCE, publicClient: DEFAULT_CLIENT, walletClient: createWalletClient({ account: '0x0', chain: DEFAULT_CLIENT.chain, transport: http() }), }); - const proposalId = BigInt(options.getOptionValue('proposalId')); + + const proposalId = BigInt(_proposalId); + const proposal = await governance.governanceContract.read.getProposal([proposalId]); - if (proposal.state !== State.Active) { - throw new Error('can only vote on active proposals'); + console.log(await DEFAULT_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash })); + if (proposal.state !== ProposalState.Active) { + // throw new Error('can only vote on active proposals'); } - const voteFor = options.getOptionValue('for'); - const voteAgainst = options.getOptionValue('against'); - if (voteFor && voteAgainst) { + + if ((voteFor && voteAgainst) || (!voteFor && !voteAgainst)) { throw new Error('you must either vote --for, or --against'); } - // perhaps makes sense to show encoded data to vote? - logError('TODO', 'not yet implemented'); + const portal = getContract({ + address: proposal.votingPortal, + abi: IVotingPortal_ABI, + publicClient: DEFAULT_CLIENT, + }); + const [machine, chainId] = await Promise.all([ + portal.read.VOTING_MACHINE(), + portal.read.VOTING_MACHINE_CHAIN_ID(), + ]); + const votingMachine = getContract({ + address: machine, + abi: IVotingMachineWithProofs_ABI, + publicClient: RPC_MAP[Number(chainId) as keyof typeof RPC_MAP] as PublicClient, + // walletClient: createWalletClient({ account: '0x0', chain: { id: Number(chainId) } as any, transport: http() }), + }); + const proofs = await governance.getVotingProofs(proposalId, voter as Hex); + const encodedData = encodeFunctionData({ + abi: IVotingMachineWithProofs_ABI, + functionName: 'submitVote', + args: [ + proposalId, + !!voteFor, + proofs + .map(({ proof, slots }) => { + return slots.map((slot, ix) => ({ + underlyingAsset: proof.address, + slot, + proof: getAccountRPL(proof.storageProof[ix].proof), + })); + }) + .flat(), + ], + }); + console.log( + proofs + .map(({ proof, slots }) => { + return slots.map((slot, ix) => ({ + underlyingAsset: proof.address, + slot, + proof: getAccountRPL(proof.storageProof[ix].proof), + })); + }) + .flat() + ); }); } diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index 9a50753..70bd7ac 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -16,7 +16,7 @@ import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../utils/ import { EOA } from '../utils/constants'; import { getSolidityStorageSlotAddress, getSolidityStorageSlotUint } from '../utils/storageSlots'; import { setBits } from './utils/solidityUtils'; -import { VOTING_SLOTS, WAREHOUSE_SLOTS, getProof } from './proofs'; +import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getProof } from './proofs'; type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; @@ -65,7 +65,7 @@ export interface Governance { * @param proposalId * @param voter */ - getVotingProofs: (proposalId: bigint, voter: Hex) => any; + getVotingProofs: (proposalId: bigint, voter: Hex) => Promise<{ proof: Proof; slots: readonly bigint[] }[]>; getRoots: (proposalId: bigint) => any; } @@ -236,14 +236,17 @@ export const getGovernance = ({ const proposal = await governanceContract.read.getProposal([proposalId]); const proofs = await Promise.all( - (Object.keys(VOTING_SLOTS) as (keyof typeof VOTING_SLOTS)[]).map((key) => - getProof( - publicClient, - key, - VOTING_SLOTS[key].map((slot) => getSolidityStorageSlotAddress(slot, voter)), - proposal.snapshotBlockHash - ) - ) + (Object.keys(VOTING_SLOTS) as (keyof typeof VOTING_SLOTS)[]).map(async (key) => { + return { + proof: await getProof( + publicClient, + key, + VOTING_SLOTS[key].map((slot) => getSolidityStorageSlotAddress(slot, voter)), + proposal.snapshotBlockHash + ), + slots: VOTING_SLOTS[key], + }; + }) ); return proofs; diff --git a/src/govv3/proofs.ts b/src/govv3/proofs.ts index 60f3e6b..3702f81 100644 --- a/src/govv3/proofs.ts +++ b/src/govv3/proofs.ts @@ -1,35 +1,58 @@ -import { AaveSafetyModule, AaveV3Ethereum } from '@bgd-labs/aave-address-book'; -import { Block, Hex, PublicClient, toHex, toRlp } from 'viem'; +import { AaveSafetyModule, AaveV3Ethereum, GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; +import { Block, Hex, PublicClient, fromRlp, toHex, toRlp } from 'viem'; +/** + * Slots that represent configuration values relevant for all accounts + */ export const WAREHOUSE_SLOTS = { [AaveSafetyModule.STK_AAVE]: [ - 81, // exchangeRate + 81n, // exchangeRate ], } as const; +/** + * Slots that represent the balance of a single account + */ export const VOTING_SLOTS = { ['0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' /*AaveSafetyModule.STK_AAVE*/]: [ - 0, // balance + 0n, // balance ], ['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd' /*AaveV3Ethereum.ASSETS.AAVE.A_TOKEN*/]: [ - 52, // balance - 64, // delegation + 52n, // balance + 64n, // delegation ], ['0xb6D88BfC5b145a558b279cf7692e6F02064889d0' /*AaveV3Ethereum.ASSETS.AAVE.UNDERLYING*/]: [ - 0, // balance + 0n, // balance + ], + [GovernanceV3Goerli.GOVERNANCE]: [ + 9n, // representative ], } as const; +export interface Proof { + address: Hex; + accountProof: Hex[]; + balance: Hex; + codeHash: Hex; + nonce: Hex; + storageHash: Hex; + storageProof: { + key: Hex; + value: Hex; + proof: Hex[]; + }[]; +} + export async function getProof(publicClient: PublicClient, address: Hex, slots: readonly Hex[], blockHash: Hex) { const block = await publicClient.getBlock({ blockHash }); return publicClient.request({ method: 'eth_getProof' as any, - params: [address, slots.map((slot) => toHex(slot, { size: 32 })), toHex(block.number)] as any, - }); + params: [address, slots.map((slot) => slot), toHex(block.number)] as any, + }) as Promise; } // IMPORTANT valid only for post-Shapella blocks, as it includes `withdrawalsRoot` -const prepareBLockRLP = (rawBlock: Block): Hex => { +export const getBLockRLP = (rawBlock: Block): Hex => { const rawData = [ rawBlock.parentHash, rawBlock.sha3Uncles, @@ -52,3 +75,7 @@ const prepareBLockRLP = (rawBlock: Block): Hex => { ]; return toRlp(rawData); }; + +export const getAccountRPL = (proof: Hex[]) => { + return toRlp(proof.map((rpl) => fromRlp(rpl, 'hex'))); +}; diff --git a/yarn.lock b/yarn.lock index 45de25f..79f4024 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,10 +33,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@bgd-labs/aave-address-book@2.3.1-fe0b9ce3f66235f2d3eb88a09531c1afeb68dfbf.0": - version "2.3.1-fe0b9ce3f66235f2d3eb88a09531c1afeb68dfbf.0" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.3.1-fe0b9ce3f66235f2d3eb88a09531c1afeb68dfbf.0.tgz#d290d0adf9ca313a7261999095157b5959bf4edc" - integrity sha512-R9k2hcYHj5Y26sHsay36uNDM4+HCECNDDgDYTzKjQLOK+NMir2YjY2YGhf1pgovy6aYLyKzD0GZpRCbtMDOEJw== +"@bgd-labs/aave-address-book@2.3.1-dfb6302aa92b55201141b7d43094327c4a646cf1.0": + version "2.3.1-dfb6302aa92b55201141b7d43094327c4a646cf1.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.3.1-dfb6302aa92b55201141b7d43094327c4a646cf1.0.tgz#4092650b3ce7dfa2d45a1efa721a260069ef8047" + integrity sha512-aL0vCiUcqxPbV+CchvLjKk2v78bLTVfASKDj+HL1mmXI6jBjKiZJ6qB4cA+7t0dRmKmn5MfMpR9UMs/kL+XeBQ== "@commander-js/extra-typings@^11.0.0": version "11.0.0" From 88d5f202174adf16f80a9b4d941ff93a33feefae Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 15:39:33 +0200 Subject: [PATCH 44/94] fix: voting proof generator --- src/commands/governance.ts | 7 ++-- src/govv3/governance.ts | 71 +++++++++++++++++++++++++++++--------- src/govv3/proofs.ts | 20 ++++------- 3 files changed, 66 insertions(+), 32 deletions(-) diff --git a/src/commands/governance.ts b/src/commands/governance.ts index c890c19..aa6cc99 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -14,6 +14,7 @@ import { http, } from 'viem'; import { getAccountRPL } from '../govv3/proofs'; +import { bigint } from 'zod'; const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; const DEFAULT_CLIENT = goerliClient; @@ -127,7 +128,7 @@ export function addCommand(program: Command) { const proposalId = BigInt(options.getOptionValue('proposalId')); const voter = options.getOptionValue('voter') as Hex; - const proofs = await governance.getVotingProofs(proposalId, voter); + // const proofs = await governance.getVotingProofs(proposalId, voter); }); govV3 @@ -147,7 +148,7 @@ export function addCommand(program: Command) { const proposalId = BigInt(_proposalId); const proposal = await governance.governanceContract.read.getProposal([proposalId]); - console.log(await DEFAULT_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash })); + if (proposal.state !== ProposalState.Active) { // throw new Error('can only vote on active proposals'); } @@ -170,7 +171,7 @@ export function addCommand(program: Command) { publicClient: RPC_MAP[Number(chainId) as keyof typeof RPC_MAP] as PublicClient, // walletClient: createWalletClient({ account: '0x0', chain: { id: Number(chainId) } as any, transport: http() }), }); - const proofs = await governance.getVotingProofs(proposalId, voter as Hex); + const proofs = await governance.getVotingProofs(proposalId, voter as Hex, chainId); const encodedData = encodeFunctionData({ abi: IVotingMachineWithProofs_ABI, functionName: 'submitVote', diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index 70bd7ac..816a229 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -7,6 +7,7 @@ import { encodeFunctionData, fromHex, getContract, + keccak256, parseEther, toHex, } from 'viem'; @@ -14,7 +15,11 @@ import { FilterLogWithTimestamp, getLogs } from '../utils/logs'; import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book'; import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../utils/tenderlyClient'; import { EOA } from '../utils/constants'; -import { getSolidityStorageSlotAddress, getSolidityStorageSlotUint } from '../utils/storageSlots'; +import { + getSolidityStorageSlotAddress, + getSolidityStorageSlotBytes, + getSolidityStorageSlotUint, +} from '../utils/storageSlots'; import { setBits } from './utils/solidityUtils'; import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getProof } from './proofs'; @@ -64,8 +69,13 @@ export interface Governance { * Returns the proofs that are non-zero for a specified address * @param proposalId * @param voter + * @param votingChainId */ - getVotingProofs: (proposalId: bigint, voter: Hex) => Promise<{ proof: Proof; slots: readonly bigint[] }[]>; + getVotingProofs: ( + proposalId: bigint, + voter: Hex, + votingChainId: bigint + ) => Promise<{ proof: Proof; slots: readonly bigint[] }[]>; getRoots: (proposalId: bigint) => any; } @@ -232,24 +242,53 @@ export const getGovernance = ({ const payload = await getSimulationPayloadForExecution(proposalId); return tenderly.simulate(payload); }, - async getVotingProofs(proposalId: bigint, voter: Hex) { + async getVotingProofs(proposalId: bigint, voter: Hex, votingChainId: bigint) { const proposal = await governanceContract.read.getProposal([proposalId]); - const proofs = await Promise.all( - (Object.keys(VOTING_SLOTS) as (keyof typeof VOTING_SLOTS)[]).map(async (key) => { - return { - proof: await getProof( - publicClient, - key, - VOTING_SLOTS[key].map((slot) => getSolidityStorageSlotAddress(slot, voter)), - proposal.snapshotBlockHash + const [stkAaveProof, aaveProof, aAaveProof, representativeProof] = await Promise.all([ + getProof( + publicClient, + '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec', + [getSolidityStorageSlotAddress(VOTING_SLOTS['0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec'].balance, voter)], + proposal.snapshotBlockHash + ), + getProof( + publicClient, + '0xb6D88BfC5b145a558b279cf7692e6F02064889d0', + [getSolidityStorageSlotAddress(VOTING_SLOTS['0xb6D88BfC5b145a558b279cf7692e6F02064889d0'].balance, voter)], + proposal.snapshotBlockHash + ), + getProof( + publicClient, + '0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd', + [ + getSolidityStorageSlotAddress(VOTING_SLOTS['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd'].balance, voter), + getSolidityStorageSlotAddress(VOTING_SLOTS['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd'].delegation, voter), + ], + proposal.snapshotBlockHash + ), + getProof( + publicClient, + '0x586207Df62c7D5D1c9dBb8F61EdF77cc30925C4F', + [ + getSolidityStorageSlotBytes( + getSolidityStorageSlotAddress( + VOTING_SLOTS['0x586207Df62c7D5D1c9dBb8F61EdF77cc30925C4F'].representative, + voter + ), + toHex(votingChainId, { size: 32 }) ), - slots: VOTING_SLOTS[key], - }; - }) - ); + ], + proposal.snapshotBlockHash + ), + ]); - return proofs; + return [ + { proof: stkAaveProof, slots: [0n] }, + { proof: aaveProof, slots: [0n] }, + { proof: aAaveProof, slots: [52n, 64n] }, + { proof: representativeProof, slots: [9n] }, + ]; }, async getRoots(proposalId: bigint) { const proposal = await governanceContract.read.getProposal([proposalId]); diff --git a/src/govv3/proofs.ts b/src/govv3/proofs.ts index 3702f81..e009b32 100644 --- a/src/govv3/proofs.ts +++ b/src/govv3/proofs.ts @@ -14,19 +14,13 @@ export const WAREHOUSE_SLOTS = { * Slots that represent the balance of a single account */ export const VOTING_SLOTS = { - ['0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' /*AaveSafetyModule.STK_AAVE*/]: [ - 0n, // balance - ], - ['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd' /*AaveV3Ethereum.ASSETS.AAVE.A_TOKEN*/]: [ - 52n, // balance - 64n, // delegation - ], - ['0xb6D88BfC5b145a558b279cf7692e6F02064889d0' /*AaveV3Ethereum.ASSETS.AAVE.UNDERLYING*/]: [ - 0n, // balance - ], - [GovernanceV3Goerli.GOVERNANCE]: [ - 9n, // representative - ], + ['0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' /*AaveSafetyModule.STK_AAVE*/]: { balance: 0n }, // balance + ['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd' /*AaveV3Ethereum.ASSETS.AAVE.A_TOKEN*/]: { + balance: 52n, // balance + delegation: 64n, + }, // delegation + ['0xb6D88BfC5b145a558b279cf7692e6F02064889d0' /*AaveV3Ethereum.ASSETS.AAVE.UNDERLYING*/]: { balance: 0n }, // balance + [GovernanceV3Goerli.GOVERNANCE]: { representative: 9n }, // representative } as const; export interface Proof { From 181d303955b35aca01b23241df62d7ee13858cdf Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 15:45:28 +0200 Subject: [PATCH 45/94] fix: add output --- src/commands/governance.ts | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/commands/governance.ts b/src/commands/governance.ts index aa6cc99..6f4d39a 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -3,7 +3,7 @@ import { simulateProposal } from '../govv3/simulate'; import { GovernanceV3Goerli, IVotingMachineWithProofs_ABI, IVotingPortal_ABI } from '@bgd-labs/aave-address-book'; import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/governance'; import { RPC_MAP, goerliClient } from '../utils/rpcClients'; -import { logError, logInfo } from '../utils/logger'; +import { logError, logInfo, logSuccess } from '../utils/logger'; import { Hex, PublicClient, @@ -149,10 +149,6 @@ export function addCommand(program: Command) { const proposal = await governance.governanceContract.read.getProposal([proposalId]); - if (proposal.state !== ProposalState.Active) { - // throw new Error('can only vote on active proposals'); - } - if ((voteFor && voteAgainst) || (!voteFor && !voteAgainst)) { throw new Error('you must either vote --for, or --against'); } @@ -189,16 +185,10 @@ export function addCommand(program: Command) { .flat(), ], }); - console.log( - proofs - .map(({ proof, slots }) => { - return slots.map((slot, ix) => ({ - underlyingAsset: proof.address, - slot, - proof: getAccountRPL(proof.storageProof[ix].proof), - })); - }) - .flat() - ); + logInfo('Voting', `Encoded data to be submitted on ${chainId}:${machine}`); + logSuccess('Encoded data', encodedData); + if (proposal.state !== ProposalState.Active) { + logError('ImpossibleToVote', 'You can only vote on active proposals'); + } }); } From 096c5870fba0bdd6424cb37333d3646982b97d49 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 16:02:05 +0200 Subject: [PATCH 46/94] fix: type & exports --- src/commands/fork.ts | 4 ++-- src/commands/governance.ts | 5 ++--- src/govv3/governance.ts | 2 +- src/index.ts | 1 + src/utils/rpcClients.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/commands/fork.ts b/src/commands/fork.ts index 32affa4..37db8d1 100644 --- a/src/commands/fork.ts +++ b/src/commands/fork.ts @@ -2,7 +2,7 @@ import { Command } from '@commander-js/extra-typings'; import { tenderly } from '../utils/tenderlyClient'; import { getGovernance } from '../govv3/governance'; import { GovernanceV3Ethereum } from '@bgd-labs/aave-address-book'; -import { RPC_MAP, mainnetClient } from '../utils/rpcClients'; +import { CHAIN_ID_CLIENT_MAP, mainnetClient } from '../utils/rpcClients'; import { getPayloadsController } from '../govv3/payloadsController'; import { Hex, PublicClient } from 'viem'; @@ -54,7 +54,7 @@ export function addCommand(program: Command) { if (!payloadsControllerAddress) throw new Error('you need to provide a payloadsController'); const payloadsController = getPayloadsController( payloadsControllerAddress as Hex, - RPC_MAP[forkConfig.chainId as keyof typeof RPC_MAP] as PublicClient + CHAIN_ID_CLIENT_MAP[forkConfig.chainId as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient ); const payload = await payloadsController.getSimulationPayloadForExecution(Number(payloadId)); const fork = await tenderly.fork({ diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 6f4d39a..fbc0041 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -2,7 +2,7 @@ import { Command } from '@commander-js/extra-typings'; import { simulateProposal } from '../govv3/simulate'; import { GovernanceV3Goerli, IVotingMachineWithProofs_ABI, IVotingPortal_ABI } from '@bgd-labs/aave-address-book'; import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/governance'; -import { RPC_MAP, goerliClient } from '../utils/rpcClients'; +import { CHAIN_ID_CLIENT_MAP, goerliClient } from '../utils/rpcClients'; import { logError, logInfo, logSuccess } from '../utils/logger'; import { Hex, @@ -164,8 +164,7 @@ export function addCommand(program: Command) { const votingMachine = getContract({ address: machine, abi: IVotingMachineWithProofs_ABI, - publicClient: RPC_MAP[Number(chainId) as keyof typeof RPC_MAP] as PublicClient, - // walletClient: createWalletClient({ account: '0x0', chain: { id: Number(chainId) } as any, transport: http() }), + publicClient: CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient, }); const proofs = await governance.getVotingProofs(proposalId, voter as Hex, chainId); const encodedData = encodeFunctionData({ diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index 816a229..bfe838a 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -40,7 +40,7 @@ export enum ProposalState { Expired, } -export interface Governance { +export interface Governance { governanceContract: GetContractReturnType; cacheLogs: () => Promise<{ createdLogs: Array; diff --git a/src/index.ts b/src/index.ts index 141010e..dfe63ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,3 +5,4 @@ export * from './govv3/payloadsController'; export * from './govv3/generatePayloadReport'; export * from './utils/tenderlyClient'; export * from './utils/logger'; +export * from './utils/rpcClients'; diff --git a/src/utils/rpcClients.ts b/src/utils/rpcClients.ts index 63729fe..dd1bf6d 100644 --- a/src/utils/rpcClients.ts +++ b/src/utils/rpcClients.ts @@ -36,7 +36,7 @@ export const sepoliaClient = createPublicClient({ chain: sepolia, transport: htt export const goerliClient = createPublicClient({ chain: goerli, transport: http(process.env.RPC_GOERLI) }); -export const RPC_MAP = { +export const CHAIN_ID_CLIENT_MAP = { [mainnet.id]: mainnetClient, [arbitrum.id]: arbitrumClient, [polygon.id]: polygonClient, From bd832fe13ab1ef13b8d3315a6c5d0efa88b349b8 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 16:35:39 +0200 Subject: [PATCH 47/94] fix: fix some issues here and there --- src/govv3/checks/logs.ts | 2 +- src/govv3/checks/selfDestruct.ts | 5 +- src/govv3/checks/targets-verified.ts | 5 +- src/govv3/checks/types.ts | 4 +- src/govv3/generatePayloadReport.ts | 14 +-- src/govv3/generateProposalReport.ts | 143 +++++++++++++++++++++++++++ src/govv3/utils/markdownUtils.ts | 9 ++ 7 files changed, 164 insertions(+), 18 deletions(-) create mode 100644 src/govv3/generateProposalReport.ts diff --git a/src/govv3/checks/logs.ts b/src/govv3/checks/logs.ts index c2527fa..6229ed6 100644 --- a/src/govv3/checks/logs.ts +++ b/src/govv3/checks/logs.ts @@ -6,7 +6,7 @@ import { getContractName } from '../utils/solidityUtils'; /** * Reports all emitted events from the proposal */ -export const checkLogs: ProposalCheck = { +export const checkLogs: ProposalCheck>> = { name: 'Reports all events emitted from the proposal', async checkProposal(proposal, sim, deps) { let info = []; diff --git a/src/govv3/checks/selfDestruct.ts b/src/govv3/checks/selfDestruct.ts index 6708543..b2e774b 100644 --- a/src/govv3/checks/selfDestruct.ts +++ b/src/govv3/checks/selfDestruct.ts @@ -3,11 +3,12 @@ import { Hex, PublicClient } from 'viem'; import { ProposalCheck } from './types'; import { toAddressLink } from '../utils/markdownUtils'; +import { PayloadsController } from '../payloadsController'; /** * Check all targets with code if they contain selfdestruct. */ -export const checkTargetsNoSelfdestruct: ProposalCheck = { +export const checkTargetsNoSelfdestruct: ProposalCheck>> = { name: 'Check all targets do not contain selfdestruct', async checkProposal(proposal, sim, publicClient) { const allTargets = proposal.payload.actions.map((action) => action.target); @@ -20,7 +21,7 @@ export const checkTargetsNoSelfdestruct: ProposalCheck = { /** * Check all touched contracts with code if they contain selfdestruct. */ -export const checkTouchedContractsNoSelfdestruct: ProposalCheck = { +export const checkTouchedContractsNoSelfdestruct: ProposalCheck = { name: 'Check all touched contracts do not contain selfdestruct', async checkProposal(proposal, sim, publicClient) { const { info, warn, error } = await checkNoSelfdestructs([], sim.transaction.addresses, publicClient); diff --git a/src/govv3/checks/targets-verified.ts b/src/govv3/checks/targets-verified.ts index 6577255..4fd0d1f 100644 --- a/src/govv3/checks/targets-verified.ts +++ b/src/govv3/checks/targets-verified.ts @@ -1,11 +1,12 @@ import { Hex, PublicClient } from 'viem'; import { ProposalCheck } from './types'; import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; +import { PayloadsController } from '../../../dist'; /** * Check all targets with code are verified on Etherscan */ -export const checkTargetsVerifiedEtherscan: ProposalCheck = { +export const checkTargetsVerifiedEtherscan: ProposalCheck>> = { name: 'Check all targets are verified on Etherscan', async checkProposal(proposal, sim, publicClient) { const allTargets = proposal.payload.actions.map((action) => action.target); @@ -18,7 +19,7 @@ export const checkTargetsVerifiedEtherscan: ProposalCheck = { /** * Check all touched contracts with code are verified on Etherscan */ -export const checkTouchedContractsVerifiedEtherscan: ProposalCheck = { +export const checkTouchedContractsVerifiedEtherscan: ProposalCheck = { name: 'Check all touched contracts are verified on Etherscan', async checkProposal(proposal, sim, publicClient) { const info = await checkVerificationStatuses(sim, sim.transaction.addresses, publicClient); diff --git a/src/govv3/checks/types.ts b/src/govv3/checks/types.ts index 81afb4e..b1cd777 100644 --- a/src/govv3/checks/types.ts +++ b/src/govv3/checks/types.ts @@ -8,10 +8,10 @@ export type CheckResult = { errors: string[]; }; -export interface ProposalCheck { +export interface ProposalCheck { name: string; checkProposal( - proposalInfo: Awaited>, + proposalInfo: T, simulation: TenderlySimulationResponse, publicClient: PublicClient ): Promise; diff --git a/src/govv3/generatePayloadReport.ts b/src/govv3/generatePayloadReport.ts index 81a15d1..cb503f6 100644 --- a/src/govv3/generatePayloadReport.ts +++ b/src/govv3/generatePayloadReport.ts @@ -4,7 +4,7 @@ import { PayloadsController } from './payloadsController'; import { tenderlyDeepDiff } from './utils/tenderlyDeepDiff'; import { interpretStateChange } from './utils/stateDiffInterpreter'; import { getContractName } from './utils/solidityUtils'; -import { boolToMarkdown, toTxLink } from './utils/markdownUtils'; +import { boolToMarkdown, renderCheckResult, toTxLink } from './utils/markdownUtils'; import { checkTargetsNoSelfdestruct, checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; import { CheckResult, ProposalCheck } from './checks/types'; import { checkLogs } from './checks/logs'; @@ -28,10 +28,10 @@ export async function generateReport({ payloadId, payloadInfo, simulation, publi - actions: ${JSON.stringify(payload.actions, (key, value) => (typeof value === 'bigint' ? value.toString() : value))} - createdAt: [${payload.createdAt}](${toTxLink(createdLog.transactionHash, false, publicClient)})\n`; if (queuedLog) { - report += `- queuedAt: [${payload.createdAt}](${toTxLink(queuedLog.transactionHash, false, publicClient)})\n`; + report += `- queuedAt: [${payload.queuedAt}](${toTxLink(queuedLog.transactionHash, false, publicClient)})\n`; } if (executedLog) { - report += `- executedAt: [${payload.createdAt}](${toTxLink(executedLog.transactionHash, false, publicClient)})\n`; + report += `- executedAt: [${payload.executedAt}](${toTxLink(executedLog.transactionHash, false, publicClient)})\n`; } report += '\n'; @@ -142,11 +142,3 @@ export async function generateReport({ payloadId, payloadInfo, simulation, publi return report; } - -function renderCheckResult(check: ProposalCheck, result: CheckResult) { - let response = `### Check: ${check.name} ${boolToMarkdown(!result.errors.length)}\n\n`; - if (result.errors.length) response += `#### Errors\n\n${result.errors.join('\n')}\n\n`; - if (result.warnings.length) response += `#### Warnings\n\n${result.warnings.join('\n')}\n\n`; - if (result.info.length) response += `#### Info\n\n${result.info.join('\n')}\n\n`; - return response; -} diff --git a/src/govv3/generateProposalReport.ts b/src/govv3/generateProposalReport.ts new file mode 100644 index 0000000..f094f62 --- /dev/null +++ b/src/govv3/generateProposalReport.ts @@ -0,0 +1,143 @@ +import { Hex, PublicClient, getAddress } from 'viem'; +import { StateDiff, TenderlySimulationResponse } from '../utils/tenderlyClient'; +import { PayloadsController } from './payloadsController'; +import { tenderlyDeepDiff } from './utils/tenderlyDeepDiff'; +import { interpretStateChange } from './utils/stateDiffInterpreter'; +import { getContractName } from './utils/solidityUtils'; +import { boolToMarkdown, renderCheckResult, toTxLink } from './utils/markdownUtils'; +import { checkTargetsNoSelfdestruct, checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; +import { CheckResult, ProposalCheck } from './checks/types'; +import { checkLogs } from './checks/logs'; +import { checkTargetsVerifiedEtherscan, checkTouchedContractsVerifiedEtherscan } from './checks/targets-verified'; +import { Governance, HUMAN_READABLE_STATE } from './governance'; + +type GenerateReportRequest = { + proposalId: bigint; + proposalInfo: Awaited>; + simulation: TenderlySimulationResponse; + publicClient: PublicClient; +}; + +export async function generateReport({ proposalId, proposalInfo, simulation, publicClient }: GenerateReportRequest) { + const { proposal, executedLog, queuedLog, createdLog, payloadSentLog, votingActivatedLog } = proposalInfo; + // generate file header + let report = `## Proposal ${proposalId} + +- state: ${HUMAN_READABLE_STATE[proposal.state as keyof typeof HUMAN_READABLE_STATE]} +- creator: ${proposal.creator} +- maximumAccessLevelRequired: ${proposal.accessLevel} +- payloads: ${JSON.stringify(proposal.payloads, (key, value) => (typeof value === 'bigint' ? value.toString() : value))} +- createdAt: [${proposal.creationTime}](${toTxLink(createdLog.transactionHash, false, publicClient)})\n`; + if (queuedLog) { + report += `- queuedAt: [${proposal.queuingTime}](${toTxLink(queuedLog.transactionHash, false, publicClient)})\n`; + } + if (executedLog) { + report += `- executedAt: [${executedLog.timestamp}](${toTxLink( + executedLog.transactionHash, + false, + publicClient + )})\n`; + } + report += '\n'; + + // check if simulation was successful + report += `### Simulation ${boolToMarkdown(simulation.transaction.status)}\n\n`; + if (!simulation.transaction.status) { + const txInfo = simulation.transaction.transaction_info; + const reason = txInfo.stack_trace ? txInfo.stack_trace[0].error_reason : 'unknown error'; + report += `Transaction reverted with reason: ${reason}`; + } else { + // State diffs in the simulation are an array, so first we organize them by address. + const stateDiffs = simulation.transaction.transaction_info.state_diff.reduce((diffs, diff) => { + // TODO: double check if that's safe to skip + if (!diff.raw?.[0]) return diffs; + const addr = getAddress(diff.raw[0].address); + if (!diffs[addr]) diffs[addr] = [diff]; + else diffs[addr].push(diff); + return diffs; + }, {} as Record); + + if (!Object.keys(stateDiffs).length) { + report += `No state changes detected`; + } else { + let stateChanges = ''; + let warnings = ''; + // Parse state changes at each address + for (const [address, diffs] of Object.entries(stateDiffs)) { + // Use contracts array to get contract name of address + stateChanges += `\n\`\`\`diff\n# ${getContractName(simulation.contracts, address)}\n`; + + // Parse each diff. A single diff may involve multiple storage changes, e.g. a proposal that + // executes three transactions will show three state changes to the `queuedTransactions` + // mapping within a single `diff` element. We always JSON.stringify the values so structs + // (i.e. tuples) don't print as [object Object] + for (const diff of diffs) { + if (!diff.soltype) { + // In this branch, state change is not decoded, so return raw data of each storage write + // (all other branches have decoded state changes) + diff.raw.forEach((w) => { + const oldVal = JSON.stringify(w.original); + const newVal = JSON.stringify(w.dirty); + // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` + stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); + }); + } else if (diff.soltype.simple_type) { + // This is a simple type with a single changed value + // const oldVal = JSON.parse(JSON.stringify(diff.original)) + // const newVal = JSON.parse(JSON.stringify(diff.dirty)) + // info += `\n - \`${diff.soltype.name}\` changed from \`${oldVal}\` to \`${newVal}\`` + stateChanges += tenderlyDeepDiff(diff.original, diff.dirty, diff.soltype.name); + } else if (diff.soltype.type.startsWith('mapping')) { + // This is a complex type like a mapping, which may have multiple changes. The diff.original + // and diff.dirty fields can be strings or objects, and for complex types they are objects, + // so we cast them as such + const keys = Object.keys(diff.original); + const original = diff.original as Record; + const dirty = diff.dirty as Record; + for (const k of keys as Hex[]) { + stateChanges += tenderlyDeepDiff(original[k], dirty[k], `\`${diff.soltype?.name}\` key \`${k}\``); + const interpretation = await interpretStateChange( + address, + diff.soltype?.name, + original[k], + dirty[k], + k, + publicClient + ); + if (interpretation) stateChanges += `\n${interpretation}`; + stateChanges += '\n'; + } + } else { + // TODO arrays and nested mapping are currently not well supported -- find a transaction + // that changes state of these types to inspect the Tenderly simulation response and + // handle it accordingly. In the meantime we show the raw state changes and print a + // warning about decoding the data + diff.raw.forEach((w) => { + const oldVal = JSON.stringify(w.original); + const newVal = JSON.stringify(w.dirty); + // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` + stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); + warnings += `Could not parse state: add support for formatting type ${diff.soltype?.type} (slot ${w.key})\n`; + }); + } + } + stateChanges += '```\n'; + } + + if (warnings) { + report += `#### Warnings\n`; + report += warnings; + } + report += `#### State Changes\n`; + report += stateChanges; + } + } + const checks = [checkLogs, checkTouchedContractsVerifiedEtherscan, checkTouchedContractsNoSelfdestruct]; + + for (const check of checks) { + const result = await check.checkProposal(proposalInfo, simulation, publicClient); + report += renderCheckResult(check, result); + } + + return report; +} diff --git a/src/govv3/utils/markdownUtils.ts b/src/govv3/utils/markdownUtils.ts index 31c9c12..d21cc73 100644 --- a/src/govv3/utils/markdownUtils.ts +++ b/src/govv3/utils/markdownUtils.ts @@ -1,4 +1,5 @@ import { Hex, PublicClient } from 'viem'; +import { CheckResult } from '../checks/types'; export function boolToMarkdown(value: boolean) { if (value) return `:white_check_mark:`; @@ -24,3 +25,11 @@ export function toTxLink(txn: Hex, md: boolean, client: PublicClient): string { if (md) return `[${txn}](${link})`; return link; } + +export function renderCheckResult(check: { name: string }, result: CheckResult) { + let response = `### Check: ${check.name} ${boolToMarkdown(!result.errors.length)}\n\n`; + if (result.errors.length) response += `#### Errors\n\n${result.errors.join('\n')}\n\n`; + if (result.warnings.length) response += `#### Warnings\n\n${result.warnings.join('\n')}\n\n`; + if (result.info.length) response += `#### Info\n\n${result.info.join('\n')}\n\n`; + return response; +} From a0c9134d3925a5028694d3a37f088f60c4a03646 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 16:43:48 +0200 Subject: [PATCH 48/94] fix: types --- src/govv3/checks/logs.ts | 1 + src/govv3/checks/selfDestruct.ts | 2 +- src/govv3/checks/targets-verified.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/govv3/checks/logs.ts b/src/govv3/checks/logs.ts index 6229ed6..4da0b46 100644 --- a/src/govv3/checks/logs.ts +++ b/src/govv3/checks/logs.ts @@ -2,6 +2,7 @@ import { getAddress } from 'viem'; import { ProposalCheck } from './types'; import { Log } from '../../utils/tenderlyClient'; import { getContractName } from '../utils/solidityUtils'; +import { PayloadsController } from '../payloadsController'; /** * Reports all emitted events from the proposal diff --git a/src/govv3/checks/selfDestruct.ts b/src/govv3/checks/selfDestruct.ts index b2e774b..20ab056 100644 --- a/src/govv3/checks/selfDestruct.ts +++ b/src/govv3/checks/selfDestruct.ts @@ -21,7 +21,7 @@ export const checkTargetsNoSelfdestruct: ProposalCheck = { +export const checkTouchedContractsNoSelfdestruct: ProposalCheck = { name: 'Check all touched contracts do not contain selfdestruct', async checkProposal(proposal, sim, publicClient) { const { info, warn, error } = await checkNoSelfdestructs([], sim.transaction.addresses, publicClient); diff --git a/src/govv3/checks/targets-verified.ts b/src/govv3/checks/targets-verified.ts index 4fd0d1f..802ab6c 100644 --- a/src/govv3/checks/targets-verified.ts +++ b/src/govv3/checks/targets-verified.ts @@ -19,7 +19,7 @@ export const checkTargetsVerifiedEtherscan: ProposalCheck = { +export const checkTouchedContractsVerifiedEtherscan: ProposalCheck = { name: 'Check all touched contracts are verified on Etherscan', async checkProposal(proposal, sim, publicClient) { const info = await checkVerificationStatuses(sim, sim.transaction.addresses, publicClient); From 80b7d9b638536bfaaf92bb6599d13caa26221179 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 16:45:48 +0200 Subject: [PATCH 49/94] fix: export generator --- src/govv3/generateProposalReport.ts | 13 ++++++++----- src/index.ts | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/govv3/generateProposalReport.ts b/src/govv3/generateProposalReport.ts index f094f62..bfb4bdd 100644 --- a/src/govv3/generateProposalReport.ts +++ b/src/govv3/generateProposalReport.ts @@ -1,14 +1,12 @@ import { Hex, PublicClient, getAddress } from 'viem'; import { StateDiff, TenderlySimulationResponse } from '../utils/tenderlyClient'; -import { PayloadsController } from './payloadsController'; import { tenderlyDeepDiff } from './utils/tenderlyDeepDiff'; import { interpretStateChange } from './utils/stateDiffInterpreter'; import { getContractName } from './utils/solidityUtils'; import { boolToMarkdown, renderCheckResult, toTxLink } from './utils/markdownUtils'; -import { checkTargetsNoSelfdestruct, checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; -import { CheckResult, ProposalCheck } from './checks/types'; +import { checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; import { checkLogs } from './checks/logs'; -import { checkTargetsVerifiedEtherscan, checkTouchedContractsVerifiedEtherscan } from './checks/targets-verified'; +import { checkTouchedContractsVerifiedEtherscan } from './checks/targets-verified'; import { Governance, HUMAN_READABLE_STATE } from './governance'; type GenerateReportRequest = { @@ -18,7 +16,12 @@ type GenerateReportRequest = { publicClient: PublicClient; }; -export async function generateReport({ proposalId, proposalInfo, simulation, publicClient }: GenerateReportRequest) { +export async function generateProposalReport({ + proposalId, + proposalInfo, + simulation, + publicClient, +}: GenerateReportRequest) { const { proposal, executedLog, queuedLog, createdLog, payloadSentLog, votingActivatedLog } = proposalInfo; // generate file header let report = `## Proposal ${proposalId} diff --git a/src/index.ts b/src/index.ts index dfe63ee..dc7c99e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ export { simulateProposal } from './govv3/simulate'; export * from './govv3/governance'; export * from './govv3/payloadsController'; export * from './govv3/generatePayloadReport'; +export * from './govv3/generateProposalReport'; export * from './utils/tenderlyClient'; export * from './utils/logger'; export * from './utils/rpcClients'; From 4a22998f33f57cacc1a780ecee438332ce85e89b Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 16:48:39 +0200 Subject: [PATCH 50/94] fix: another type fix --- src/govv3/checks/logs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/govv3/checks/logs.ts b/src/govv3/checks/logs.ts index 4da0b46..51012a4 100644 --- a/src/govv3/checks/logs.ts +++ b/src/govv3/checks/logs.ts @@ -7,7 +7,7 @@ import { PayloadsController } from '../payloadsController'; /** * Reports all emitted events from the proposal */ -export const checkLogs: ProposalCheck>> = { +export const checkLogs: ProposalCheck = { name: 'Reports all events emitted from the proposal', async checkProposal(proposal, sim, deps) { let info = []; From c7c0006314a770cd4b03b1ee6e5d983bb792b7d3 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 17:23:49 +0200 Subject: [PATCH 51/94] fix: improve simulation cli --- package.json | 2 +- src/commands/governance.ts | 2 +- src/govv3/simulate.ts | 34 +++++++--------------------------- yarn.lock | 8 ++++---- 4 files changed, 13 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index 7c65fd7..b5ef01d 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.10.4", + "viem": "^1.10.9", "yargs": "^17.7.2", "zod": "^3.21.4" } diff --git a/src/commands/governance.ts b/src/commands/governance.ts index fbc0041..964d141 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -28,7 +28,7 @@ export function addCommand(program: Command) { .requiredOption('--proposalId ', 'proposalId to simulate via tenderly') .action(async (name, options) => { const proposalId = BigInt(options.getOptionValue('proposalId')); - await simulateProposal(DEFAULT_GOVERNANCE, proposalId); + await simulateProposal(DEFAULT_GOVERNANCE, DEFAULT_CLIENT, proposalId); }); govV3 diff --git a/src/govv3/simulate.ts b/src/govv3/simulate.ts index b9574bb..adbc7f4 100644 --- a/src/govv3/simulate.ts +++ b/src/govv3/simulate.ts @@ -1,36 +1,17 @@ import { logInfo } from '../utils/logger'; import { TenderlySimulationResponse } from '../utils/tenderlyClient'; import { getGovernance } from './governance'; -import { Hex, createPublicClient, http } from 'viem'; -import { sepolia, polygonMumbai, bscTestnet, avalancheFuji } from 'viem/chains'; +import { Hex, PublicClient } from 'viem'; import { PayloadsController, getPayloadsController } from './payloadsController'; import { generateReport } from './generatePayloadReport'; -import { sepoliaClient } from '../utils/rpcClients'; +import { CHAIN_ID_CLIENT_MAP } from '../utils/rpcClients'; -const CHAIN_ID_CLIENT_MAP = { - [sepolia.id]: { - client: createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }), - blockCreated: 3967960n, - }, - [polygonMumbai.id]: { - client: createPublicClient({ chain: polygonMumbai, transport: http(process.env.RPC_POLYGON_MUMBAI) }), - blockCreated: 38318051n, - }, - [bscTestnet.id]: { - client: createPublicClient({ chain: bscTestnet, transport: http(process.env.RPC_BSC_TESTNET) }), - blockCreated: 31893040n, - }, - [avalancheFuji.id]: { - client: createPublicClient({ chain: avalancheFuji, transport: http(process.env.RPC_AVALANCHE_FUJI) }), - blockCreated: 24512916n, - }, -} as const; - -export async function simulateProposal(governanceAddress: Hex, proposalId: bigint) { +export async function simulateProposal(governanceAddress: Hex, publicClient: PublicClient, proposalId: bigint) { logInfo('General', `Running simulation for ${proposalId}`); - const governance = getGovernance({ address: governanceAddress, publicClient: sepoliaClient, blockCreated: 3962575n }); + const governance = getGovernance({ address: governanceAddress, publicClient }); const logs = await governance.cacheLogs(); const proposal = await governance.getProposal(proposalId, logs); + await governance.simulateProposalExecutionOnTenderly(proposalId, proposal); const payloads: { payload: Awaited>; simulation: TenderlySimulationResponse; @@ -38,8 +19,7 @@ export async function simulateProposal(governanceAddress: Hex, proposalId: bigin for (const payload of proposal.proposal.payloads) { const controllerContract = getPayloadsController( payload.payloadsController, - CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP].client, - CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP].blockCreated + CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP] ); const logs = await controllerContract.cacheLogs(); const config = await controllerContract.getPayload(payload.payloadId, logs); @@ -49,7 +29,7 @@ export async function simulateProposal(governanceAddress: Hex, proposalId: bigin payloadId: payload.payloadId, payloadInfo: config, simulation: result, - publicClient: CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP].client, + publicClient: CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP], }) ); payloads.push({ payload: config, simulation: result }); diff --git a/yarn.lock b/yarn.lock index 79f4024..07769f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2503,10 +2503,10 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.10.4: - version "1.10.4" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.10.4.tgz#0c08364192194b067cede4583ad8cf7b02d2dbeb" - integrity sha512-GRnz1KLWh7rDFvR0fMUBt8orVu/QbGJ3QqlLo7M71H4rig39TvjDoVyMp7eFK18+Zs6niqev1f8woX9fv3cwVg== +viem@^1.10.9: + version "1.10.9" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.10.9.tgz#9b16ade429b234f7b33a79544badddbb5498b13c" + integrity sha512-fhQxnMBFwGbyE/VOfcvcavxAPyqIHSgOB793gQcMPH1B9ahQvjMe3C3icqypC01ACaqpDPgYWGfvF/ExTeIPuA== dependencies: "@adraffy/ens-normalize" "1.9.4" "@noble/curves" "1.2.0" From 92812db1646f6498d5b153d643a4c1dc82a37520 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 19:49:20 +0200 Subject: [PATCH 52/94] fix: fix governance execution [skip ci] --- src/govv3/governance.ts | 16 ++++++++++------ src/govv3/simulate.ts | 8 -------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index bfe838a..c10a55a 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -9,6 +9,7 @@ import { getContract, keccak256, parseEther, + parseUnits, toHex, } from 'viem'; import { FilterLogWithTimestamp, getLogs } from '../utils/logs'; @@ -116,13 +117,13 @@ export const getGovernance = ({ address: governanceContract.address, slot: proposalSlot, }); - let bigIntData = fromHex(data!, { to: 'bigint' }); + let proposalSlot1 = fromHex(data!, { to: 'bigint' }); // manipulate storage // set queued - bigIntData = setBits(bigIntData, 0n, 8n, ProposalState.Queued); + proposalSlot1 = setBits(proposalSlot1, 0n, 8n, ProposalState.Queued); // set creation time - bigIntData = setBits( - bigIntData, + proposalSlot1 = setBits( + proposalSlot1, 16n, 56n, currentBlock.timestamp - (await governanceContract.read.PROPOSAL_EXPIRATION_TIME()) @@ -136,12 +137,15 @@ export const getGovernance = ({ functionName: 'executeProposal', args: [proposalId], }), - value: parseEther('0.5').toString(), + // value: parseEther('0.5').toString(), block_number: Number(currentBlock.number), state_objects: { [governanceContract.address]: { storage: { - [proposalSlot]: toHex(bigIntData), + [proposalSlot]: toHex(proposalSlot1), // state & time + // [toHex(fromHex(proposalSlot, { to: 'bigint' }) + 5n)]: toHex(parseUnits('340000000', 18), { + // size: 32, + // }), // votes (not needed as there's no validation for this at this point) }, }, }, diff --git a/src/govv3/simulate.ts b/src/govv3/simulate.ts index adbc7f4..ef7225c 100644 --- a/src/govv3/simulate.ts +++ b/src/govv3/simulate.ts @@ -24,14 +24,6 @@ export async function simulateProposal(governanceAddress: Hex, publicClient: Pub const logs = await controllerContract.cacheLogs(); const config = await controllerContract.getPayload(payload.payloadId, logs); const result = await controllerContract.simulatePayloadExecutionOnTenderly(payload.payloadId, config); - console.log( - await generateReport({ - payloadId: payload.payloadId, - payloadInfo: config, - simulation: result, - publicClient: CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP], - }) - ); payloads.push({ payload: config, simulation: result }); } return { proposal, payloads }; From 0964185259bf2d9f7a964dfc31d39b8bd5cae49e Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 12 Sep 2023 19:55:17 +0200 Subject: [PATCH 53/94] cleanup: remove yargs --- package.json | 1 - src/utils/constants.ts | 2 + yarn.lock | 89 +----------------------------------------- 3 files changed, 3 insertions(+), 89 deletions(-) diff --git a/package.json b/package.json index b5ef01d..3a0086b 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,6 @@ "node-fetch": "^2.6.9", "object-hash": "^3.0.0", "viem": "^1.10.9", - "yargs": "^17.7.2", "zod": "^3.21.4" } } diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 77a53b6..ef86fb1 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,2 +1,4 @@ // arbitrary from EOA for proposal executions export const EOA = '0xD73a92Be73EfbFcF3854433A5FcbAbF9c1316073' as const; + +export const VERBOSE = process.env.VERBOSE; diff --git a/yarn.lock b/yarn.lock index 07769f3..b8fc1d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -682,11 +682,6 @@ acorn@^8.9.0: resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" @@ -694,7 +689,7 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -906,15 +901,6 @@ cids@^1.0.0, cids@^1.1.5, cids@^1.1.6: multihashes "^4.0.1" uint8arrays "^3.0.0" -cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - color-convert@^1.9.0: version "1.9.3" resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" @@ -1019,11 +1005,6 @@ dotenv@^16.3.1: resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz" integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - err-code@^3.0.0, err-code@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz" @@ -1120,11 +1101,6 @@ esbuild@~0.17.6: "@esbuild/win32-ia32" "0.17.19" "@esbuild/win32-x64" "0.17.19" -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" @@ -1214,11 +1190,6 @@ function-bind@^1.1.1: resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" @@ -1446,11 +1417,6 @@ is-extglob@^2.1.1: resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" @@ -2084,11 +2050,6 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - resolve-from@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" @@ -2264,15 +2225,6 @@ std-env@^3.3.3: resolved "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz" integrity sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg== -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" @@ -2280,13 +2232,6 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-bom-string@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz" @@ -2614,15 +2559,6 @@ why-is-node-running@^2.2.2: siginfo "^2.0.0" stackback "0.0.2" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" @@ -2633,11 +2569,6 @@ ws@8.13.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" @@ -2653,24 +2584,6 @@ yargs-parser@^20.2.3: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - -yargs@^17.7.2: - version "17.7.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - yocto-queue@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz" From f621e5e32667e4092778f8472187d791f46ab5b5 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 13 Sep 2023 10:56:20 +0200 Subject: [PATCH 54/94] feat: add proposal reports --- src/commands/ipfs-upload.ts | 2 +- src/govv3/checks/state.ts | 101 +++++++++++++++++ src/govv3/generatePayloadReport.ts | 94 +--------------- src/govv3/generateProposalReport.ts | 106 +++--------------- src/govv3/simulate.ts | 10 +- src/index.ts | 1 + src/ipfs/aip-validation.spec.ts | 21 ---- src/ipfs/aipValidation.spec.ts | 21 ++++ .../{aip-validation.ts => aipValidation.ts} | 0 src/ipfs/parseIpfs.spec.ts | 16 +++ src/ipfs/parseIpfs.ts | 59 ++++++++++ yarn.lock | 2 +- 12 files changed, 226 insertions(+), 207 deletions(-) create mode 100644 src/govv3/checks/state.ts delete mode 100644 src/ipfs/aip-validation.spec.ts create mode 100644 src/ipfs/aipValidation.spec.ts rename src/ipfs/{aip-validation.ts => aipValidation.ts} (100%) create mode 100644 src/ipfs/parseIpfs.spec.ts create mode 100644 src/ipfs/parseIpfs.ts diff --git a/src/commands/ipfs-upload.ts b/src/commands/ipfs-upload.ts index c7ea7c0..91ef45a 100644 --- a/src/commands/ipfs-upload.ts +++ b/src/commands/ipfs-upload.ts @@ -2,7 +2,7 @@ import fs from 'fs'; import path from 'path'; import Hash from 'ipfs-only-hash'; import bs58 from 'bs58'; -import { validateAIPHeader } from '../ipfs/aip-validation'; +import { validateAIPHeader } from '../ipfs/aipValidation'; import { Command } from '@commander-js/extra-typings'; // https://ethereum.stackexchange.com/questions/44506/ipfs-hash-algorithm diff --git a/src/govv3/checks/state.ts b/src/govv3/checks/state.ts new file mode 100644 index 0000000..91d9e8b --- /dev/null +++ b/src/govv3/checks/state.ts @@ -0,0 +1,101 @@ +import { Hex, getAddress } from 'viem'; +import { ProposalCheck } from './types'; +import { getContractName } from '../utils/solidityUtils'; +import { StateDiff } from '../../utils/tenderlyClient'; +import { tenderlyDeepDiff } from '../utils/tenderlyDeepDiff'; +import { interpretStateChange } from '../utils/stateDiffInterpreter'; + +export const checkStateChanges: ProposalCheck = { + name: 'Reports all state changes', + async checkProposal(proposal, simulation, publicClient) { + const info: string[] = []; + const warnings: string[] = []; + const errors: string[] = []; + if (!simulation.transaction.status) { + const txInfo = simulation.transaction.transaction_info; + const reason = txInfo.stack_trace ? txInfo.stack_trace[0].error_reason : 'unknown error'; + errors.push(`Transaction reverted with reason: ${reason}`); + } else { + // State diffs in the simulation are an array, so first we organize them by address. + const stateDiffs = simulation.transaction.transaction_info.state_diff.reduce((diffs, diff) => { + // TODO: double check if that's safe to skip + if (!diff.raw?.[0]) return diffs; + const addr = getAddress(diff.raw[0].address); + if (!diffs[addr]) diffs[addr] = [diff]; + else diffs[addr].push(diff); + return diffs; + }, {} as Record); + + if (!Object.keys(stateDiffs).length) { + warnings.push(`No state changes detected`); + } else { + let stateChanges = ''; + let warnings = ''; + // Parse state changes at each address + for (const [address, diffs] of Object.entries(stateDiffs)) { + // Use contracts array to get contract name of address + stateChanges += `\n\`\`\`diff\n# ${getContractName(simulation.contracts, address)}\n`; + + // Parse each diff. A single diff may involve multiple storage changes, e.g. a proposal that + // executes three transactions will show three state changes to the `queuedTransactions` + // mapping within a single `diff` element. We always JSON.stringify the values so structs + // (i.e. tuples) don't print as [object Object] + for (const diff of diffs) { + if (!diff.soltype) { + // In this branch, state change is not decoded, so return raw data of each storage write + // (all other branches have decoded state changes) + diff.raw.forEach((w) => { + const oldVal = JSON.stringify(w.original); + const newVal = JSON.stringify(w.dirty); + // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` + stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); + }); + } else if (diff.soltype.simple_type) { + // This is a simple type with a single changed value + // const oldVal = JSON.parse(JSON.stringify(diff.original)) + // const newVal = JSON.parse(JSON.stringify(diff.dirty)) + // info += `\n - \`${diff.soltype.name}\` changed from \`${oldVal}\` to \`${newVal}\`` + stateChanges += tenderlyDeepDiff(diff.original, diff.dirty, diff.soltype.name); + } else if (diff.soltype.type.startsWith('mapping')) { + // This is a complex type like a mapping, which may have multiple changes. The diff.original + // and diff.dirty fields can be strings or objects, and for complex types they are objects, + // so we cast them as such + const keys = Object.keys(diff.original); + const original = diff.original as Record; + const dirty = diff.dirty as Record; + for (const k of keys as Hex[]) { + stateChanges += tenderlyDeepDiff(original[k], dirty[k], `\`${diff.soltype?.name}\` key \`${k}\``); + const interpretation = await interpretStateChange( + address, + diff.soltype?.name, + original[k], + dirty[k], + k, + publicClient + ); + if (interpretation) stateChanges += `\n${interpretation}`; + stateChanges += '\n'; + } + } else { + // TODO arrays and nested mapping are currently not well supported -- find a transaction + // that changes state of these types to inspect the Tenderly simulation response and + // handle it accordingly. In the meantime we show the raw state changes and print a + // warning about decoding the data + diff.raw.forEach((w) => { + const oldVal = JSON.stringify(w.original); + const newVal = JSON.stringify(w.dirty); + // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` + stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); + warnings += `Could not parse state: add support for formatting type ${diff.soltype?.type} (slot ${w.key})\n`; + }); + } + } + stateChanges += '```\n'; + } + + info.push(stateChanges); + } + } + return { info, warnings, errors }; + }, +}; diff --git a/src/govv3/generatePayloadReport.ts b/src/govv3/generatePayloadReport.ts index cb503f6..6d1c1a9 100644 --- a/src/govv3/generatePayloadReport.ts +++ b/src/govv3/generatePayloadReport.ts @@ -9,6 +9,7 @@ import { checkTargetsNoSelfdestruct, checkTouchedContractsNoSelfdestruct } from import { CheckResult, ProposalCheck } from './checks/types'; import { checkLogs } from './checks/logs'; import { checkTargetsVerifiedEtherscan, checkTouchedContractsVerifiedEtherscan } from './checks/targets-verified'; +import { checkStateChanges } from './checks/state'; type GenerateReportRequest = { payloadId: number; @@ -35,99 +36,8 @@ export async function generateReport({ payloadId, payloadInfo, simulation, publi } report += '\n'; - // check if simulation was successful - report += `### Simulation ${boolToMarkdown(simulation.transaction.status)}\n\n`; - if (!simulation.transaction.status) { - const txInfo = simulation.transaction.transaction_info; - const reason = txInfo.stack_trace ? txInfo.stack_trace[0].error_reason : 'unknown error'; - report += `Transaction reverted with reason: ${reason}`; - } else { - // State diffs in the simulation are an array, so first we organize them by address. - const stateDiffs = simulation.transaction.transaction_info.state_diff.reduce((diffs, diff) => { - // TODO: double check if that's safe to skip - if (!diff.raw?.[0]) return diffs; - const addr = getAddress(diff.raw[0].address); - if (!diffs[addr]) diffs[addr] = [diff]; - else diffs[addr].push(diff); - return diffs; - }, {} as Record); - - if (!Object.keys(stateDiffs).length) { - report += `No state changes detected`; - } else { - let stateChanges = ''; - let warnings = ''; - // Parse state changes at each address - for (const [address, diffs] of Object.entries(stateDiffs)) { - // Use contracts array to get contract name of address - stateChanges += `\n\`\`\`diff\n# ${getContractName(simulation.contracts, address)}\n`; - - // Parse each diff. A single diff may involve multiple storage changes, e.g. a proposal that - // executes three transactions will show three state changes to the `queuedTransactions` - // mapping within a single `diff` element. We always JSON.stringify the values so structs - // (i.e. tuples) don't print as [object Object] - for (const diff of diffs) { - if (!diff.soltype) { - // In this branch, state change is not decoded, so return raw data of each storage write - // (all other branches have decoded state changes) - diff.raw.forEach((w) => { - const oldVal = JSON.stringify(w.original); - const newVal = JSON.stringify(w.dirty); - // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` - stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); - }); - } else if (diff.soltype.simple_type) { - // This is a simple type with a single changed value - // const oldVal = JSON.parse(JSON.stringify(diff.original)) - // const newVal = JSON.parse(JSON.stringify(diff.dirty)) - // info += `\n - \`${diff.soltype.name}\` changed from \`${oldVal}\` to \`${newVal}\`` - stateChanges += tenderlyDeepDiff(diff.original, diff.dirty, diff.soltype.name); - } else if (diff.soltype.type.startsWith('mapping')) { - // This is a complex type like a mapping, which may have multiple changes. The diff.original - // and diff.dirty fields can be strings or objects, and for complex types they are objects, - // so we cast them as such - const keys = Object.keys(diff.original); - const original = diff.original as Record; - const dirty = diff.dirty as Record; - for (const k of keys as Hex[]) { - stateChanges += tenderlyDeepDiff(original[k], dirty[k], `\`${diff.soltype?.name}\` key \`${k}\``); - const interpretation = await interpretStateChange( - address, - diff.soltype?.name, - original[k], - dirty[k], - k, - publicClient - ); - if (interpretation) stateChanges += `\n${interpretation}`; - stateChanges += '\n'; - } - } else { - // TODO arrays and nested mapping are currently not well supported -- find a transaction - // that changes state of these types to inspect the Tenderly simulation response and - // handle it accordingly. In the meantime we show the raw state changes and print a - // warning about decoding the data - diff.raw.forEach((w) => { - const oldVal = JSON.stringify(w.original); - const newVal = JSON.stringify(w.dirty); - // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` - stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); - warnings += `Could not parse state: add support for formatting type ${diff.soltype?.type} (slot ${w.key})\n`; - }); - } - } - stateChanges += '```\n'; - } - - if (warnings) { - report += `#### Warnings\n`; - report += warnings; - } - report += `#### State Changes\n`; - report += stateChanges; - } - } const checks = [ + checkStateChanges, checkLogs, checkTargetsVerifiedEtherscan, checkTouchedContractsVerifiedEtherscan, diff --git a/src/govv3/generateProposalReport.ts b/src/govv3/generateProposalReport.ts index bfb4bdd..06d88b9 100644 --- a/src/govv3/generateProposalReport.ts +++ b/src/govv3/generateProposalReport.ts @@ -8,6 +8,8 @@ import { checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; import { checkLogs } from './checks/logs'; import { checkTouchedContractsVerifiedEtherscan } from './checks/targets-verified'; import { Governance, HUMAN_READABLE_STATE } from './governance'; +import { checkStateChanges } from './checks/state'; +import { getProposalMetadata } from '../ipfs/parseIpfs'; type GenerateReportRequest = { proposalId: bigint; @@ -43,99 +45,23 @@ export async function generateProposalReport({ } report += '\n'; - // check if simulation was successful - report += `### Simulation ${boolToMarkdown(simulation.transaction.status)}\n\n`; - if (!simulation.transaction.status) { - const txInfo = simulation.transaction.transaction_info; - const reason = txInfo.stack_trace ? txInfo.stack_trace[0].error_reason : 'unknown error'; - report += `Transaction reverted with reason: ${reason}`; - } else { - // State diffs in the simulation are an array, so first we organize them by address. - const stateDiffs = simulation.transaction.transaction_info.state_diff.reduce((diffs, diff) => { - // TODO: double check if that's safe to skip - if (!diff.raw?.[0]) return diffs; - const addr = getAddress(diff.raw[0].address); - if (!diffs[addr]) diffs[addr] = [diff]; - else diffs[addr].push(diff); - return diffs; - }, {} as Record); + const ipfsMeta = await getProposalMetadata(proposal.ipfsHash, process.env.IPFS_GATEWAY); + report += `### Ipfs - if (!Object.keys(stateDiffs).length) { - report += `No state changes detected`; - } else { - let stateChanges = ''; - let warnings = ''; - // Parse state changes at each address - for (const [address, diffs] of Object.entries(stateDiffs)) { - // Use contracts array to get contract name of address - stateChanges += `\n\`\`\`diff\n# ${getContractName(simulation.contracts, address)}\n`; +
+ Proposal text + + ${ipfsMeta.description} +
`; - // Parse each diff. A single diff may involve multiple storage changes, e.g. a proposal that - // executes three transactions will show three state changes to the `queuedTransactions` - // mapping within a single `diff` element. We always JSON.stringify the values so structs - // (i.e. tuples) don't print as [object Object] - for (const diff of diffs) { - if (!diff.soltype) { - // In this branch, state change is not decoded, so return raw data of each storage write - // (all other branches have decoded state changes) - diff.raw.forEach((w) => { - const oldVal = JSON.stringify(w.original); - const newVal = JSON.stringify(w.dirty); - // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` - stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); - }); - } else if (diff.soltype.simple_type) { - // This is a simple type with a single changed value - // const oldVal = JSON.parse(JSON.stringify(diff.original)) - // const newVal = JSON.parse(JSON.stringify(diff.dirty)) - // info += `\n - \`${diff.soltype.name}\` changed from \`${oldVal}\` to \`${newVal}\`` - stateChanges += tenderlyDeepDiff(diff.original, diff.dirty, diff.soltype.name); - } else if (diff.soltype.type.startsWith('mapping')) { - // This is a complex type like a mapping, which may have multiple changes. The diff.original - // and diff.dirty fields can be strings or objects, and for complex types they are objects, - // so we cast them as such - const keys = Object.keys(diff.original); - const original = diff.original as Record; - const dirty = diff.dirty as Record; - for (const k of keys as Hex[]) { - stateChanges += tenderlyDeepDiff(original[k], dirty[k], `\`${diff.soltype?.name}\` key \`${k}\``); - const interpretation = await interpretStateChange( - address, - diff.soltype?.name, - original[k], - dirty[k], - k, - publicClient - ); - if (interpretation) stateChanges += `\n${interpretation}`; - stateChanges += '\n'; - } - } else { - // TODO arrays and nested mapping are currently not well supported -- find a transaction - // that changes state of these types to inspect the Tenderly simulation response and - // handle it accordingly. In the meantime we show the raw state changes and print a - // warning about decoding the data - diff.raw.forEach((w) => { - const oldVal = JSON.stringify(w.original); - const newVal = JSON.stringify(w.dirty); - // info += `\n - Slot \`${w.key}\` changed from \`${oldVal}\` to \`${newVal}\`` - stateChanges += tenderlyDeepDiff(oldVal, newVal, `Slot \`${w.key}\``); - warnings += `Could not parse state: add support for formatting type ${diff.soltype?.type} (slot ${w.key})\n`; - }); - } - } - stateChanges += '```\n'; - } + // check if simulation was successful - if (warnings) { - report += `#### Warnings\n`; - report += warnings; - } - report += `#### State Changes\n`; - report += stateChanges; - } - } - const checks = [checkLogs, checkTouchedContractsVerifiedEtherscan, checkTouchedContractsNoSelfdestruct]; + const checks = [ + checkStateChanges, + checkLogs, + checkTouchedContractsVerifiedEtherscan, + checkTouchedContractsNoSelfdestruct, + ]; for (const check of checks) { const result = await check.checkProposal(proposalInfo, simulation, publicClient); diff --git a/src/govv3/simulate.ts b/src/govv3/simulate.ts index ef7225c..8b03096 100644 --- a/src/govv3/simulate.ts +++ b/src/govv3/simulate.ts @@ -3,9 +3,15 @@ import { TenderlySimulationResponse } from '../utils/tenderlyClient'; import { getGovernance } from './governance'; import { Hex, PublicClient } from 'viem'; import { PayloadsController, getPayloadsController } from './payloadsController'; -import { generateReport } from './generatePayloadReport'; import { CHAIN_ID_CLIENT_MAP } from '../utils/rpcClients'; +/** + * Reference implementation, unused + * @param governanceAddress + * @param publicClient + * @param proposalId + * @returns + */ export async function simulateProposal(governanceAddress: Hex, publicClient: PublicClient, proposalId: bigint) { logInfo('General', `Running simulation for ${proposalId}`); const governance = getGovernance({ address: governanceAddress, publicClient }); @@ -19,7 +25,7 @@ export async function simulateProposal(governanceAddress: Hex, publicClient: Pub for (const payload of proposal.proposal.payloads) { const controllerContract = getPayloadsController( payload.payloadsController, - CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP] + CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient ); const logs = await controllerContract.cacheLogs(); const config = await controllerContract.getPayload(payload.payloadId, logs); diff --git a/src/index.ts b/src/index.ts index dc7c99e..1984a67 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ export * from './reports/diff-reports'; export { simulateProposal } from './govv3/simulate'; +export { getProposalMetadata } from './ipfs/parseIpfs'; export * from './govv3/governance'; export * from './govv3/payloadsController'; export * from './govv3/generatePayloadReport'; diff --git a/src/ipfs/aip-validation.spec.ts b/src/ipfs/aip-validation.spec.ts deleted file mode 100644 index e7b4eb3..0000000 --- a/src/ipfs/aip-validation.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { describe, it, expect } from "vitest"; -import { validateAIPHeader } from "./aip-validation"; - -describe("validateAIP", () => { - it("should succeed when all keys are present", () => { - const header = `--- -title: TestTitle -discussions: TestDiscussion -author: TestAuthor ----`; - expect(validateAIPHeader(header)).toBe("TestTitle"); - }); - - it("should throw when required key is missing", () => { - const header = `--- -title: TestTitle -discussions: testDiscussion ----`; - expect(() => validateAIPHeader(header)).toThrow(); - }); -}); diff --git a/src/ipfs/aipValidation.spec.ts b/src/ipfs/aipValidation.spec.ts new file mode 100644 index 0000000..08c8e27 --- /dev/null +++ b/src/ipfs/aipValidation.spec.ts @@ -0,0 +1,21 @@ +import { describe, it, expect } from 'vitest'; +import { validateAIPHeader } from './aipValidation'; + +describe('validateAIP', () => { + it('should succeed when all keys are present', () => { + const header = `--- +title: TestTitle +discussions: TestDiscussion +author: TestAuthor +---`; + expect(validateAIPHeader(header)).toBe('TestTitle'); + }); + + it('should throw when required key is missing', () => { + const header = `--- +title: TestTitle +discussions: testDiscussion +---`; + expect(() => validateAIPHeader(header)).toThrow(); + }); +}); diff --git a/src/ipfs/aip-validation.ts b/src/ipfs/aipValidation.ts similarity index 100% rename from src/ipfs/aip-validation.ts rename to src/ipfs/aipValidation.ts diff --git a/src/ipfs/parseIpfs.spec.ts b/src/ipfs/parseIpfs.spec.ts new file mode 100644 index 0000000..8fa490e --- /dev/null +++ b/src/ipfs/parseIpfs.spec.ts @@ -0,0 +1,16 @@ +import { describe, it, expect } from 'vitest'; +import { getProposalMetadata } from './parseIpfs'; + +describe('parse-ipfs', () => { + it('should work fine with json proposals', async () => { + const hash = 'QmNgK8kbBgznCag29VwwBz5Q8DXDM658BQzsfAHyLqR7mF'; + const proposal = await getProposalMetadata(hash); + expect(proposal.title).toBe('Add cbETH to Aave V3 Ethereum'); + }); + + it('should work fine with text proposals', async () => { + const hash = `Qmaxgt7HX9k4AdgixFLGTVnS17WYq9YguN1f3ncKW1HxBV`; + const proposal = await getProposalMetadata(hash); + expect(proposal.title).toBe('Chaos Labs Risk Parameter Updates _ Aave V3 Ethereum'); + }); +}); diff --git a/src/ipfs/parseIpfs.ts b/src/ipfs/parseIpfs.ts new file mode 100644 index 0000000..9d6ddba --- /dev/null +++ b/src/ipfs/parseIpfs.ts @@ -0,0 +1,59 @@ +import matter from 'gray-matter'; +import base58 from 'bs58'; +import fetch from 'node-fetch'; + +export type ProposalMetadata = { + title: string; + description: string; + shortDescription?: string; + ipfsHash: string; + aip?: number; + discussions: string; + author: string; +}; + +export function getLink(hash: string, gateway: string): string { + return `${gateway}/${hash}`; +} + +export async function getProposalMetadata( + hash: string, + gateway: string = 'https://cloudflare-ipfs.com/ipfs' +): Promise { + const ipfsHash = hash.startsWith('0x') ? base58.encode(Buffer.from(`1220${hash.slice(2)}`, 'hex')) : hash; + try { + const ipfsResponse = await fetch(getLink(ipfsHash, gateway), { + headers: { + 'Content-Type': 'application/json', + }, + }); + if (!ipfsResponse.ok) throw Error('Fetch not working'); + const clone = await ipfsResponse.clone(); + try { + const response = await ipfsResponse.json(); + const { content, data } = matter(response.description); + return { + ...response, + ipfsHash, + description: content, + ...data, + }; + // matter will error in case the proposal is not valid yaml (like on proposal 0) + // therefore in the case of an error we just inline the complete ipfs content + } catch (e) { + const { content, data } = matter(await clone.text()); + return { + ...ipfsResponse, + ipfsHash, + description: content, + ...(data as { title: string; discussions: string; author: string }), + }; + } + } catch (e) { + return { + ipfsHash, + description: 'ipfs file not reachable', + title: 'ipfs file not reachable', + } as ProposalMetadata; + } +} diff --git a/yarn.lock b/yarn.lock index b8fc1d6..5d086dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1240,7 +1240,7 @@ globby@^11.0.3: gray-matter@^4.0.3: version "4.0.3" - resolved "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz" + resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798" integrity sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q== dependencies: js-yaml "^3.13.1" From af850481f58cc31cf18e7890f2e733d05b9cc6fa Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 13 Sep 2023 11:09:42 +0200 Subject: [PATCH 55/94] fix: spacing --- src/govv3/generateProposalReport.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/govv3/generateProposalReport.ts b/src/govv3/generateProposalReport.ts index 06d88b9..c754fc1 100644 --- a/src/govv3/generateProposalReport.ts +++ b/src/govv3/generateProposalReport.ts @@ -48,11 +48,11 @@ export async function generateProposalReport({ const ipfsMeta = await getProposalMetadata(proposal.ipfsHash, process.env.IPFS_GATEWAY); report += `### Ipfs -
- Proposal text +
+ Proposal text ${ipfsMeta.description} -
`; +
`; // check if simulation was successful From e0ea58ffe4fc99f0a11888c33debc7f3b78d68ea Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 13 Sep 2023 21:41:26 +0200 Subject: [PATCH 56/94] votingProofs: add ability to get voting proofs --- src/commands/governance.ts | 37 ++++++++++++------------------------- src/govv3/governance.ts | 14 +++++++++++--- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 964d141..2872e5d 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -4,17 +4,7 @@ import { GovernanceV3Goerli, IVotingMachineWithProofs_ABI, IVotingPortal_ABI } f import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/governance'; import { CHAIN_ID_CLIENT_MAP, goerliClient } from '../utils/rpcClients'; import { logError, logInfo, logSuccess } from '../utils/logger'; -import { - Hex, - PublicClient, - createWalletClient, - encodeAbiParameters, - encodeFunctionData, - getContract, - http, -} from 'viem'; -import { getAccountRPL } from '../govv3/proofs'; -import { bigint } from 'zod'; +import { Hex, PublicClient, createWalletClient, encodeFunctionData, getContract, http } from 'viem'; const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; const DEFAULT_CLIENT = goerliClient; @@ -128,7 +118,16 @@ export function addCommand(program: Command) { const proposalId = BigInt(options.getOptionValue('proposalId')); const voter = options.getOptionValue('voter') as Hex; - // const proofs = await governance.getVotingProofs(proposalId, voter); + const proposal = await governance.governanceContract.read.getProposal([proposalId]); + + const portal = getContract({ + address: proposal.votingPortal, + abi: IVotingPortal_ABI, + publicClient: DEFAULT_CLIENT, + }); + const chainId = await portal.read.VOTING_MACHINE_CHAIN_ID(); + const proofs = await governance.getVotingProofs(proposalId, voter as Hex, chainId); + console.log(proofs); // TODO: format so foundry can consume it }); govV3 @@ -170,19 +169,7 @@ export function addCommand(program: Command) { const encodedData = encodeFunctionData({ abi: IVotingMachineWithProofs_ABI, functionName: 'submitVote', - args: [ - proposalId, - !!voteFor, - proofs - .map(({ proof, slots }) => { - return slots.map((slot, ix) => ({ - underlyingAsset: proof.address, - slot, - proof: getAccountRPL(proof.storageProof[ix].proof), - })); - }) - .flat(), - ], + args: [proposalId, !!voteFor, proofs], }); logInfo('Voting', `Encoded data to be submitted on ${chainId}:${machine}`); logSuccess('Encoded data', encodedData); diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index c10a55a..eb5a4fc 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -22,7 +22,7 @@ import { getSolidityStorageSlotUint, } from '../utils/storageSlots'; import { setBits } from './utils/solidityUtils'; -import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getProof } from './proofs'; +import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from './proofs'; type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; @@ -76,7 +76,7 @@ export interface Governance { proposalId: bigint, voter: Hex, votingChainId: bigint - ) => Promise<{ proof: Proof; slots: readonly bigint[] }[]>; + ) => Promise<{ proof: Hex; slot: bigint; underlyingAsset: Hex }[]>; getRoots: (proposalId: bigint) => any; } @@ -292,7 +292,15 @@ export const getGovernance = ({ { proof: aaveProof, slots: [0n] }, { proof: aAaveProof, slots: [52n, 64n] }, { proof: representativeProof, slots: [9n] }, - ]; + ] + .map(({ proof, slots }) => { + return slots.map((slot, ix) => ({ + underlyingAsset: proof.address, + slot, + proof: getAccountRPL(proof.storageProof[ix].proof), + })); + }) + .flat(); }, async getRoots(proposalId: bigint) { const proposal = await governanceContract.read.getProposal([proposalId]); From 5176dcbd1fabe38129430c1da9217fb7db1e9b02 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Thu, 14 Sep 2023 08:37:58 +0200 Subject: [PATCH 57/94] fix: optimize the proofs --- src/govv3/governance.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index eb5a4fc..553aba4 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -294,11 +294,16 @@ export const getGovernance = ({ { proof: representativeProof, slots: [9n] }, ] .map(({ proof, slots }) => { - return slots.map((slot, ix) => ({ - underlyingAsset: proof.address, - slot, - proof: getAccountRPL(proof.storageProof[ix].proof), - })); + return ( + slots + // filter out zero proofs as they don't add any value + .filter((slot, ix) => proof.storageProof[ix].value !== '0x0') + .map((slot, ix) => ({ + underlyingAsset: proof.address, + slot, + proof: getAccountRPL(proof.storageProof[ix].proof), + })) + ); }) .flat(); }, From f2cc05cf040a96dfb8a794bb381f9dd9152db48b Mon Sep 17 00:00:00 2001 From: sakulstra Date: Sat, 16 Sep 2023 16:03:19 +0200 Subject: [PATCH 58/94] fix: new gov cli ui --- package.json | 1 + src/commands/governance.ts | 169 ++++++++++++----- src/govv3/governance.ts | 56 +++++- src/ipfs/getCachedProposalMetaData.ts | 13 ++ src/utils/cache.ts | 28 +++ src/utils/logger.ts | 2 +- src/utils/logs.ts | 19 +- yarn.lock | 260 +++++++++++++++++++++++++- 8 files changed, 479 insertions(+), 69 deletions(-) create mode 100644 src/ipfs/getCachedProposalMetaData.ts create mode 100644 src/utils/cache.ts diff --git a/package.json b/package.json index 3a0086b..a5e3fe5 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "dependencies": { "@bgd-labs/aave-address-book": "2.3.1-dfb6302aa92b55201141b7d43094327c4a646cf1.0", "@commander-js/extra-typings": "^11.0.0", + "@inquirer/prompts": "^3.1.1", "bs58": "^5.0.0", "chalk": "^4.1.2", "commander": "^11.0.0", diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 2872e5d..c206714 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -5,6 +5,17 @@ import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/gov import { CHAIN_ID_CLIENT_MAP, goerliClient } from '../utils/rpcClients'; import { logError, logInfo, logSuccess } from '../utils/logger'; import { Hex, PublicClient, createWalletClient, encodeFunctionData, getContract, http } from 'viem'; +import { input, select } from '@inquirer/prompts'; +import { getCachedIpfs } from '../ipfs/getCachedProposalMetaData'; +import { toAddressLink, toTxLink } from '../govv3/utils/markdownUtils'; + +enum DialogOptions { + DETAILS, + IPFS_TEXT, + TRANSACTIONS, + HOW_TO_VOTE, + EXIT, +} const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; const DEFAULT_CLIENT = goerliClient; @@ -32,56 +43,128 @@ export function addCommand(program: Command) { }); const logs = await governance.cacheLogs(); const count = await governance.governanceContract.read.getProposalsCount(); - const proposalIds = [...Array(Number(count)).keys()]; - for (const proposalId of proposalIds) { - const { createdLog, executedLog, payloadSentLog, votingActivatedLog, queuedLog, proposal } = - await governance.getProposal(BigInt(proposalId), logs); - logInfo( - `Proposal ${proposalId}`, - `### Proposal ${proposalId} Summary ###\n` + - `State: ${HUMAN_READABLE_STATE[proposal.state as keyof typeof HUMAN_READABLE_STATE]}\n` + - `For Votes: ${proposal.forVotes}\n` + - `Against Votes: ${proposal.againstVotes}\n` + - `Creator: ${proposal.creator}\n` + - `Payloads: ${JSON.stringify( - proposal.payloads, - (key, value) => (typeof value === 'bigint' ? value.toString() : value), - 2 - )}` - ); - logInfo( - `Proposal ${proposalId} log`, - `${new Date(createdLog.timestamp * 1000).toLocaleString()} Proposal created` - ); - if (votingActivatedLog) { - logInfo( - `Proposal ${proposalId} log`, - `${new Date(votingActivatedLog.timestamp * 1000).toLocaleString()} Voting activated` - ); + const proposalIds = [...Array(Number(count)).keys()].reverse(); + const selectedProposalId = await select({ + message: 'Select a proposal to get more information', + choices: await Promise.all( + proposalIds.map(async (id) => { + const proposal = await governance.getProposal(BigInt(id)); + const ipfs = await getCachedIpfs(proposal.ipfsHash); + const title = `${id} - ${HUMAN_READABLE_STATE[proposal.state as keyof typeof HUMAN_READABLE_STATE]} | ${ + ipfs.title + }`; + return { name: title, value: id }; + }) + ), + }); + const { proposal, ...proposalLogs } = await governance.getProposalAndLogs(BigInt(selectedProposalId), logs); + let exitLvl2 = false; + while (!exitLvl2) { + const moreInfo = await select({ + message: 'What do you want to do?', + choices: [ + { + name: 'Show details', + value: DialogOptions.DETAILS, + }, + { + name: 'Show ipfs details', + value: DialogOptions.IPFS_TEXT, + }, + { + name: 'Show transactions', + value: DialogOptions.TRANSACTIONS, + }, + { + name: 'Show me How to vote', + value: DialogOptions.HOW_TO_VOTE, + }, + { + name: 'Exit', + value: DialogOptions.EXIT, + }, + ], + }); + + if (moreInfo == DialogOptions.EXIT) { + exitLvl2 = true; } - if (queuedLog) { - logInfo( - `Proposal ${proposalId} log`, - `${new Date(queuedLog.timestamp * 1000).toLocaleString()} Proposal queued` - ); + + if (moreInfo == DialogOptions.IPFS_TEXT) { + const ipfs = await getCachedIpfs(proposal.ipfsHash); + logInfo('title', ipfs.title); + logInfo('author', ipfs.author); + logInfo('discussion', ipfs.discussions); + logInfo('description', ipfs.description); } - if (executedLog) { - logInfo( - `Proposal ${proposalId} log`, - `${new Date(executedLog.timestamp * 1000).toLocaleString()} Proposal executed` - ); + + if (moreInfo == DialogOptions.TRANSACTIONS) { + logInfo('CreatedLog', toTxLink(proposalLogs.createdLog.transactionHash, false, DEFAULT_CLIENT)); + if (proposalLogs.votingActivatedLog) + logInfo( + 'VotingActicated', + toTxLink(proposalLogs.votingActivatedLog.transactionHash, false, DEFAULT_CLIENT) + ); + if (proposalLogs.queuedLog) + logInfo('QueuedLog', toTxLink(proposalLogs.queuedLog.transactionHash, false, DEFAULT_CLIENT)); + if (proposalLogs.executedLog) + logInfo('ExecutedLog', toTxLink(proposalLogs.executedLog.transactionHash, false, DEFAULT_CLIENT)); + if (proposalLogs.payloadSentLog) + proposalLogs.payloadSentLog.map((psLog) => + logInfo('ExecutedLog', toTxLink(psLog.transactionHash, false, DEFAULT_CLIENT)) + ); } - if (payloadSentLog) { - payloadSentLog.map((log) => { + + if (moreInfo == DialogOptions.DETAILS) { + logInfo('Creator', proposal.creator); + logInfo('ForVotes', proposal.forVotes); + logInfo('AgainstVotes', proposal.againstVotes); + logInfo('AccessLevel', proposal.accessLevel); + logInfo('VotingPortal', proposal.votingPortal); + proposal.payloads.map((payload, ix) => { + logInfo(`Payload.${ix}.accessLevel`, payload.accessLevel); logInfo( - `Proposal ${proposalId} log`, - `${new Date(log.timestamp * 1000).toLocaleString()} Payload ${log.args.payloadId}:${ - log.args.payloadsController - } sent to chainId:${log.args.chainId}` + `Payload.${ix}.chain`, + CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP].chain.name ); + logInfo(`Payload.${ix}.payloadId`, payload.payloadId); + logInfo(`Payload.${ix}.payloadsController`, payload.payloadsController); + }); + } + + if (moreInfo == DialogOptions.HOW_TO_VOTE) { + const address = (await input({ + message: 'Enter the address you would like to vote with', + })) as Hex; + const portal = getContract({ + address: proposal.votingPortal, + abi: IVotingPortal_ABI, + publicClient: DEFAULT_CLIENT, }); + const [machine, chainId] = await Promise.all([ + portal.read.VOTING_MACHINE(), + portal.read.VOTING_MACHINE_CHAIN_ID(), + ]); + const proofs = await governance.getVotingProofs(BigInt(selectedProposalId), address, chainId); + if (proofs.length == 0) logError('Voting Error', 'You need voting power to vote'); + else { + logInfo( + 'Explorer', + toAddressLink( + machine, + false, + CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient + ) + ); + logInfo('Method', 'submitVote'); + logInfo('parameter proposalId', selectedProposalId); + logInfo('parameter support', 'true if in support, false if against'); + logInfo( + 'parameter votingBalanceProofs', + JSON.stringify(proofs.map((p) => [p.underlyingAsset, p.slot.toString(), p.proof])) + ); + } } - console.log(`\n`); } }); diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index 553aba4..9013e64 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -7,9 +7,6 @@ import { encodeFunctionData, fromHex, getContract, - keccak256, - parseEther, - parseUnits, toHex, } from 'viem'; import { FilterLogWithTimestamp, getLogs } from '../utils/logs'; @@ -22,10 +19,13 @@ import { getSolidityStorageSlotUint, } from '../utils/storageSlots'; import { setBits } from './utils/solidityUtils'; -import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from './proofs'; +import { VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from './proofs'; +import { readJSONCache, writeJSONCache } from '../utils/cache'; +import path from 'path'; type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; +type CanceledLog = FilterLogWithTimestamp; type ExecutedLog = FilterLogWithTimestamp; type PayloadSentLog = FilterLogWithTimestamp; type VotingActivatedLog = FilterLogWithTimestamp; @@ -41,6 +41,10 @@ export enum ProposalState { Expired, } +function isStateFinal(state: ProposalState) { + return [ProposalState.Executed, ProposalState.Failed, ProposalState.Cancelled, ProposalState.Expired].includes(state); +} + export interface Governance { governanceContract: GetContractReturnType; cacheLogs: () => Promise<{ @@ -49,8 +53,16 @@ export interface Governance { executedLogs: Array; payloadSentLogs: Array; votingActivatedLogs: Array; + canceledLogs: Array; }>; - getProposal: ( + /** + * Thin caching wrapper on top of getProposal. + * If the proposal state is final, the proposal will be stored in json and fetched from there. + * @param proposalId + * @returns Proposal struct + */ + getProposal: (proposalId: bigint) => Promise>; + getProposalAndLogs: ( proposalId: bigint, logs: Awaited['cacheLogs']>> ) => Promise<{ @@ -110,6 +122,16 @@ export const getGovernance = ({ }: GetGovernanceParams): Governance => { const governanceContract = getContract({ abi: IGovernanceCore_ABI, address, publicClient, walletClient }); + async function getProposal(proposalId: bigint) { + const filePath = publicClient.chain!.id.toString() + `/proposals`; + const fileName = proposalId; + const cache = readJSONCache(filePath, fileName.toString()); + if (cache) return cache; + const proposal = await governanceContract.read.getProposal([proposalId]); + if (isStateFinal(proposal.state)) writeJSONCache(filePath, fileName.toString(), proposal); + return proposal; + } + async function getSimulationPayloadForExecution(proposalId: bigint) { const currentBlock = await publicClient.getBlock(); const proposalSlot = getSolidityStorageSlotUint(SLOTS.PROPOSALS_MAPPING, proposalId); @@ -221,10 +243,24 @@ export const getGovernance = ({ }, blockCreated ); - return { createdLogs, queuedLogs, executedLogs, payloadSentLogs, votingActivatedLogs }; + const canceledLogs = await getLogs( + publicClient, + (fromBlock, toBlock) => { + return governanceContract.createEventFilter.ProposalCanceled( + {}, + { + fromBlock: fromBlock, + toBlock, + } + ); + }, + blockCreated + ); + return { createdLogs, queuedLogs, executedLogs, payloadSentLogs, votingActivatedLogs, canceledLogs }; }, - async getProposal(proposalId, logs) { - const proposal = await governanceContract.read.getProposal([proposalId]); + getProposal, + async getProposalAndLogs(proposalId, logs) { + const proposal = await getProposal(proposalId); const createdLog = logs.createdLogs.find((log) => String(log.args.proposalId) === proposalId.toString())!; const votingActivatedLog = logs.votingActivatedLogs.find( (log) => String(log.args.proposalId) === proposalId.toString() @@ -247,7 +283,7 @@ export const getGovernance = ({ return tenderly.simulate(payload); }, async getVotingProofs(proposalId: bigint, voter: Hex, votingChainId: bigint) { - const proposal = await governanceContract.read.getProposal([proposalId]); + const proposal = await getProposal(proposalId); const [stkAaveProof, aaveProof, aAaveProof, representativeProof] = await Promise.all([ getProof( @@ -308,7 +344,7 @@ export const getGovernance = ({ .flat(); }, async getRoots(proposalId: bigint) { - const proposal = await governanceContract.read.getProposal([proposalId]); + const proposal = await getProposal(proposalId); const proofs = await Promise.all( (Object.keys(WAREHOUSE_SLOTS) as (keyof typeof WAREHOUSE_SLOTS)[]).map((key) => diff --git a/src/ipfs/getCachedProposalMetaData.ts b/src/ipfs/getCachedProposalMetaData.ts new file mode 100644 index 0000000..a920b81 --- /dev/null +++ b/src/ipfs/getCachedProposalMetaData.ts @@ -0,0 +1,13 @@ +import { readJSONCache, writeJSONCache } from '../utils/cache'; +import { ProposalMetadata, getProposalMetadata } from './parseIpfs'; + +/** + * Slim caching layer on top of ipfs fetcher to speed up fetching of ipfs data + */ +export async function getCachedIpfs(hash: string) { + const cache = readJSONCache('ipfs', hash); + if (cache) return cache; + const content = await getProposalMetadata(hash); + writeJSONCache('ipfs', hash, content); + return content; +} diff --git a/src/utils/cache.ts b/src/utils/cache.ts new file mode 100644 index 0000000..5a33cc0 --- /dev/null +++ b/src/utils/cache.ts @@ -0,0 +1,28 @@ +/** + * simple opinionated cache helper that reads and writes to json files + * - cache is stored in cache folder + * - files are suffixed with json + */ +import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs'; +import path from 'path'; + +const DEFAULT_PATH = path.join(process.cwd(), 'cache'); + +export function readJSONCache(filePath: string, filename: string | number): T | undefined { + const joinedPath = path.join(DEFAULT_PATH, filePath, `${filename}.json`); + if (existsSync(joinedPath)) { + return JSON.parse(readFileSync(joinedPath, 'utf8')); + } +} + +export function writeJSONCache(filePath: string, filename: string | number, json: T) { + const joinedFolderPath = path.join(DEFAULT_PATH, filePath); + if (!existsSync(joinedFolderPath)) { + mkdirSync(joinedFolderPath, { recursive: true }); + } + const joinedFilePath = path.join(joinedFolderPath, `${filename}.json`); + writeFileSync( + joinedFilePath, + JSON.stringify(json, (key, value) => (typeof value === 'bigint' ? value.toString() : value), 2) + ); +} diff --git a/src/utils/logger.ts b/src/utils/logger.ts index bd7d8f4..4354d52 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,6 +1,6 @@ import chalk from 'chalk'; -export function logInfo(topic: string, text: string) { +export function logInfo(topic: string, text: string | number | bigint) { console.log(chalk.blue(`Info[${topic}]: ${text}`)); } diff --git a/src/utils/logs.ts b/src/utils/logs.ts index cce7d3c..c475d6a 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -1,8 +1,8 @@ import { GetFilterLogsParameters, GetFilterLogsReturnType, PublicClient } from 'viem'; import type { Abi } from 'abitype'; -import fs from 'fs'; import path from 'path'; import { logInfo } from './logger'; +import { readJSONCache, writeJSONCache } from './cache'; type ArrayElement = ArrayType extends readonly (infer ElementType)[] ? ElementType @@ -23,18 +23,12 @@ export async function getLogs( filterFn: (from: bigint, to?: bigint) => Promise['filter']>, fromBlock?: bigint ): Promise>> { - // create cache folder if doesn't exist yet - const cachePath = path.join(process.cwd(), 'cache', client.chain!.id.toString()); const currentBlock = await client.getBlockNumber(); const filter = await filterFn(fromBlock || 0n); - const filePath = path.join(cachePath, filter.eventName + '.json'); - if (!fs.existsSync(cachePath)) { - fs.mkdirSync(cachePath, { recursive: true }); - } + const filePath = client.chain!.id.toString(); + const fileName = filter.eventName!; // read stale cache if it exists - const cache: Array> = fs.existsSync(filePath) - ? JSON.parse(fs.readFileSync(filePath, 'utf8')) - : []; + const cache: Array> = readJSONCache(filePath, fileName) || []; const logs = await getPastLogsRecursive( client, cache.length > 0 ? BigInt(cache[cache.length - 1].blockNumber as bigint) + 1n : filter.fromBlock || fromBlock || 0n, @@ -61,10 +55,7 @@ export async function getLogs( client.chain?.name!, `Store ${newLogs.length} logs for event: ${filter.eventName} on chainId: ${client.chain!.id}` ); - fs.writeFileSync( - filePath, - JSON.stringify(combinedCache, (key, value) => (typeof value === 'bigint' ? value.toString() : value), 2) - ); + writeJSONCache(filePath, fileName, combinedCache); return combinedCache; } return cache; diff --git a/yarn.lock b/yarn.lock index 5d086dc..f1267dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -405,6 +405,125 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d" integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ== +"@inquirer/checkbox@^1.3.11": + version "1.3.11" + resolved "https://registry.yarnpkg.com/@inquirer/checkbox/-/checkbox-1.3.11.tgz#3926d8def3142e54bcc621f7f61eace439bf2966" + integrity sha512-SaQBDr7niZQzoP5Mqzak5pQY7476mvf4Sj2V8VFrbFHWHsavy3nKGKEOgijNHy151bEgqDog1829g/pKa9Qcrw== + dependencies: + "@inquirer/core" "^5.0.0" + "@inquirer/type" "^1.1.4" + ansi-escapes "^4.3.2" + chalk "^4.1.2" + figures "^3.2.0" + +"@inquirer/confirm@^2.0.12": + version "2.0.12" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-2.0.12.tgz#d9fe9d5ce82907f956bd1c7d297ef11fc7a94c3f" + integrity sha512-Oxz3L0ti+0nWYHPPUIrPkxA2KnQZUGBHnk56yF5RjKqPGFrwvgLZdIXNe/w4I/OtdLeOBqHCrJ+kCvNvHVdk9g== + dependencies: + "@inquirer/core" "^5.0.0" + "@inquirer/type" "^1.1.4" + chalk "^4.1.2" + +"@inquirer/core@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-5.0.0.tgz#0b4b4eb9c076aca7b2cf7d040fbae0eaf98321b5" + integrity sha512-q2o4BcANKFyuUI5V6ejmPs1f9SdbJxfnLmhQVb72Fj7hOudoKsJpByJZ0imv9a/rpKDogA+93vtBBMqsnS7/Fg== + dependencies: + "@inquirer/type" "^1.1.4" + "@types/mute-stream" "^0.0.1" + "@types/node" "^20.6.0" + "@types/wrap-ansi" "^3.0.0" + ansi-escapes "^4.3.2" + chalk "^4.1.2" + cli-spinners "^2.9.0" + cli-width "^4.1.0" + figures "^3.2.0" + mute-stream "^1.0.0" + run-async "^3.0.0" + signal-exit "^4.1.0" + strip-ansi "^6.0.1" + wrap-ansi "^6.2.0" + +"@inquirer/editor@^1.2.10": + version "1.2.10" + resolved "https://registry.yarnpkg.com/@inquirer/editor/-/editor-1.2.10.tgz#7792e241b4f2b0dbc373b8983a89fb2c8f4df7a5" + integrity sha512-aluYpazbxIdM54L+xNmVHzOjoXGwkliTCvHxhtPg6itmqDGMVmU1z+T2akHt6Xnx9RyrTpbumFB4xn1iI0UfnA== + dependencies: + "@inquirer/core" "^5.0.0" + "@inquirer/type" "^1.1.4" + chalk "^4.1.2" + external-editor "^3.1.0" + +"@inquirer/expand@^1.1.11": + version "1.1.11" + resolved "https://registry.yarnpkg.com/@inquirer/expand/-/expand-1.1.11.tgz#7ae46bb3f7e4d8611af341485e28efed871bcd90" + integrity sha512-GSZJbYKPBniyXgWeFLsqiv7TSK9QjpQqCr+i/85Yts3wwixXTrAeoqM3TVVgHO/3j+xeFcuhOm1wy/F2QY5aEg== + dependencies: + "@inquirer/core" "^5.0.0" + "@inquirer/type" "^1.1.4" + chalk "^4.1.2" + figures "^3.2.0" + +"@inquirer/input@^1.2.11": + version "1.2.11" + resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-1.2.11.tgz#7d2f1f58f69eb7dc33078b35c5ec463344b32a21" + integrity sha512-sV1nO6+RxMFTHAznmxMkbMkjGQ8NGMWr0mvXjU35YQ0OFEL+YlD+DPbNd9s3ltnswODZAcnM1yFvdko3S/Kj/w== + dependencies: + "@inquirer/core" "^5.0.0" + "@inquirer/type" "^1.1.4" + chalk "^4.1.2" + +"@inquirer/password@^1.1.11": + version "1.1.11" + resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-1.1.11.tgz#086ab3c9018a34b644922bffb5f84928afa1d41c" + integrity sha512-r2eiLMlTuY+k+yJf6XLbnAEz7EDyWdjOrgVAWjSKoEDBc3T9/rq2I+7WiY9FUFArYY/1LxmsNWavs5NuMICx8Q== + dependencies: + "@inquirer/input" "^1.2.11" + "@inquirer/type" "^1.1.4" + ansi-escapes "^4.3.2" + chalk "^4.1.2" + +"@inquirer/prompts@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@inquirer/prompts/-/prompts-3.1.1.tgz#44cf520bd0bfa00a0292b3c54096fd396575e8f9" + integrity sha512-7m/7Q4eupJYmn0GxM1H1dcekE4F4YlIB6bSKZs2SVeShARYUVPiAKFZ9c15UzYnBtdjCv4zXI17jbNtCNqmxGQ== + dependencies: + "@inquirer/checkbox" "^1.3.11" + "@inquirer/confirm" "^2.0.12" + "@inquirer/core" "^5.0.0" + "@inquirer/editor" "^1.2.10" + "@inquirer/expand" "^1.1.11" + "@inquirer/input" "^1.2.11" + "@inquirer/password" "^1.1.11" + "@inquirer/rawlist" "^1.2.11" + "@inquirer/select" "^1.2.11" + +"@inquirer/rawlist@^1.2.11": + version "1.2.11" + resolved "https://registry.yarnpkg.com/@inquirer/rawlist/-/rawlist-1.2.11.tgz#3a75a7ab231f61be7af7d48872e995d5c65d2dba" + integrity sha512-4S2t2pCCR3VgyB3lbPKoiJ9020HHAi9g4M+DIyXHYwGE++7wURAwKkzb6v78fS0yKfCbyFt3BTcL2UffQRQ9Fg== + dependencies: + "@inquirer/core" "^5.0.0" + "@inquirer/type" "^1.1.4" + chalk "^4.1.2" + +"@inquirer/select@^1.2.11": + version "1.2.11" + resolved "https://registry.yarnpkg.com/@inquirer/select/-/select-1.2.11.tgz#4a99edadd23f398bf51838b89383d3d0cfd80a05" + integrity sha512-LH2wzAsWfu/+wcapeht07zTDefuvGTpv0+9dCAQ68QigF+4gHzpWq5+AbBLbxzuH2Wz4WlHcti85nFUPPM1t3A== + dependencies: + "@inquirer/core" "^5.0.0" + "@inquirer/type" "^1.1.4" + ansi-escapes "^4.3.2" + chalk "^4.1.2" + figures "^3.2.0" + +"@inquirer/type@^1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-1.1.4.tgz#8ef3d3d638a59253fbbe4b0297035cddc227eaed" + integrity sha512-a6+RCiXBQEbiA73RT1pBfwiH2I+MPcoZoGKuuUYFkws+6ud7nb5kUQGHFGUSBim25IyVMT/mqbWIrkxetcIb/w== + "@jest/schemas@^29.6.0": version "29.6.0" resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz" @@ -572,6 +691,13 @@ resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== +"@types/mute-stream@^0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.1.tgz#8ec7d16d51e2ceb054d8be0226250169d17af5b2" + integrity sha512-0yQLzYhCqGz7CQPE3iDmYjhb7KMBFOP+tBkyw+/Y2YyDI5wpS7itXXxneN1zSsUwWx3Ji6YiVYrhAnpQGS/vkw== + dependencies: + "@types/node" "*" + "@types/node-fetch@^2.6.4": version "2.6.4" resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz" @@ -590,6 +716,11 @@ resolved "https://registry.npmjs.org/@types/node/-/node-20.1.5.tgz" integrity sha512-IvGD1CD/nego63ySR7vrAKEX3AJTcmrAN2kn+/sDNLi1Ff5kBzDeEdqWDplK+0HAEoLYej137Sk0cUU8OLOlMg== +"@types/node@^20.6.0": + version "20.6.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.1.tgz#8b589bba9b2af0128796461a0979764562687e6f" + integrity sha512-4LcJvuXQlv4lTHnxwyHQZ3uR9Zw2j7m1C9DfuwoTFQQP4Pmu04O6IfLYgMmHoOCt0nosItLLZAH+sOrRE0Bo8g== + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz" @@ -600,6 +731,11 @@ resolved "https://registry.npmjs.org/@types/object-hash/-/object-hash-3.0.3.tgz" integrity sha512-Mb0SDIhjhBAz4/rDNU0cYcQR4lSJIwy+kFlm0whXLkx+o0pXwEszwyrWD6gXWumxVbAS6XZ9gXK82LR+Uk+cKQ== +"@types/wrap-ansi@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" + integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g== + "@types/ws@^8.5.5": version "8.5.5" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" @@ -682,6 +818,18 @@ acorn@^8.9.0: resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== +ansi-escapes@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" @@ -689,7 +837,7 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.1.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -871,6 +1019,11 @@ chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + check-error@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" @@ -901,6 +1054,16 @@ cids@^1.0.0, cids@^1.1.5, cids@^1.1.6: multihashes "^4.0.1" uint8arrays "^3.0.0" +cli-spinners@^2.9.0: + version "2.9.1" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.1.tgz#9c0b9dad69a6d47cbb4333c14319b060ed395a35" + integrity sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ== + +cli-width@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-4.1.0.tgz#42daac41d3c254ef38ad8ac037672130173691c5" + integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ== + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" @@ -1005,6 +1168,11 @@ dotenv@^16.3.1: resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz" integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + err-code@^3.0.0, err-code@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz" @@ -1133,6 +1301,15 @@ extend-shallow@^2.0.1: dependencies: is-extendable "^0.1.0" +external-editor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + fast-glob@^3.2.9: version "3.2.12" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz" @@ -1151,6 +1328,13 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +figures@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" + integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== + dependencies: + escape-string-regexp "^1.0.5" + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" @@ -1295,6 +1479,13 @@ human-signals@^2.1.0: resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + ieee754@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" @@ -1417,6 +1608,11 @@ is-extglob@^2.1.1: resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" @@ -1746,6 +1942,11 @@ murmurhash3js-revisited@^3.0.0: resolved "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz" integrity sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g== +mute-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e" + integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA== + mz@^2.7.0: version "2.7.0" resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz" @@ -1830,6 +2031,11 @@ onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + p-limit@^2.2.0: version "2.3.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" @@ -2090,6 +2296,11 @@ rollup@^3.18.0, rollup@^3.2.5: optionalDependencies: fsevents "~2.3.2" +run-async@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-3.0.0.tgz#42a432f6d76c689522058984384df28be379daad" + integrity sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q== + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" @@ -2102,6 +2313,11 @@ safe-buffer@~5.2.0: resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + section-matter@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz" @@ -2144,6 +2360,11 @@ signal-exit@^3.0.3: resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + slash@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" @@ -2225,6 +2446,15 @@ std-env@^3.3.3: resolved "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz" integrity sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg== +string-width@^4.1.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" @@ -2232,6 +2462,13 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-bom-string@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz" @@ -2316,6 +2553,13 @@ tinyspy@^2.1.1: resolved "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz" integrity sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w== +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" @@ -2391,6 +2635,11 @@ type-fest@^0.18.0: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz" integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + type-fest@^0.6.0: version "0.6.0" resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" @@ -2559,6 +2808,15 @@ why-is-node-running@^2.2.2: siginfo "^2.0.0" stackback "0.0.2" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" From bb6752280f9a753fc625771b1457865ca75e90b7 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Sat, 16 Sep 2023 16:23:06 +0200 Subject: [PATCH 59/94] feat: add encoded data --- src/commands/governance.ts | 66 ++++++-------------------------- src/govv3/checks/selfDestruct.ts | 2 +- src/govv3/utils/markdownUtils.ts | 6 ++- 3 files changed, 17 insertions(+), 57 deletions(-) diff --git a/src/commands/governance.ts b/src/commands/governance.ts index c206714..abf3928 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -5,7 +5,7 @@ import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/gov import { CHAIN_ID_CLIENT_MAP, goerliClient } from '../utils/rpcClients'; import { logError, logInfo, logSuccess } from '../utils/logger'; import { Hex, PublicClient, createWalletClient, encodeFunctionData, getContract, http } from 'viem'; -import { input, select } from '@inquirer/prompts'; +import { confirm, input, select } from '@inquirer/prompts'; import { getCachedIpfs } from '../ipfs/getCachedProposalMetaData'; import { toAddressLink, toTxLink } from '../govv3/utils/markdownUtils'; @@ -109,10 +109,6 @@ export function addCommand(program: Command) { logInfo('QueuedLog', toTxLink(proposalLogs.queuedLog.transactionHash, false, DEFAULT_CLIENT)); if (proposalLogs.executedLog) logInfo('ExecutedLog', toTxLink(proposalLogs.executedLog.transactionHash, false, DEFAULT_CLIENT)); - if (proposalLogs.payloadSentLog) - proposalLogs.payloadSentLog.map((psLog) => - logInfo('ExecutedLog', toTxLink(psLog.transactionHash, false, DEFAULT_CLIENT)) - ); } if (moreInfo == DialogOptions.DETAILS) { @@ -136,6 +132,7 @@ export function addCommand(program: Command) { const address = (await input({ message: 'Enter the address you would like to vote with', })) as Hex; + const support = await confirm({ message: 'Are you in Support of the proposal?' }); const portal = getContract({ address: proposal.votingPortal, abi: IVotingPortal_ABI, @@ -158,11 +155,20 @@ export function addCommand(program: Command) { ); logInfo('Method', 'submitVote'); logInfo('parameter proposalId', selectedProposalId); - logInfo('parameter support', 'true if in support, false if against'); + logInfo('parameter support', String(support)); logInfo( 'parameter votingBalanceProofs', JSON.stringify(proofs.map((p) => [p.underlyingAsset, p.slot.toString(), p.proof])) ); + + logInfo( + 'encoded calldata', + encodeFunctionData({ + abi: IVotingMachineWithProofs_ABI, + functionName: 'submitVote', + args: [BigInt(selectedProposalId), support, proofs], + }) + ); } } } @@ -212,52 +218,4 @@ export function addCommand(program: Command) { const proofs = await governance.getVotingProofs(proposalId, voter as Hex, chainId); console.log(proofs); // TODO: format so foundry can consume it }); - - govV3 - .command('vote') - .description('vote for or against any given proposal') - .requiredOption('--proposalId ', 'proposalId to vote for') - .requiredOption('--voter ', 'the address to vote') - .option('--voteFor', 'Vote in favour of the proposal') - .option('--voteAgainst', 'vote against the proposal') - .action(async ({ voter, proposalId: _proposalId, voteAgainst, voteFor }) => { - const governance = getGovernance({ - address: DEFAULT_GOVERNANCE, - publicClient: DEFAULT_CLIENT, - walletClient: createWalletClient({ account: '0x0', chain: DEFAULT_CLIENT.chain, transport: http() }), - }); - - const proposalId = BigInt(_proposalId); - - const proposal = await governance.governanceContract.read.getProposal([proposalId]); - - if ((voteFor && voteAgainst) || (!voteFor && !voteAgainst)) { - throw new Error('you must either vote --for, or --against'); - } - const portal = getContract({ - address: proposal.votingPortal, - abi: IVotingPortal_ABI, - publicClient: DEFAULT_CLIENT, - }); - const [machine, chainId] = await Promise.all([ - portal.read.VOTING_MACHINE(), - portal.read.VOTING_MACHINE_CHAIN_ID(), - ]); - const votingMachine = getContract({ - address: machine, - abi: IVotingMachineWithProofs_ABI, - publicClient: CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient, - }); - const proofs = await governance.getVotingProofs(proposalId, voter as Hex, chainId); - const encodedData = encodeFunctionData({ - abi: IVotingMachineWithProofs_ABI, - functionName: 'submitVote', - args: [proposalId, !!voteFor, proofs], - }); - logInfo('Voting', `Encoded data to be submitted on ${chainId}:${machine}`); - logSuccess('Encoded data', encodedData); - if (proposal.state !== ProposalState.Active) { - logError('ImpossibleToVote', 'You can only vote on active proposals'); - } - }); } diff --git a/src/govv3/checks/selfDestruct.ts b/src/govv3/checks/selfDestruct.ts index 20ab056..896d26b 100644 --- a/src/govv3/checks/selfDestruct.ts +++ b/src/govv3/checks/selfDestruct.ts @@ -42,7 +42,7 @@ async function checkNoSelfdestructs( const error: string[] = []; for (const addr of addresses) { const status = await checkNoSelfdestruct(trustedAddrs, addr, provider); - const address = toAddressLink(addr, false, provider); + const address = toAddressLink(addr, true, provider); if (status === 'eoa') info.push(`- ${address}: EOA`); else if (status === 'empty') warn.push(`- ${address}: EOA (may have code later)`); else if (status === 'safe') info.push(`- ${address}: Contract (looks safe)`); diff --git a/src/govv3/utils/markdownUtils.ts b/src/govv3/utils/markdownUtils.ts index d21cc73..9eec6d2 100644 --- a/src/govv3/utils/markdownUtils.ts +++ b/src/govv3/utils/markdownUtils.ts @@ -11,8 +11,10 @@ export function boolToMarkdown(value: boolean) { * @param address to be linked * @param code whether to link to the code tab */ -export function toAddressLink(address: Hex, code: boolean = false, client: PublicClient): string { - return `[${address}](${client.chain?.blockExplorers?.default.url}/address/${address}${code ? '#code' : ''})`; +export function toAddressLink(address: Hex, md: boolean, client: PublicClient): string { + const link = `${client.chain?.blockExplorers?.default.url}/address/${address}`; + if (md) return `[${address}](${link})`; + return link; } /** From 566b2a3c06eaf75d7e99a5b400962c5e40c69e44 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Sat, 16 Sep 2023 20:56:40 +0200 Subject: [PATCH 60/94] storageRoots: add initial storageRoot support --- src/govv3/governance.ts | 25 +++++++++++++++++++++---- src/govv3/proofs.ts | 6 +++++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index 9013e64..877b24f 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -19,9 +19,11 @@ import { getSolidityStorageSlotUint, } from '../utils/storageSlots'; import { setBits } from './utils/solidityUtils'; -import { VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from './proofs'; +import { VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getBLockRLP, getProof } from './proofs'; import { readJSONCache, writeJSONCache } from '../utils/cache'; -import path from 'path'; + +// TODO remove once final +const AaveSafetyModule = { STK_AAVE: '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' } as const; type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; @@ -78,6 +80,7 @@ export interface Governance { proposalId: bigint, params: { executedLog?: ExecutedLog } ) => Promise; + getStorageRoots(proposalId: bigint): Promise; /** * Returns the proofs that are non-zero for a specified address * @param proposalId @@ -282,14 +285,28 @@ export const getGovernance = ({ const payload = await getSimulationPayloadForExecution(proposalId); return tenderly.simulate(payload); }, + async getStorageRoots(proposalId: bigint) { + const proposal = await getProposal(proposalId); + const block = await publicClient.getBlock({ blockHash: proposal.snapshotBlockHash }); + const blockHeaderRPL = getBLockRLP(block); + const [] = await Promise.all([ + getProof( + publicClient, + AaveSafetyModule.STK_AAVE, + WAREHOUSE_SLOTS[AaveSafetyModule.STK_AAVE].map((v) => toHex(v)), + proposal.snapshotBlockHash + ), + ]); + }, async getVotingProofs(proposalId: bigint, voter: Hex, votingChainId: bigint) { const proposal = await getProposal(proposalId); + // TODO: replace with real addresses const [stkAaveProof, aaveProof, aAaveProof, representativeProof] = await Promise.all([ getProof( publicClient, - '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec', - [getSolidityStorageSlotAddress(VOTING_SLOTS['0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec'].balance, voter)], + AaveSafetyModule.STK_AAVE, + [getSolidityStorageSlotAddress(VOTING_SLOTS[AaveSafetyModule.STK_AAVE].balance, voter)], proposal.snapshotBlockHash ), getProof( diff --git a/src/govv3/proofs.ts b/src/govv3/proofs.ts index e009b32..ff914bd 100644 --- a/src/govv3/proofs.ts +++ b/src/govv3/proofs.ts @@ -1,11 +1,15 @@ -import { AaveSafetyModule, AaveV3Ethereum, GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; +import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; import { Block, Hex, PublicClient, fromRlp, toHex, toRlp } from 'viem'; +// TODO remove once final +const AaveSafetyModule = { STK_AAVE: '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' } as const; + /** * Slots that represent configuration values relevant for all accounts */ export const WAREHOUSE_SLOTS = { [AaveSafetyModule.STK_AAVE]: [ + 0n, // balance 81n, // exchangeRate ], } as const; From d87fe578804eab198f143f48f0903715029d70fe Mon Sep 17 00:00:00 2001 From: sakulstra Date: Mon, 18 Sep 2023 15:08:27 +0200 Subject: [PATCH 61/94] feat: stash current progress --- package.json | 1 + src/cli.ts | 22 ++++- .../{diff-snaphots.ts => diffSnaphots.ts} | 0 src/commands/governance.ts | 90 +++++++++++++++---- .../{ipfs-upload.ts => ipfsUpload.ts} | 0 src/govv3/checks/logs.ts | 3 +- src/govv3/checks/state.ts | 2 + ...targets-verified.ts => targetsVerified.ts} | 2 + src/govv3/checks/types.ts | 1 - src/govv3/generatePayloadReport.ts | 2 +- src/govv3/generateProposalReport.ts | 2 +- src/govv3/governance.ts | 36 ++++---- src/govv3/proofs.ts | 9 +- types.d.ts | 3 + yarn.lock | 5 ++ 15 files changed, 126 insertions(+), 52 deletions(-) rename src/commands/{diff-snaphots.ts => diffSnaphots.ts} (100%) rename src/commands/{ipfs-upload.ts => ipfsUpload.ts} (100%) rename src/govv3/checks/{targets-verified.ts => targetsVerified.ts} (95%) diff --git a/package.json b/package.json index a5e3fe5..f15c786 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "bs58": "^5.0.0", "chalk": "^4.1.2", "commander": "^11.0.0", + "deepmerge": "^4.3.1", "dotenv": "^16.3.1", "gray-matter": "^4.0.3", "ipfs-only-hash": "^4.0.0", diff --git a/src/cli.ts b/src/cli.ts index e05bd63..d9fb048 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,14 +1,28 @@ #!/usr/bin/env node import 'dotenv/config'; -import { Command } from '@commander-js/extra-typings'; -import { addCommand as addIpfsCommand } from './commands/ipfs-upload'; -import { addCommand as addDiffSnapshots } from './commands/diff-snaphots'; +import { Command, Option } from '@commander-js/extra-typings'; +import { addCommand as addIpfsCommand } from './commands/ipfsUpload'; +import { addCommand as addDiffSnapshots } from './commands/diffSnaphots'; import { addCommand as addGovernance } from './commands/governance'; import { addCommand as addFork } from './commands/fork'; const program = new Command(); -program.name('aave-cli').description('CLI to interact with the aave ecosystem').version('0.0.0').showHelpAfterError(); +program + .name('aave-cli') + .description('CLI to interact with the aave ecosystem') + .option('-v, --verbose', 'Showing logs for all the taken steps') + .on('option:verbose', function () { + process.env.VERBOSE = 'true'; + }) + .addOption( + new Option('--output ', 'Set preferred output format').default('raw').choices(['raw', 'encoded'] as const) + ) + .on('option:output', function (format) { + process.env.FORMAT = format; + }) + .version('0.0.0') + .showHelpAfterError(); addGovernance(program); addDiffSnapshots(program); addFork(program); diff --git a/src/commands/diff-snaphots.ts b/src/commands/diffSnaphots.ts similarity index 100% rename from src/commands/diff-snaphots.ts rename to src/commands/diffSnaphots.ts diff --git a/src/commands/governance.ts b/src/commands/governance.ts index abf3928..f7544bb 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -1,6 +1,11 @@ import { Command } from '@commander-js/extra-typings'; import { simulateProposal } from '../govv3/simulate'; -import { GovernanceV3Goerli, IVotingMachineWithProofs_ABI, IVotingPortal_ABI } from '@bgd-labs/aave-address-book'; +import { + GovernanceV3Goerli, + IDataWarehouse_ABI, + IVotingMachineWithProofs_ABI, + IVotingPortal_ABI, +} from '@bgd-labs/aave-address-book'; import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/governance'; import { CHAIN_ID_CLIENT_MAP, goerliClient } from '../utils/rpcClients'; import { logError, logInfo, logSuccess } from '../utils/logger'; @@ -8,12 +13,14 @@ import { Hex, PublicClient, createWalletClient, encodeFunctionData, getContract, import { confirm, input, select } from '@inquirer/prompts'; import { getCachedIpfs } from '../ipfs/getCachedProposalMetaData'; import { toAddressLink, toTxLink } from '../govv3/utils/markdownUtils'; +import { getAccountRPL, getBLockRLP } from '../govv3/proofs'; enum DialogOptions { DETAILS, IPFS_TEXT, TRANSACTIONS, HOW_TO_VOTE, + HOW_TO_REGISTER_STORAGE_ROOTS, EXIT, } @@ -35,7 +42,7 @@ export function addCommand(program: Command) { govV3 .command('view') .description('shows all the proposals & state') - .action(async () => { + .action(async (opts) => { const governance = getGovernance({ address: DEFAULT_GOVERNANCE, publicClient: DEFAULT_CLIENT, @@ -44,20 +51,22 @@ export function addCommand(program: Command) { const logs = await governance.cacheLogs(); const count = await governance.governanceContract.read.getProposalsCount(); const proposalIds = [...Array(Number(count)).keys()].reverse(); - const selectedProposalId = await select({ - message: 'Select a proposal to get more information', - choices: await Promise.all( - proposalIds.map(async (id) => { - const proposal = await governance.getProposal(BigInt(id)); - const ipfs = await getCachedIpfs(proposal.ipfsHash); - const title = `${id} - ${HUMAN_READABLE_STATE[proposal.state as keyof typeof HUMAN_READABLE_STATE]} | ${ - ipfs.title - }`; - return { name: title, value: id }; - }) - ), - }); - const { proposal, ...proposalLogs } = await governance.getProposalAndLogs(BigInt(selectedProposalId), logs); + const selectedProposalId = BigInt( + await select({ + message: 'Select a proposal to get more information', + choices: await Promise.all( + proposalIds.map(async (id) => { + const proposal = await governance.getProposal(BigInt(id)); + const ipfs = await getCachedIpfs(proposal.ipfsHash); + const title = `${id} - ${HUMAN_READABLE_STATE[proposal.state as keyof typeof HUMAN_READABLE_STATE]} | ${ + ipfs.title + }`; + return { name: title, value: id }; + }) + ), + }) + ); + const { proposal, ...proposalLogs } = await governance.getProposalAndLogs(selectedProposalId, logs); let exitLvl2 = false; while (!exitLvl2) { const moreInfo = await select({ @@ -79,6 +88,10 @@ export function addCommand(program: Command) { name: 'Show me How to vote', value: DialogOptions.HOW_TO_VOTE, }, + { + name: 'Show me How to register storage roots', + value: DialogOptions.HOW_TO_REGISTER_STORAGE_ROOTS, + }, { name: 'Exit', value: DialogOptions.EXIT, @@ -142,11 +155,11 @@ export function addCommand(program: Command) { portal.read.VOTING_MACHINE(), portal.read.VOTING_MACHINE_CHAIN_ID(), ]); - const proofs = await governance.getVotingProofs(BigInt(selectedProposalId), address, chainId); + const proofs = await governance.getVotingProofs(selectedProposalId, address, chainId); if (proofs.length == 0) logError('Voting Error', 'You need voting power to vote'); else { logInfo( - 'Explorer', + 'Explorer link', toAddressLink( machine, false, @@ -171,6 +184,47 @@ export function addCommand(program: Command) { ); } } + + if (moreInfo == DialogOptions.HOW_TO_REGISTER_STORAGE_ROOTS) { + const portalContract = getContract({ + address: proposal.votingPortal, + abi: IVotingPortal_ABI, + publicClient: DEFAULT_CLIENT, + }); + const [machine, chainId] = await Promise.all([ + portalContract.read.VOTING_MACHINE(), + portalContract.read.VOTING_MACHINE_CHAIN_ID(), + ]); + const machineContract = getContract({ + address: machine, + abi: IVotingMachineWithProofs_ABI, + publicClient: CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient, + }); + const dataWarehouse = await machineContract.read.DATA_WAREHOUSE(); + const dataWarehouseContracts = getContract({ + address: dataWarehouse, + abi: IDataWarehouse_ABI, + publicClient: CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient, + }); + const roots = await governance.getStorageRoots(selectedProposalId); + logInfo( + 'Explorer link', + toAddressLink( + dataWarehouse, + false, + CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient + ) + ); + const block = await DEFAULT_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash }); + const blockRPL = getBLockRLP(block); + logInfo('Method', 'processStorageRoot'); + roots.map((root, ix) => { + logInfo(`account.${ix}`, root.address); + logInfo(`blockHash.${ix}`, proposal.snapshotBlockHash); + logInfo(`blockHeaderRPL.${ix}`, blockRPL); + logInfo(`accountStateProofRPL.${ix}`, getAccountRPL(root.accountProof)); + }); + } } }); diff --git a/src/commands/ipfs-upload.ts b/src/commands/ipfsUpload.ts similarity index 100% rename from src/commands/ipfs-upload.ts rename to src/commands/ipfsUpload.ts diff --git a/src/govv3/checks/logs.ts b/src/govv3/checks/logs.ts index 51012a4..28562c1 100644 --- a/src/govv3/checks/logs.ts +++ b/src/govv3/checks/logs.ts @@ -1,8 +1,9 @@ +// Based on https://github.com/Uniswap/governance-seatbelt/blob/main/checks/check-logs.ts +// adjusted for viem & aave governance v3 import { getAddress } from 'viem'; import { ProposalCheck } from './types'; import { Log } from '../../utils/tenderlyClient'; import { getContractName } from '../utils/solidityUtils'; -import { PayloadsController } from '../payloadsController'; /** * Reports all emitted events from the proposal diff --git a/src/govv3/checks/state.ts b/src/govv3/checks/state.ts index 91d9e8b..bb1acdc 100644 --- a/src/govv3/checks/state.ts +++ b/src/govv3/checks/state.ts @@ -1,3 +1,5 @@ +// Based on https://github.com/Uniswap/governance-seatbelt/blob/main/checks/check-state-changes.ts +// adjusted for viem & aave governance v3 import { Hex, getAddress } from 'viem'; import { ProposalCheck } from './types'; import { getContractName } from '../utils/solidityUtils'; diff --git a/src/govv3/checks/targets-verified.ts b/src/govv3/checks/targetsVerified.ts similarity index 95% rename from src/govv3/checks/targets-verified.ts rename to src/govv3/checks/targetsVerified.ts index 802ab6c..4e2c460 100644 --- a/src/govv3/checks/targets-verified.ts +++ b/src/govv3/checks/targetsVerified.ts @@ -1,3 +1,5 @@ +// Based on https://github.com/Uniswap/governance-seatbelt/blob/main/checks/check-targets-verified-etherscan.ts +// adjusted for viem & aave governance v3 import { Hex, PublicClient } from 'viem'; import { ProposalCheck } from './types'; import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; diff --git a/src/govv3/checks/types.ts b/src/govv3/checks/types.ts index b1cd777..870d86a 100644 --- a/src/govv3/checks/types.ts +++ b/src/govv3/checks/types.ts @@ -1,5 +1,4 @@ import { PublicClient } from 'viem'; -import { PayloadsController } from '../payloadsController'; import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; export type CheckResult = { diff --git a/src/govv3/generatePayloadReport.ts b/src/govv3/generatePayloadReport.ts index 6d1c1a9..0218a58 100644 --- a/src/govv3/generatePayloadReport.ts +++ b/src/govv3/generatePayloadReport.ts @@ -8,7 +8,7 @@ import { boolToMarkdown, renderCheckResult, toTxLink } from './utils/markdownUti import { checkTargetsNoSelfdestruct, checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; import { CheckResult, ProposalCheck } from './checks/types'; import { checkLogs } from './checks/logs'; -import { checkTargetsVerifiedEtherscan, checkTouchedContractsVerifiedEtherscan } from './checks/targets-verified'; +import { checkTargetsVerifiedEtherscan, checkTouchedContractsVerifiedEtherscan } from './checks/targetsVerified'; import { checkStateChanges } from './checks/state'; type GenerateReportRequest = { diff --git a/src/govv3/generateProposalReport.ts b/src/govv3/generateProposalReport.ts index c754fc1..d12e810 100644 --- a/src/govv3/generateProposalReport.ts +++ b/src/govv3/generateProposalReport.ts @@ -6,7 +6,7 @@ import { getContractName } from './utils/solidityUtils'; import { boolToMarkdown, renderCheckResult, toTxLink } from './utils/markdownUtils'; import { checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; import { checkLogs } from './checks/logs'; -import { checkTouchedContractsVerifiedEtherscan } from './checks/targets-verified'; +import { checkTouchedContractsVerifiedEtherscan } from './checks/targetsVerified'; import { Governance, HUMAN_READABLE_STATE } from './governance'; import { checkStateChanges } from './checks/state'; import { getProposalMetadata } from '../ipfs/parseIpfs'; diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index 877b24f..c0045bd 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -9,6 +9,7 @@ import { getContract, toHex, } from 'viem'; +import merge from 'deepmerge'; import { FilterLogWithTimestamp, getLogs } from '../utils/logs'; import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book'; import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../utils/tenderlyClient'; @@ -19,8 +20,9 @@ import { getSolidityStorageSlotUint, } from '../utils/storageSlots'; import { setBits } from './utils/solidityUtils'; -import { VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getBLockRLP, getProof } from './proofs'; +import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getBLockRLP, getProof } from './proofs'; import { readJSONCache, writeJSONCache } from '../utils/cache'; +import { logInfo } from '../utils/logger'; // TODO remove once final const AaveSafetyModule = { STK_AAVE: '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' } as const; @@ -80,7 +82,7 @@ export interface Governance { proposalId: bigint, params: { executedLog?: ExecutedLog } ) => Promise; - getStorageRoots(proposalId: bigint): Promise; + getStorageRoots(proposalId: bigint): Promise; /** * Returns the proofs that are non-zero for a specified address * @param proposalId @@ -92,7 +94,6 @@ export interface Governance { voter: Hex, votingChainId: bigint ) => Promise<{ proof: Hex; slot: bigint; underlyingAsset: Hex }[]>; - getRoots: (proposalId: bigint) => any; } const SLOTS = { @@ -285,19 +286,6 @@ export const getGovernance = ({ const payload = await getSimulationPayloadForExecution(proposalId); return tenderly.simulate(payload); }, - async getStorageRoots(proposalId: bigint) { - const proposal = await getProposal(proposalId); - const block = await publicClient.getBlock({ blockHash: proposal.snapshotBlockHash }); - const blockHeaderRPL = getBLockRLP(block); - const [] = await Promise.all([ - getProof( - publicClient, - AaveSafetyModule.STK_AAVE, - WAREHOUSE_SLOTS[AaveSafetyModule.STK_AAVE].map((v) => toHex(v)), - proposal.snapshotBlockHash - ), - ]); - }, async getVotingProofs(proposalId: bigint, voter: Hex, votingChainId: bigint) { const proposal = await getProposal(proposalId); @@ -350,7 +338,12 @@ export const getGovernance = ({ return ( slots // filter out zero proofs as they don't add any value - .filter((slot, ix) => proof.storageProof[ix].value !== '0x0') + .filter((slot, ix) => { + const shouldSubmitProof = proof.storageProof[ix].value !== '0x0'; + if (!shouldSubmitProof) + logInfo('Proof', `Skipping slot ${slot} on ${proof.address} as value is zero for voter ${voter}`); + return shouldSubmitProof; + }) .map((slot, ix) => ({ underlyingAsset: proof.address, slot, @@ -360,15 +353,16 @@ export const getGovernance = ({ }) .flat(); }, - async getRoots(proposalId: bigint) { + async getStorageRoots(proposalId: bigint) { const proposal = await getProposal(proposalId); + const addresses = merge(VOTING_SLOTS, WAREHOUSE_SLOTS); const proofs = await Promise.all( - (Object.keys(WAREHOUSE_SLOTS) as (keyof typeof WAREHOUSE_SLOTS)[]).map((key) => + (Object.keys(addresses) as (keyof typeof addresses)[]).map((address) => getProof( publicClient, - key, - WAREHOUSE_SLOTS[key].map((slot) => toHex(slot)), + address, + Object.keys(addresses[address]).map((slotKey) => toHex((addresses[address] as any)[slotKey])), proposal.snapshotBlockHash ) ) diff --git a/src/govv3/proofs.ts b/src/govv3/proofs.ts index ff914bd..ec32dd2 100644 --- a/src/govv3/proofs.ts +++ b/src/govv3/proofs.ts @@ -8,17 +8,16 @@ const AaveSafetyModule = { STK_AAVE: '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec * Slots that represent configuration values relevant for all accounts */ export const WAREHOUSE_SLOTS = { - [AaveSafetyModule.STK_AAVE]: [ - 0n, // balance - 81n, // exchangeRate - ], + [AaveSafetyModule.STK_AAVE]: { + exchangeRate: 81n, // exchangeRate + }, } as const; /** * Slots that represent the balance of a single account */ export const VOTING_SLOTS = { - ['0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' /*AaveSafetyModule.STK_AAVE*/]: { balance: 0n }, // balance + [AaveSafetyModule.STK_AAVE]: { balance: 0n }, // balance ['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd' /*AaveV3Ethereum.ASSETS.AAVE.A_TOKEN*/]: { balance: 52n, // balance delegation: 64n, diff --git a/types.d.ts b/types.d.ts index e0729c1..bd06681 100644 --- a/types.d.ts +++ b/types.d.ts @@ -5,5 +5,8 @@ declare namespace NodeJS { TENDERLY_PROJECT_SLUG: string; RPC_SEPOLIA: string; + + // CLI OPTIONS + VERBOSE: string; } } diff --git a/yarn.lock b/yarn.lock index f1267dd..e3755ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1146,6 +1146,11 @@ deep-eql@^4.1.2: dependencies: type-detect "^4.0.0" +deepmerge@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" From a46cfb8ee8706d1e1a138f016de930836e1fc902 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Mon, 18 Sep 2023 16:41:13 +0200 Subject: [PATCH 62/94] fix: patch some types --- src/cli.ts | 6 +- src/commands/governance.ts | 6 +- src/govv3/generateProposalReport.ts | 2 +- src/govv3/governance.ts | 17 +++--- src/govv3/payloadsController.ts | 12 ++-- src/govv3/simulate.ts | 2 +- src/govv3/utils/solidityUtils.ts | 53 ---------------- src/govv3/utils/stateDiffInterpreter.ts | 2 +- src/utils/constants.ts | 5 ++ src/utils/logger.ts | 3 + src/utils/logs.spec.ts | 16 +++++ src/utils/logs.ts | 45 ++++++++++---- src/utils/rpcClients.ts | 8 ++- .../storageSlots.spec.ts} | 2 +- src/utils/storageSlots.ts | 60 +++++++++++++++++++ types.d.ts | 1 + 16 files changed, 149 insertions(+), 91 deletions(-) create mode 100644 src/utils/logs.spec.ts rename src/{govv3/utils/solidityUtils.spec.ts => utils/storageSlots.spec.ts} (88%) diff --git a/src/cli.ts b/src/cli.ts index d9fb048..6c65e5b 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -16,9 +16,11 @@ program process.env.VERBOSE = 'true'; }) .addOption( - new Option('--output ', 'Set preferred output format').default('raw').choices(['raw', 'encoded'] as const) + new Option('--format ', 'Set preferred output format') + .default('raw') + .choices(['raw', 'encoded', 'foundry'] as const) ) - .on('option:output', function (format) { + .on('option:format', function (format) { process.env.FORMAT = format; }) .version('0.0.0') diff --git a/src/commands/governance.ts b/src/commands/governance.ts index f7544bb..780e877 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -6,10 +6,10 @@ import { IVotingMachineWithProofs_ABI, IVotingPortal_ABI, } from '@bgd-labs/aave-address-book'; -import { HUMAN_READABLE_STATE, ProposalState, getGovernance } from '../govv3/governance'; +import { HUMAN_READABLE_STATE, getGovernance } from '../govv3/governance'; import { CHAIN_ID_CLIENT_MAP, goerliClient } from '../utils/rpcClients'; -import { logError, logInfo, logSuccess } from '../utils/logger'; -import { Hex, PublicClient, createWalletClient, encodeFunctionData, getContract, http } from 'viem'; +import { logError, logInfo } from '../utils/logger'; +import { Hex, PublicClient, encodeFunctionData, getContract } from 'viem'; import { confirm, input, select } from '@inquirer/prompts'; import { getCachedIpfs } from '../ipfs/getCachedProposalMetaData'; import { toAddressLink, toTxLink } from '../govv3/utils/markdownUtils'; diff --git a/src/govv3/generateProposalReport.ts b/src/govv3/generateProposalReport.ts index d12e810..500fe37 100644 --- a/src/govv3/generateProposalReport.ts +++ b/src/govv3/generateProposalReport.ts @@ -13,7 +13,7 @@ import { getProposalMetadata } from '../ipfs/parseIpfs'; type GenerateReportRequest = { proposalId: bigint; - proposalInfo: Awaited>; + proposalInfo: Awaited>; simulation: TenderlySimulationResponse; publicClient: PublicClient; }; diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index c0045bd..55a0a6c 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -19,8 +19,8 @@ import { getSolidityStorageSlotBytes, getSolidityStorageSlotUint, } from '../utils/storageSlots'; -import { setBits } from './utils/solidityUtils'; -import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getBLockRLP, getProof } from './proofs'; +import { setBits } from '../utils/storageSlots'; +import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from './proofs'; import { readJSONCache, writeJSONCache } from '../utils/cache'; import { logInfo } from '../utils/logger'; @@ -121,7 +121,6 @@ interface GetGovernanceParams { export const getGovernance = ({ address, publicClient, - blockCreated, walletClient, }: GetGovernanceParams): Governance => { const governanceContract = getContract({ abi: IGovernanceCore_ABI, address, publicClient, walletClient }); @@ -193,7 +192,7 @@ export const getGovernance = ({ } ); }, - blockCreated + address ); const queuedLogs = await getLogs( publicClient, @@ -206,7 +205,7 @@ export const getGovernance = ({ } ); }, - blockCreated + address ); const executedLogs = await getLogs( publicClient, @@ -219,7 +218,7 @@ export const getGovernance = ({ } ); }, - blockCreated + address ); const payloadSentLogs = await getLogs( publicClient, @@ -232,7 +231,7 @@ export const getGovernance = ({ } ); }, - blockCreated + address ); const votingActivatedLogs = await getLogs( publicClient, @@ -245,7 +244,7 @@ export const getGovernance = ({ } ); }, - blockCreated + address ); const canceledLogs = await getLogs( publicClient, @@ -258,7 +257,7 @@ export const getGovernance = ({ } ); }, - blockCreated + address ); return { createdLogs, queuedLogs, executedLogs, payloadSentLogs, votingActivatedLogs, canceledLogs }; }, diff --git a/src/govv3/payloadsController.ts b/src/govv3/payloadsController.ts index 02280aa..29b5715 100644 --- a/src/govv3/payloadsController.ts +++ b/src/govv3/payloadsController.ts @@ -57,11 +57,7 @@ const SLOTS = { PAYLOADS_MAPPING: 3n, }; -export const getPayloadsController = ( - address: Hex, - publicClient: PublicClient, - blockCreated?: bigint -): PayloadsController => { +export const getPayloadsController = (address: Hex, publicClient: PublicClient): PayloadsController => { const controllerContract = getContract({ abi: IPayloadsControllerCore_ABI, address, publicClient }); const getSimulationPayloadForExecution = async (id: number) => { @@ -111,7 +107,7 @@ export const getPayloadsController = ( } ); }, - blockCreated + address ); const queuedLogs = await getLogs( publicClient, @@ -121,7 +117,7 @@ export const getPayloadsController = ( toBlock: toBlock, }); }, - blockCreated + address ); const executedLogs = await getLogs( publicClient, @@ -131,7 +127,7 @@ export const getPayloadsController = ( toBlock: toBlock, }); }, - blockCreated + address ); return { createdLogs, queuedLogs, executedLogs }; }, diff --git a/src/govv3/simulate.ts b/src/govv3/simulate.ts index 8b03096..d94699a 100644 --- a/src/govv3/simulate.ts +++ b/src/govv3/simulate.ts @@ -16,7 +16,7 @@ export async function simulateProposal(governanceAddress: Hex, publicClient: Pub logInfo('General', `Running simulation for ${proposalId}`); const governance = getGovernance({ address: governanceAddress, publicClient }); const logs = await governance.cacheLogs(); - const proposal = await governance.getProposal(proposalId, logs); + const proposal = await governance.getProposalAndLogs(proposalId, logs); await governance.simulateProposalExecutionOnTenderly(proposalId, proposal); const payloads: { payload: Awaited>; diff --git a/src/govv3/utils/solidityUtils.ts b/src/govv3/utils/solidityUtils.ts index 4fd3683..cfb7801 100644 --- a/src/govv3/utils/solidityUtils.ts +++ b/src/govv3/utils/solidityUtils.ts @@ -1,59 +1,6 @@ import { getAddress } from 'viem'; import { TenderlySimulationResponse } from '../../utils/tenderlyClient'; -/** - * Returns the selected bits of a uint256 - * @param _bigIntValue - * @param startBit - * @param endBit - * @returns - */ -export function getBits(_bigIntValue: bigint | number | string, startBit: bigint, endBit: bigint) { - const bigIntValue = BigInt(_bigIntValue); - if (startBit > endBit) { - throw new Error('Invalid bit range: startBit must be less than or equal to endBit'); - } - - const bitLength = BigInt(bigIntValue.toString(2)).toString().length; - if (endBit >= bitLength) { - endBit = BigInt(bitLength - 1); - } - - const mask = (1n << (endBit - startBit + 1n)) - 1n; - const maskedValue = (bigIntValue >> startBit) & mask; - return maskedValue.toString(); -} - -/** - * Sets the bits in a bigint - * @param _bigIntBase - * @param startBit inclusive - * @param endBit exclusive - * @param value the value to replace - * @returns - */ -export function setBits( - _bigIntBase: bigint | number | string, - startBit: bigint, - endBit: bigint, - _replaceValue: bigint | number -) { - const bigIntBase = BigInt(_bigIntBase); - const bigIntReplaceValue = BigInt(_replaceValue); - - // Calculate the mask for the specified range - let mask = BigInt(0); - for (let i = startBit; i < endBit; i++) { - mask |= BigInt(1) << BigInt(i); - } - // Clear the bits in the original number within the specified range - const clearedNumber = bigIntBase & ~mask; - - // Set the new bits in the specified range - let result = clearedNumber | (bigIntReplaceValue << BigInt(startBit)); - return result; -} - // --- Helper methods --- /** * @notice Given a Tenderly contract object, generates a descriptive human-friendly name for that contract diff --git a/src/govv3/utils/stateDiffInterpreter.ts b/src/govv3/utils/stateDiffInterpreter.ts index 2910695..a52ddef 100644 --- a/src/govv3/utils/stateDiffInterpreter.ts +++ b/src/govv3/utils/stateDiffInterpreter.ts @@ -2,7 +2,7 @@ import { Hex, PublicClient, getContract } from 'viem'; import { tenderlyDeepDiff } from './tenderlyDeepDiff'; import { ERC20_ABI } from '../abis/ERC20'; import * as pools from '@bgd-labs/aave-address-book'; -import { getBits } from './solidityUtils'; +import { getBits } from '../../utils/storageSlots'; export async function interpretStateChange( contractAddress: string, diff --git a/src/utils/constants.ts b/src/utils/constants.ts index ef86fb1..cf25983 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,4 +1,9 @@ // arbitrary from EOA for proposal executions export const EOA = '0xD73a92Be73EfbFcF3854433A5FcbAbF9c1316073' as const; +// determines if verbose logs should be shown export const VERBOSE = process.env.VERBOSE; + +// determines what type of format to output +// foundry will consume everything on stdOut so in foundry mode we essentially don't log +export const FORMAT = process.env.FORMAT as 'raw' | 'encoded' | 'foundry'; diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 4354d52..3a52611 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,6 +1,8 @@ import chalk from 'chalk'; +import { FORMAT, VERBOSE } from './constants'; export function logInfo(topic: string, text: string | number | bigint) { + if (!VERBOSE) return; console.log(chalk.blue(`Info[${topic}]: ${text}`)); } @@ -13,5 +15,6 @@ export function logError(topic: string, text: string) { } export function logSuccess(topic: string, text: string) { + if (FORMAT === 'foundry') console.log(text); console.log(chalk.green(`Success[${topic}]: ${text}`)); } diff --git a/src/utils/logs.spec.ts b/src/utils/logs.spec.ts new file mode 100644 index 0000000..ab270c5 --- /dev/null +++ b/src/utils/logs.spec.ts @@ -0,0 +1,16 @@ +import { describe, it, expect } from 'vitest'; +import { findContractDeploymentBlock } from './logs'; +import { GovernanceV3Ethereum } from '@bgd-labs/aave-address-book'; +import { mainnetClient } from './rpcClients'; + +describe('logs', () => { + it( + 'findContractDeploymentBlock', + async () => { + const address = GovernanceV3Ethereum.GOVERNANCE; + const block = await findContractDeploymentBlock(mainnetClient, 0n, await mainnetClient.getBlockNumber(), address); + expect(block).toBeGreaterThan(18018794n - 200000n); + }, + { timeout: 10000 } + ); +}); diff --git a/src/utils/logs.ts b/src/utils/logs.ts index c475d6a..0c65892 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -1,6 +1,5 @@ -import { GetFilterLogsParameters, GetFilterLogsReturnType, PublicClient } from 'viem'; +import { Block, GetFilterLogsParameters, GetFilterLogsReturnType, Hex, PublicClient } from 'viem'; import type { Abi } from 'abitype'; -import path from 'path'; import { logInfo } from './logger'; import { readJSONCache, writeJSONCache } from './cache'; @@ -21,20 +20,19 @@ export type FilterLogWithTimestamp export async function getLogs( client: PublicClient, filterFn: (from: bigint, to?: bigint) => Promise['filter']>, - fromBlock?: bigint + address: Hex ): Promise>> { const currentBlock = await client.getBlockNumber(); - const filter = await filterFn(fromBlock || 0n); + const filter = await filterFn(0n, 1n); const filePath = client.chain!.id.toString(); const fileName = filter.eventName!; // read stale cache if it exists const cache: Array> = readJSONCache(filePath, fileName) || []; - const logs = await getPastLogsRecursive( - client, - cache.length > 0 ? BigInt(cache[cache.length - 1].blockNumber as bigint) + 1n : filter.fromBlock || fromBlock || 0n, - currentBlock, - filterFn - ); + const startBlock = + cache.length > 0 + ? BigInt(cache[cache.length - 1].blockNumber as bigint) + 1n + : (await findContractDeploymentBlock(client, 0n, currentBlock, address)) || 0n; + const logs = await getPastLogsRecursive(client, startBlock, currentBlock, filterFn); const newLogs = await Promise.all( logs .filter( @@ -87,3 +85,30 @@ export async function getPastLogsRecursive< } return []; } + +/** + * some rpcs are having problems fetching logs from 0, therefore this methods helps finding a block close to contract deployment + * 200k block error is allowed + * @param client + * @param address + */ +export async function findContractDeploymentBlock( + client: PublicClient, + fromBlock: bigint, + toBlock: bigint, + address: Hex +) { + if (fromBlock <= toBlock) { + const midBlock = BigInt(fromBlock + toBlock) >> BigInt(1); + const codeMid = await client.getBytecode({ blockNumber: midBlock, address }); + if (!codeMid) { + if (toBlock - midBlock > 200000n) { + return findContractDeploymentBlock(client, midBlock, toBlock, address); + } else { + return midBlock; + } + } + return findContractDeploymentBlock(client, fromBlock, midBlock, address); + } + throw new Error('Could not find contract deployment block'); +} diff --git a/src/utils/rpcClients.ts b/src/utils/rpcClients.ts index dd1bf6d..db013be 100644 --- a/src/utils/rpcClients.ts +++ b/src/utils/rpcClients.ts @@ -1,6 +1,5 @@ -// import 'dotenv/config'; import { createPublicClient, http, fallback } from 'viem'; -import { mainnet, arbitrum, polygon, optimism, metis, base, sepolia, goerli } from 'viem/chains'; +import { mainnet, arbitrum, polygon, optimism, metis, base, sepolia, goerli, bsc } from 'viem/chains'; export const mainnetClient = createPublicClient({ chain: mainnet, @@ -32,6 +31,11 @@ export const baseClient = createPublicClient({ transport: http(process.env.RPC_BASE), }); +export const bscClient = createPublicClient({ + chain: bsc, + transport: http(process.env.RPC_BSC), +}); + export const sepoliaClient = createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }); export const goerliClient = createPublicClient({ chain: goerli, transport: http(process.env.RPC_GOERLI) }); diff --git a/src/govv3/utils/solidityUtils.spec.ts b/src/utils/storageSlots.spec.ts similarity index 88% rename from src/govv3/utils/solidityUtils.spec.ts rename to src/utils/storageSlots.spec.ts index 8ed929d..84d3f70 100644 --- a/src/govv3/utils/solidityUtils.spec.ts +++ b/src/utils/storageSlots.spec.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { setBits } from './solidityUtils'; +import { setBits } from './storageSlots'; describe('solidityUtils', () => { it('setBits', async () => { diff --git a/src/utils/storageSlots.ts b/src/utils/storageSlots.ts index b96d261..1a00e10 100644 --- a/src/utils/storageSlots.ts +++ b/src/utils/storageSlots.ts @@ -37,6 +37,13 @@ export function getSolidityStorageSlotAddress(mappingSlot: bigint | number, key: return keccak256(encodeAbiParameters(parseAbiParameters('address, uint256'), [key, BigInt(mappingSlot)])); } +/** + * Returns the slot of an array item + * @param baseSlot baseSlot of the array size pointer + * @param arrayIndex index within the array + * @param itemSize number of slots consumed per array item + * @returns + */ export function getDynamicArraySlot(baseSlot: bigint, arrayIndex: number, itemSize: number): Hex { return pad( toHex( @@ -56,3 +63,56 @@ export function getBytesValue(value: string | Hex) { if (bytesString.length > 31) throw new Error('Error: strings > 31 bytes are not implemented'); return concat([toHex(pad(bytesString, { size: 31, dir: 'right' })), toHex(bytesString.length * 2, { size: 1 })]); } + +/** + * Returns the selected bits of a uint256 + * @param _bigIntValue + * @param startBit + * @param endBit + * @returns + */ +export function getBits(_bigIntValue: bigint | number | string, startBit: bigint, endBit: bigint) { + const bigIntValue = BigInt(_bigIntValue); + if (startBit > endBit) { + throw new Error('Invalid bit range: startBit must be less than or equal to endBit'); + } + + const bitLength = BigInt(bigIntValue.toString(2)).toString().length; + if (endBit >= bitLength) { + endBit = BigInt(bitLength - 1); + } + + const mask = (1n << (endBit - startBit + 1n)) - 1n; + const maskedValue = (bigIntValue >> startBit) & mask; + return maskedValue.toString(); +} + +/** + * Sets the bits in a bigint + * @param _bigIntBase + * @param startBit inclusive + * @param endBit exclusive + * @param value the value to replace + * @returns + */ +export function setBits( + _bigIntBase: bigint | number | string, + startBit: bigint, + endBit: bigint, + _replaceValue: bigint | number +) { + const bigIntBase = BigInt(_bigIntBase); + const bigIntReplaceValue = BigInt(_replaceValue); + + // Calculate the mask for the specified range + let mask = BigInt(0); + for (let i = startBit; i < endBit; i++) { + mask |= BigInt(1) << BigInt(i); + } + // Clear the bits in the original number within the specified range + const clearedNumber = bigIntBase & ~mask; + + // Set the new bits in the specified range + let result = clearedNumber | (bigIntReplaceValue << BigInt(startBit)); + return result; +} diff --git a/types.d.ts b/types.d.ts index bd06681..a16de02 100644 --- a/types.d.ts +++ b/types.d.ts @@ -8,5 +8,6 @@ declare namespace NodeJS { // CLI OPTIONS VERBOSE: string; + FORMAT: string; } } From b178485b69eeacefb54affd027cf6667ce8e2d8e Mon Sep 17 00:00:00 2001 From: sakulstra Date: Mon, 18 Sep 2023 17:03:40 +0200 Subject: [PATCH 63/94] refactor: smal refactorings --- src/cli.ts | 4 +- src/commands/governance.ts | 85 +++++++++++++++++++++++--------------- src/utils/constants.ts | 2 +- src/utils/logger.ts | 9 ++-- src/utils/logs.ts | 3 ++ types.d.ts | 1 + 6 files changed, 61 insertions(+), 43 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 6c65e5b..f502a0d 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -16,9 +16,7 @@ program process.env.VERBOSE = 'true'; }) .addOption( - new Option('--format ', 'Set preferred output format') - .default('raw') - .choices(['raw', 'encoded', 'foundry'] as const) + new Option('--format ', 'Set preferred output format').default('raw').choices(['raw', 'encoded'] as const) ) .on('option:format', function (format) { process.env.FORMAT = format; diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 780e877..3982ab4 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -8,12 +8,13 @@ import { } from '@bgd-labs/aave-address-book'; import { HUMAN_READABLE_STATE, getGovernance } from '../govv3/governance'; import { CHAIN_ID_CLIENT_MAP, goerliClient } from '../utils/rpcClients'; -import { logError, logInfo } from '../utils/logger'; +import { logError, logInfo, logSuccess } from '../utils/logger'; import { Hex, PublicClient, encodeFunctionData, getContract } from 'viem'; import { confirm, input, select } from '@inquirer/prompts'; import { getCachedIpfs } from '../ipfs/getCachedProposalMetaData'; import { toAddressLink, toTxLink } from '../govv3/utils/markdownUtils'; import { getAccountRPL, getBLockRLP } from '../govv3/proofs'; +import { FORMAT } from '../utils/constants'; enum DialogOptions { DETAILS, @@ -158,30 +159,32 @@ export function addCommand(program: Command) { const proofs = await governance.getVotingProofs(selectedProposalId, address, chainId); if (proofs.length == 0) logError('Voting Error', 'You need voting power to vote'); else { - logInfo( - 'Explorer link', + logSuccess( + 'VotingMachine', toAddressLink( machine, false, CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient ) ); - logInfo('Method', 'submitVote'); - logInfo('parameter proposalId', selectedProposalId); - logInfo('parameter support', String(support)); - logInfo( - 'parameter votingBalanceProofs', - JSON.stringify(proofs.map((p) => [p.underlyingAsset, p.slot.toString(), p.proof])) - ); - - logInfo( - 'encoded calldata', - encodeFunctionData({ - abi: IVotingMachineWithProofs_ABI, - functionName: 'submitVote', - args: [BigInt(selectedProposalId), support, proofs], - }) - ); + if (FORMAT === 'raw') { + logSuccess('Method', 'submitVote'); + logSuccess('parameter proposalId', selectedProposalId); + logSuccess('parameter support', String(support)); + logSuccess( + 'parameter votingBalanceProofs', + JSON.stringify(proofs.map((p) => [p.underlyingAsset, p.slot.toString(), p.proof])) + ); + } else { + logSuccess( + 'encoded calldata', + encodeFunctionData({ + abi: IVotingMachineWithProofs_ABI, + functionName: 'submitVote', + args: [selectedProposalId, support, proofs], + }) + ); + } } } @@ -201,14 +204,9 @@ export function addCommand(program: Command) { publicClient: CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient, }); const dataWarehouse = await machineContract.read.DATA_WAREHOUSE(); - const dataWarehouseContracts = getContract({ - address: dataWarehouse, - abi: IDataWarehouse_ABI, - publicClient: CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient, - }); const roots = await governance.getStorageRoots(selectedProposalId); - logInfo( - 'Explorer link', + logSuccess( + 'DataWarehouse', toAddressLink( dataWarehouse, false, @@ -217,13 +215,28 @@ export function addCommand(program: Command) { ); const block = await DEFAULT_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash }); const blockRPL = getBLockRLP(block); - logInfo('Method', 'processStorageRoot'); - roots.map((root, ix) => { - logInfo(`account.${ix}`, root.address); - logInfo(`blockHash.${ix}`, proposal.snapshotBlockHash); - logInfo(`blockHeaderRPL.${ix}`, blockRPL); - logInfo(`accountStateProofRPL.${ix}`, getAccountRPL(root.accountProof)); - }); + if (FORMAT === 'raw') { + logSuccess('Method', 'processStorageRoot'); + roots.map((root, ix) => { + const accountRPL = getAccountRPL(root.accountProof); + logSuccess(`account.${ix}`, root.address); + logSuccess(`blockHash.${ix}`, proposal.snapshotBlockHash); + logSuccess(`blockHeaderRPL.${ix}`, blockRPL); + logSuccess(`accountStateProofRPL.${ix}`, accountRPL); + }); + } else { + roots.map((root, ix) => { + const accountRPL = getAccountRPL(root.accountProof); + logSuccess( + 'Encoded callData', + encodeFunctionData({ + abi: IDataWarehouse_ABI, + functionName: 'processStorageRoot', + args: [root.address, proposal.snapshotBlockHash, blockRPL, accountRPL], + }) + ); + }); + } } } }); @@ -241,8 +254,12 @@ export function addCommand(program: Command) { publicClient: DEFAULT_CLIENT, }); const proposalId = BigInt(options.getOptionValue('proposalId')); + const proposal = await governance.getProposal(proposalId); - const proofs = await governance.getRoots(proposalId); + const proofs = await governance.getStorageRoots(proposalId); + const block = await DEFAULT_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash }); + const blockRPL = getBLockRLP(block); + console.log(proofs); }); /** diff --git a/src/utils/constants.ts b/src/utils/constants.ts index cf25983..c502271 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -6,4 +6,4 @@ export const VERBOSE = process.env.VERBOSE; // determines what type of format to output // foundry will consume everything on stdOut so in foundry mode we essentially don't log -export const FORMAT = process.env.FORMAT as 'raw' | 'encoded' | 'foundry'; +export const FORMAT = process.env.FORMAT as 'raw' | 'encoded'; diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 3a52611..a34f9ee 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,20 +1,19 @@ import chalk from 'chalk'; -import { FORMAT, VERBOSE } from './constants'; +import { VERBOSE } from './constants'; export function logInfo(topic: string, text: string | number | bigint) { if (!VERBOSE) return; console.log(chalk.blue(`Info[${topic}]: ${text}`)); } -export function logWarning(topic: string, text: string) { +export function logWarning(topic: string, text: string | number | bigint) { console.log(chalk.yellow(`Warning[${topic}]: ${text}`)); } -export function logError(topic: string, text: string) { +export function logError(topic: string, text: string | number | bigint) { console.log(chalk.red(`Error[${topic}]: ${text}`)); } -export function logSuccess(topic: string, text: string) { - if (FORMAT === 'foundry') console.log(text); +export function logSuccess(topic: string, text: string | number | bigint) { console.log(chalk.green(`Success[${topic}]: ${text}`)); } diff --git a/src/utils/logs.ts b/src/utils/logs.ts index 0c65892..04fc5b7 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -23,6 +23,9 @@ export async function getLogs( address: Hex ): Promise>> { const currentBlock = await client.getBlockNumber(); + /** + * need to specify range as some node prividers (e.g. default on base) throw range error on filter creation + */ const filter = await filterFn(0n, 1n); const filePath = client.chain!.id.toString(); const fileName = filter.eventName!; diff --git a/types.d.ts b/types.d.ts index a16de02..050cd02 100644 --- a/types.d.ts +++ b/types.d.ts @@ -7,6 +7,7 @@ declare namespace NodeJS { RPC_SEPOLIA: string; // CLI OPTIONS + FOUNDRY: string; VERBOSE: string; FORMAT: string; } From d85d6f3757dbda360eb41c49c98589c1753cd725 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 19 Sep 2023 09:31:15 +0200 Subject: [PATCH 64/94] fix: add scripts for fetching proofs etc --- src/commands/governance.ts | 54 +++++++++++++++++++++++++++++++++----- src/utils/constants.ts | 2 +- 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 3982ab4..4684e5e 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -9,7 +9,7 @@ import { import { HUMAN_READABLE_STATE, getGovernance } from '../govv3/governance'; import { CHAIN_ID_CLIENT_MAP, goerliClient } from '../utils/rpcClients'; import { logError, logInfo, logSuccess } from '../utils/logger'; -import { Hex, PublicClient, encodeFunctionData, getContract } from 'viem'; +import { Hex, PublicClient, encodeAbiParameters, encodeFunctionData, getContract, parseAbiParameters } from 'viem'; import { confirm, input, select } from '@inquirer/prompts'; import { getCachedIpfs } from '../ipfs/getCachedProposalMetaData'; import { toAddressLink, toTxLink } from '../govv3/utils/markdownUtils'; @@ -215,6 +215,7 @@ export function addCommand(program: Command) { ); const block = await DEFAULT_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash }); const blockRPL = getBLockRLP(block); + console.log(FORMAT); if (FORMAT === 'raw') { logSuccess('Method', 'processStorageRoot'); roots.map((root, ix) => { @@ -245,8 +246,8 @@ export function addCommand(program: Command) { * */ govV3 - .command('getWarehouseRoots') - .description('generate the roots for the warehouse') + .command('getStorageRoots') + .description('generate the storage roots for the warehouse') .requiredOption('--proposalId ', 'proposalId to generate the proof for') .action(async (name, options) => { const governance = getGovernance({ @@ -256,10 +257,36 @@ export function addCommand(program: Command) { const proposalId = BigInt(options.getOptionValue('proposalId')); const proposal = await governance.getProposal(proposalId); - const proofs = await governance.getStorageRoots(proposalId); + const roots = await governance.getStorageRoots(proposalId); const block = await DEFAULT_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash }); const blockRPL = getBLockRLP(block); - console.log(proofs); + const params = roots.map((root) => { + const accountRPL = getAccountRPL(root.accountProof); + return { + account: root.address, + blockHash: proposal.snapshotBlockHash, + blockHeaderRPL: blockRPL, + accountStateProofRPL: accountRPL, + }; + }); + + console.log( + encodeAbiParameters( + [ + { + name: 'params', + type: 'tuple[]', + components: [ + { name: 'account', type: 'address' }, + { name: 'blockHash', type: 'bytes32' }, + { name: 'blockHeaderRPL', type: 'bytes' }, + { name: 'accountStateProofRPL', type: 'bytes' }, + ], + }, + ], + [params] + ) + ); }); /** @@ -287,6 +314,21 @@ export function addCommand(program: Command) { }); const chainId = await portal.read.VOTING_MACHINE_CHAIN_ID(); const proofs = await governance.getVotingProofs(proposalId, voter as Hex, chainId); - console.log(proofs); // TODO: format so foundry can consume it + console.log( + encodeAbiParameters( + [ + { + name: 'proofs', + type: 'tuple[]', + components: [ + { name: 'underlyingAsset', type: 'address' }, + { name: 'slot', type: 'uin128' }, + { name: 'proof', type: 'bytes' }, + ], + }, + ], + [proofs] + ) + ); }); } diff --git a/src/utils/constants.ts b/src/utils/constants.ts index c502271..334f5fa 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -6,4 +6,4 @@ export const VERBOSE = process.env.VERBOSE; // determines what type of format to output // foundry will consume everything on stdOut so in foundry mode we essentially don't log -export const FORMAT = process.env.FORMAT as 'raw' | 'encoded'; +export const FORMAT = (process.env.FORMAT || 'raw') as 'raw' | 'encoded'; From 98948e1919e2b281f74345000411858b19445e8c Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 19 Sep 2023 10:03:38 +0200 Subject: [PATCH 65/94] fix: typo --- src/commands/governance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 4684e5e..81d0ee0 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -322,7 +322,7 @@ export function addCommand(program: Command) { type: 'tuple[]', components: [ { name: 'underlyingAsset', type: 'address' }, - { name: 'slot', type: 'uin128' }, + { name: 'slot', type: 'uint128' }, { name: 'proof', type: 'bytes' }, ], }, From c2368bf8ba089dfa7283fb2872bad839d167110c Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 19 Sep 2023 10:19:23 +0200 Subject: [PATCH 66/94] fix: improve error handling --- src/commands/fork.ts | 10 ++++----- src/commands/governance.ts | 43 ++++++++++++++++--------------------- src/govv3/governance.ts | 2 +- src/utils/constants.ts | 6 ++++++ src/utils/tenderlyClient.ts | 27 +++++++++++++++-------- 5 files changed, 49 insertions(+), 39 deletions(-) diff --git a/src/commands/fork.ts b/src/commands/fork.ts index 37db8d1..7f0f32c 100644 --- a/src/commands/fork.ts +++ b/src/commands/fork.ts @@ -1,10 +1,10 @@ import { Command } from '@commander-js/extra-typings'; import { tenderly } from '../utils/tenderlyClient'; import { getGovernance } from '../govv3/governance'; -import { GovernanceV3Ethereum } from '@bgd-labs/aave-address-book'; -import { CHAIN_ID_CLIENT_MAP, mainnetClient } from '../utils/rpcClients'; +import { CHAIN_ID_CLIENT_MAP } from '../utils/rpcClients'; import { getPayloadsController } from '../govv3/payloadsController'; import { Hex, PublicClient } from 'viem'; +import { DEFAULT_GOVERNANCE, DEFAULT_GOVERNANCE_CLIENT } from '../utils/constants'; export function addCommand(program: Command) { program @@ -27,8 +27,8 @@ export function addCommand(program: Command) { } = options; function getAlias() { const unix = Math.floor(new Date().getTime() / 1000); - if (options.alias) { - return `${unix}-${options.alias}`; + if (alias) { + return `${unix}-${alias}`; } else if (options.proposalId) { return `${unix}-proposalId-${options.proposalId}`; } else if (options.payloadId) { @@ -42,7 +42,7 @@ export function addCommand(program: Command) { alias: getAlias(), blockNumber: Number(blockNumber), }; - const governance = getGovernance({ address: GovernanceV3Ethereum.GOVERNANCE, publicClient: mainnetClient }); + const governance = getGovernance({ address: DEFAULT_GOVERNANCE, publicClient: DEFAULT_GOVERNANCE_CLIENT }); if (proposalId) { const payload = await governance.getSimulationPayloadForExecution(BigInt(proposalId)); const fork = await tenderly.fork({ diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 81d0ee0..10bb973 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -1,20 +1,15 @@ import { Command } from '@commander-js/extra-typings'; import { simulateProposal } from '../govv3/simulate'; -import { - GovernanceV3Goerli, - IDataWarehouse_ABI, - IVotingMachineWithProofs_ABI, - IVotingPortal_ABI, -} from '@bgd-labs/aave-address-book'; +import { IDataWarehouse_ABI, IVotingMachineWithProofs_ABI, IVotingPortal_ABI } from '@bgd-labs/aave-address-book'; import { HUMAN_READABLE_STATE, getGovernance } from '../govv3/governance'; -import { CHAIN_ID_CLIENT_MAP, goerliClient } from '../utils/rpcClients'; +import { CHAIN_ID_CLIENT_MAP } from '../utils/rpcClients'; import { logError, logInfo, logSuccess } from '../utils/logger'; -import { Hex, PublicClient, encodeAbiParameters, encodeFunctionData, getContract, parseAbiParameters } from 'viem'; +import { Hex, PublicClient, encodeAbiParameters, encodeFunctionData, getContract } from 'viem'; import { confirm, input, select } from '@inquirer/prompts'; import { getCachedIpfs } from '../ipfs/getCachedProposalMetaData'; import { toAddressLink, toTxLink } from '../govv3/utils/markdownUtils'; import { getAccountRPL, getBLockRLP } from '../govv3/proofs'; -import { FORMAT } from '../utils/constants'; +import { DEFAULT_GOVERNANCE, DEFAULT_GOVERNANCE_CLIENT, FORMAT } from '../utils/constants'; enum DialogOptions { DETAILS, @@ -25,9 +20,6 @@ enum DialogOptions { EXIT, } -const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; -const DEFAULT_CLIENT = goerliClient; - export function addCommand(program: Command) { const govV3 = program.command('governance').description('interact with governance v3 contracts'); @@ -46,7 +38,7 @@ export function addCommand(program: Command) { .action(async (opts) => { const governance = getGovernance({ address: DEFAULT_GOVERNANCE, - publicClient: DEFAULT_CLIENT, + publicClient: DEFAULT_GOVERNANCE_CLIENT, blockCreated: 9640498n, }); const logs = await governance.cacheLogs(); @@ -113,16 +105,19 @@ export function addCommand(program: Command) { } if (moreInfo == DialogOptions.TRANSACTIONS) { - logInfo('CreatedLog', toTxLink(proposalLogs.createdLog.transactionHash, false, DEFAULT_CLIENT)); + logInfo('CreatedLog', toTxLink(proposalLogs.createdLog.transactionHash, false, DEFAULT_GOVERNANCE_CLIENT)); if (proposalLogs.votingActivatedLog) logInfo( 'VotingActicated', - toTxLink(proposalLogs.votingActivatedLog.transactionHash, false, DEFAULT_CLIENT) + toTxLink(proposalLogs.votingActivatedLog.transactionHash, false, DEFAULT_GOVERNANCE_CLIENT) ); if (proposalLogs.queuedLog) - logInfo('QueuedLog', toTxLink(proposalLogs.queuedLog.transactionHash, false, DEFAULT_CLIENT)); + logInfo('QueuedLog', toTxLink(proposalLogs.queuedLog.transactionHash, false, DEFAULT_GOVERNANCE_CLIENT)); if (proposalLogs.executedLog) - logInfo('ExecutedLog', toTxLink(proposalLogs.executedLog.transactionHash, false, DEFAULT_CLIENT)); + logInfo( + 'ExecutedLog', + toTxLink(proposalLogs.executedLog.transactionHash, false, DEFAULT_GOVERNANCE_CLIENT) + ); } if (moreInfo == DialogOptions.DETAILS) { @@ -150,7 +145,7 @@ export function addCommand(program: Command) { const portal = getContract({ address: proposal.votingPortal, abi: IVotingPortal_ABI, - publicClient: DEFAULT_CLIENT, + publicClient: DEFAULT_GOVERNANCE_CLIENT, }); const [machine, chainId] = await Promise.all([ portal.read.VOTING_MACHINE(), @@ -192,7 +187,7 @@ export function addCommand(program: Command) { const portalContract = getContract({ address: proposal.votingPortal, abi: IVotingPortal_ABI, - publicClient: DEFAULT_CLIENT, + publicClient: DEFAULT_GOVERNANCE_CLIENT, }); const [machine, chainId] = await Promise.all([ portalContract.read.VOTING_MACHINE(), @@ -213,7 +208,7 @@ export function addCommand(program: Command) { CHAIN_ID_CLIENT_MAP[Number(chainId) as keyof typeof CHAIN_ID_CLIENT_MAP] as PublicClient ) ); - const block = await DEFAULT_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash }); + const block = await DEFAULT_GOVERNANCE_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash }); const blockRPL = getBLockRLP(block); console.log(FORMAT); if (FORMAT === 'raw') { @@ -252,13 +247,13 @@ export function addCommand(program: Command) { .action(async (name, options) => { const governance = getGovernance({ address: DEFAULT_GOVERNANCE, - publicClient: DEFAULT_CLIENT, + publicClient: DEFAULT_GOVERNANCE_CLIENT, }); const proposalId = BigInt(options.getOptionValue('proposalId')); const proposal = await governance.getProposal(proposalId); const roots = await governance.getStorageRoots(proposalId); - const block = await DEFAULT_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash }); + const block = await DEFAULT_GOVERNANCE_CLIENT.getBlock({ blockHash: proposal.snapshotBlockHash }); const blockRPL = getBLockRLP(block); const params = roots.map((root) => { const accountRPL = getAccountRPL(root.accountProof); @@ -300,7 +295,7 @@ export function addCommand(program: Command) { .action(async (name, options) => { const governance = getGovernance({ address: DEFAULT_GOVERNANCE, - publicClient: DEFAULT_CLIENT, + publicClient: DEFAULT_GOVERNANCE_CLIENT, }); const proposalId = BigInt(options.getOptionValue('proposalId')); const voter = options.getOptionValue('voter') as Hex; @@ -310,7 +305,7 @@ export function addCommand(program: Command) { const portal = getContract({ address: proposal.votingPortal, abi: IVotingPortal_ABI, - publicClient: DEFAULT_CLIENT, + publicClient: DEFAULT_GOVERNANCE_CLIENT, }); const chainId = await portal.read.VOTING_MACHINE_CHAIN_ID(); const proofs = await governance.getVotingProofs(proposalId, voter as Hex, chainId); diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index 55a0a6c..de8defa 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -167,7 +167,7 @@ export const getGovernance = ({ state_objects: { [governanceContract.address]: { storage: { - [proposalSlot]: toHex(proposalSlot1), // state & time + [proposalSlot]: toHex(proposalSlot1, { size: 32 }), // state & time // [toHex(fromHex(proposalSlot, { to: 'bigint' }) + 5n)]: toHex(parseUnits('340000000', 18), { // size: 32, // }), // votes (not needed as there's no validation for this at this point) diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 334f5fa..20aa940 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,3 +1,6 @@ +import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; +import { goerliClient } from './rpcClients'; + // arbitrary from EOA for proposal executions export const EOA = '0xD73a92Be73EfbFcF3854433A5FcbAbF9c1316073' as const; @@ -7,3 +10,6 @@ export const VERBOSE = process.env.VERBOSE; // determines what type of format to output // foundry will consume everything on stdOut so in foundry mode we essentially don't log export const FORMAT = (process.env.FORMAT || 'raw') as 'raw' | 'encoded'; + +export const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; +export const DEFAULT_GOVERNANCE_CLIENT = goerliClient; diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 02937a9..cdba3db 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -9,7 +9,7 @@ import { fromHex, } from 'viem'; import { EOA } from './constants'; -import { logInfo, logWarning } from './logger'; +import { logError, logInfo, logSuccess, logWarning } from './logger'; export type StateObject = { balance?: string; code?: string; @@ -272,15 +272,19 @@ class Tenderly { request.state_objects[request.from].balance = String(parseEther('3')); } + const fullRequest = JSON.stringify({ + generate_access_list: true, + save: true, + gas_price: '0', + gas: 30_000_000, + ...request, + }); + + logInfo('tenderly', `request: ${JSON.stringify(fullRequest)}`); + const response = await fetch(`${this.TENDERLY_BASE}/account/${this.ACCOUNT}/project/${this.PROJECT}/simulate`, { method: 'POST', - body: JSON.stringify({ - generate_access_list: true, - save: true, - gas_price: '0', - gas: 30_000_000, - ...request, - }), + body: fullRequest, headers: new Headers({ 'Content-Type': 'application/json', 'X-Access-Key': this.ACCESS_TOKEN, @@ -327,6 +331,10 @@ class Tenderly { }); const result = await response.json(); + if (result.error) { + logError('tenderly', 'fork could not be created'); + throw new Error(result.error.message); + } const fork = { id: result.simulation_fork.id, chainId: result.simulation_fork.network_id, @@ -334,7 +342,7 @@ class Tenderly { forkNetworkId: result.simulation_fork.chain_config.chain_id, forkUrl: `https://rpc.tenderly.co/fork/${result.simulation_fork.id}`, }; - logInfo( + logSuccess( 'tenderly', `Fork created! To use in aave interface you need to run the following commands:\n\n---\nlocalStorage.setItem('forkEnabled', 'true');\nlocalStorage.setItem('forkBaseChainId', ${fork.chainId});\nlocalStorage.setItem('forkNetworkId', ${fork.forkNetworkId});\nlocalStorage.setItem("forkRPCUrl", "${fork.forkUrl}");\n---\n` ); @@ -436,6 +444,7 @@ class Tenderly { to: request.to, value: 0n, } as any); + logSuccess('tenderly', 'transaction successfully executed'); } }; From af2572934a6a74b2fbdeb0c8d693668ba60c2b0b Mon Sep 17 00:00:00 2001 From: sakulstra Date: Fri, 22 Sep 2023 10:14:12 +0200 Subject: [PATCH 67/94] fix: add some more logs --- src/utils/tenderlyClient.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index cdba3db..cf51fcb 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -357,6 +357,7 @@ class Tenderly { }); const artifact = require(filePath); + logInfo('tenderly', `deploying ${filePath}`); return walletProvider.deployContract({ abi: artifact.abi, @@ -373,13 +374,16 @@ class Tenderly { const currentBlock = await publicProvider.getBlock(); // warping forward in time if (timestamp > currentBlock.timestamp) { - logInfo('tenderly', 'warping time'); + logInfo('tenderly', `warping time from ${currentBlock.timestamp} to ${timestamp}`); await publicProvider.request({ method: 'evm_increaseTime' as any, params: [toHex(timestamp - currentBlock.timestamp)], }); } else { - logWarning('tenderly', 'skipping time warp as tenderly forks do not support traveling back in time'); + logWarning( + 'tenderly', + `skipping time warp as tenderly forks do not support traveling back in time (from ${currentBlock.timestamp} to ${timestamp})` + ); } }; From 0fe7d08af787c96f687bbc5905dfe44c05545835 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Mon, 25 Sep 2023 10:55:46 +0200 Subject: [PATCH 68/94] feat: expose tenderly setCode --- src/utils/tenderlyClient.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index e945a15..6ef925b 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -464,6 +464,17 @@ class Tenderly { }), }); }; + + replaceCode = (fork: any, address: Hex, code: Hex) => { + const publicProvider = createPublicClient({ + chain: { id: 3030 } as any, + transport: http(fork.forkUrl), + }); + return publicProvider.request({ + method: 'tenderly_setCode' as any, + params: [address, code], + }); + }; } export const tenderly = new Tenderly( From 33723b0ce6d9f362d4d92b26dd42367f378a0c4d Mon Sep 17 00:00:00 2001 From: sakulstra Date: Thu, 28 Sep 2023 15:22:11 +0200 Subject: [PATCH 69/94] docs: improve readme --- README.md | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3be3759..069cd00 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ # BGD Labs <> Aave CLI +## About + `aave-cli` is a command line tool providing commands to automate certain tasks when interacting with the aave protocol. +For a full overview of features you can run `aave-cli --help` ## Fork -`aave-cli fork --help` can ge used to generate tenderly forks. The cli allows executing certain proposal/actionset IDs, an address or even local payload via aave governance. +`aave-cli fork --chainId ` can ge used to generate tenderly forks. +The cli allows executing certain proposal/actionset IDs, an address or even local payload via aave governance. +For a full overview of commands please run `aave-cli fork --help` ## Ipfs @@ -14,9 +19,21 @@ `aave-cli diff ` can be used to diff two config snapshots & generate a human readable report. -## Simulate +## Governance + +### Simulation + +`aave-cli governance simulate [proposalId]` can be used to simulate a certain proposal on tenderly (e2e across all networks). This feature is intended to be used by systems like seatbelt. + +### View + +`aave-cli goverannce view` will start a command line ui for the aave governance. +The command line ui, explains how to vote and generates the proofs needed for voting or registering roots. + +### GetStorageRoots + +`aave-cli governance getStorageRoots --proposalId ` is a utilitiy that generates the storage roots for the data warehouse. -`aave-cli simulate-proposal [proposalId]` can be used to simulate a certain proposal on tenderly (e2e across all networks). This feature is intended to be used by systems like seatbelt. +### GetVotingProofs -**Note**: currently nothing else is done in this script. You need to manually check the tenderly changes. -In the future we plan to support seatbelt report generation from here. +`aave-cli governance getVotingProofs --proposalId --voter ` generates the voting proofs for a specific address. From c06ff401ef41b077ecbf3e37288aa4ec8938fe7b Mon Sep 17 00:00:00 2001 From: sakulstra Date: Thu, 28 Sep 2023 15:33:16 +0200 Subject: [PATCH 70/94] typo: fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 069cd00..4464c72 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ For a full overview of commands please run `aave-cli fork --help` ### View -`aave-cli goverannce view` will start a command line ui for the aave governance. +`aave-cli governance view` will start a command line ui for the aave governance. The command line ui, explains how to vote and generates the proofs needed for voting or registering roots. ### GetStorageRoots From 2464556a761da574906a9ca9b44e45f102b253af Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 4 Oct 2023 11:52:45 +0200 Subject: [PATCH 71/94] fix: improve logs --- src/utils/tenderlyClient.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 6ef925b..a2de387 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -394,7 +394,7 @@ class Tenderly { }); const currentBlock = await publicProvider.getBlock(); if (blockNumber > currentBlock.number) { - logInfo('tenderly', 'warping blocks'); + logInfo('tenderly', `warping blocks from ${currentBlock.number} to ${blockNumber}`); await publicProvider.request({ method: 'evm_increaseBlocks' as any, params: [toHex(blockNumber - currentBlock.number)], @@ -448,6 +448,7 @@ class Tenderly { to: request.to, value: request.value || 0n, } as any); + // TODO: improve error handling as receiving a hash doesn't mean success logSuccess('tenderly', 'transaction successfully executed'); return hash; } From 2ef907cae282c4e433ddd57ac6c69f88d3e7f8ed Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 4 Oct 2023 11:54:05 +0200 Subject: [PATCH 72/94] fix: autopad --- src/utils/tenderlyClient.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index a2de387..8bbf0b3 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -7,6 +7,7 @@ import { toHex, parseEther, fromHex, + pad, } from 'viem'; import { EOA } from './constants'; import { logError, logInfo, logSuccess, logWarning } from './logger'; @@ -420,7 +421,11 @@ class Tenderly { for (const slot of Object.keys(request.state_objects[address].storage!) as Hex[]) { await publicProvider.request({ method: 'tenderly_setStorageAt' as any, - params: [address as Hex, slot as Hex, request.state_objects[address].storage![slot] as Hex], + params: [ + address as Hex, + pad(slot as Hex, { size: 32 }), + pad(request.state_objects[address].storage![slot] as Hex, { size: 32 }), + ], }); } } From 49442e9fbcf791c48db98995bfeafdeca9242f0a Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 4 Oct 2023 12:51:01 +0200 Subject: [PATCH 73/94] fix: add nop tx --- src/utils/tenderlyClient.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 8bbf0b3..79ff70b 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -8,6 +8,7 @@ import { parseEther, fromHex, pad, + zeroAddress, } from 'viem'; import { EOA } from './constants'; import { logError, logInfo, logSuccess, logWarning } from './logger'; @@ -367,6 +368,11 @@ class Tenderly { }; warpTime = async (fork: any, timestamp: bigint) => { + const walletProvider = createWalletClient({ + account: EOA, + chain: { id: 3030, name: 'tenderly' } as any, + transport: http(fork.forkUrl), + }); const publicProvider = createPublicClient({ chain: { id: 3030 } as any, transport: http(fork.forkUrl), @@ -380,6 +386,10 @@ class Tenderly { method: 'evm_increaseTime' as any, params: [toHex(timestamp - currentBlock.timestamp)], }); + await walletProvider.sendTransaction({ + to: zeroAddress, + value: 1n, + } as any); } else { logWarning( 'tenderly', @@ -389,6 +399,11 @@ class Tenderly { }; warpBlocks = async (fork: any, blockNumber: bigint) => { + const walletProvider = createWalletClient({ + account: EOA, + chain: { id: 3030, name: 'tenderly' } as any, + transport: http(fork.forkUrl), + }); const publicProvider = createPublicClient({ chain: { id: 3030 } as any, transport: http(fork.forkUrl), @@ -400,6 +415,10 @@ class Tenderly { method: 'evm_increaseBlocks' as any, params: [toHex(blockNumber - currentBlock.number)], }); + await walletProvider.sendTransaction({ + to: zeroAddress, + value: 1n, + } as any); } else { logWarning('tenderly', 'skipping block warp as tenderly forks do not support traveling back in time'); } From 31628d8011ecc7f19a84fa7dde49a89521d98639 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 4 Oct 2023 14:06:53 +0200 Subject: [PATCH 74/94] fix: check if txn was a success --- src/utils/tenderlyClient.ts | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/utils/tenderlyClient.ts b/src/utils/tenderlyClient.ts index 79ff70b..0580d76 100644 --- a/src/utils/tenderlyClient.ts +++ b/src/utils/tenderlyClient.ts @@ -368,11 +368,6 @@ class Tenderly { }; warpTime = async (fork: any, timestamp: bigint) => { - const walletProvider = createWalletClient({ - account: EOA, - chain: { id: 3030, name: 'tenderly' } as any, - transport: http(fork.forkUrl), - }); const publicProvider = createPublicClient({ chain: { id: 3030 } as any, transport: http(fork.forkUrl), @@ -386,10 +381,6 @@ class Tenderly { method: 'evm_increaseTime' as any, params: [toHex(timestamp - currentBlock.timestamp)], }); - await walletProvider.sendTransaction({ - to: zeroAddress, - value: 1n, - } as any); } else { logWarning( 'tenderly', @@ -399,11 +390,6 @@ class Tenderly { }; warpBlocks = async (fork: any, blockNumber: bigint) => { - const walletProvider = createWalletClient({ - account: EOA, - chain: { id: 3030, name: 'tenderly' } as any, - transport: http(fork.forkUrl), - }); const publicProvider = createPublicClient({ chain: { id: 3030 } as any, transport: http(fork.forkUrl), @@ -415,10 +401,6 @@ class Tenderly { method: 'evm_increaseBlocks' as any, params: [toHex(blockNumber - currentBlock.number)], }); - await walletProvider.sendTransaction({ - to: zeroAddress, - value: 1n, - } as any); } else { logWarning('tenderly', 'skipping block warp as tenderly forks do not support traveling back in time'); } @@ -472,8 +454,12 @@ class Tenderly { to: request.to, value: request.value || 0n, } as any); - // TODO: improve error handling as receiving a hash doesn't mean success - logSuccess('tenderly', 'transaction successfully executed'); + const receipt = await publicProvider.getTransactionReceipt({ hash }); + if (receipt.status === 'success') { + logSuccess('tenderly', 'transaction successfully executed'); + } else { + logError('tenderly', 'transaction reverted'); + } return hash; } }; From 66dca0c0a6bf887695a8876dc4983d097c67b9c8 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 4 Oct 2023 14:12:17 +0200 Subject: [PATCH 75/94] fix: update deps --- package.json | 10 +- yarn.lock | 393 +++++++++++++++------------------------------------ 2 files changed, 119 insertions(+), 284 deletions(-) diff --git a/package.json b/package.json index 62ecead..e12ed6d 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@types/object-hash": "^3.0.3", "@types/yargs": "^17.0.24", "tsup": "^7.2.0", - "tsx": "^3.12.8", + "tsx": "^3.13.0", "typescript": "^5.2.2", "vitest": "^0.34.3" }, @@ -52,9 +52,9 @@ "access": "public" }, "dependencies": { - "@bgd-labs/aave-address-book": "2.3.1-dfb6302aa92b55201141b7d43094327c4a646cf1.0", + "@bgd-labs/aave-address-book": "2.7.0", "@commander-js/extra-typings": "^11.0.0", - "@inquirer/prompts": "^3.1.1", + "@inquirer/prompts": "^3.2.0", "bs58": "^5.0.0", "chalk": "^4.1.2", "commander": "^11.0.0", @@ -65,7 +65,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.10.9", - "zod": "^3.21.4" + "viem": "^1.15.1", + "zod": "^3.22.3" } } diff --git a/yarn.lock b/yarn.lock index e3755ba..e342b4d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,58 +33,21 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@bgd-labs/aave-address-book@2.3.1-dfb6302aa92b55201141b7d43094327c4a646cf1.0": - version "2.3.1-dfb6302aa92b55201141b7d43094327c4a646cf1.0" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.3.1-dfb6302aa92b55201141b7d43094327c4a646cf1.0.tgz#4092650b3ce7dfa2d45a1efa721a260069ef8047" - integrity sha512-aL0vCiUcqxPbV+CchvLjKk2v78bLTVfASKDj+HL1mmXI6jBjKiZJ6qB4cA+7t0dRmKmn5MfMpR9UMs/kL+XeBQ== +"@bgd-labs/aave-address-book@2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.7.0.tgz#ae26abb1a340fe795b9a2febd87f842c2ed06a99" + integrity sha512-TYErogNQIecHnnr7NXxGSnr1d/QuXNP9o5L8wRzx0+GIJiCi7Dmy9dlJxQO/nEky/Nq512l09xYKjRVnTz37Tg== "@commander-js/extra-typings@^11.0.0": version "11.0.0" resolved "https://registry.yarnpkg.com/@commander-js/extra-typings/-/extra-typings-11.0.0.tgz#eb922a59550454cad1f319d3d33e675e12e92fa0" integrity sha512-06ol6Kn5gPjFY6v0vWOZ84nQwyqhZdaeZCHYH3vhwewjpOEjniF1KHZxh18887G3poWiJ8qyq5pb6ANuiddfPQ== -"@esbuild-kit/cjs-loader@^2.4.2": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz#cb4dde00fbf744a68c4f20162ea15a8242d0fa54" - integrity sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg== - dependencies: - "@esbuild-kit/core-utils" "^3.0.0" - get-tsconfig "^4.4.0" - -"@esbuild-kit/core-utils@^3.0.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz#49945d533dbd5e1b7620aa0fc522c15e6ec089c5" - integrity sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw== - dependencies: - esbuild "~0.17.6" - source-map-support "^0.5.21" - -"@esbuild-kit/core-utils@^3.2.2": - version "3.2.2" - resolved "https://registry.yarnpkg.com/@esbuild-kit/core-utils/-/core-utils-3.2.2.tgz#ac3fe38d6ddcb3aa4658425034bb7a9cefa83495" - integrity sha512-Ub6LaRaAgF80dTSzUdXpFLM1pVDdmEVB9qb5iAzSpyDlX/mfJTFGOnZ516O05p5uWWteNviMKi4PAyEuRxI5gA== - dependencies: - esbuild "~0.18.20" - source-map-support "^0.5.21" - -"@esbuild-kit/esm-loader@^2.5.5": - version "2.5.5" - resolved "https://registry.yarnpkg.com/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz#b82da14fcee3fc1d219869756c06f43f67d1ca71" - integrity sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw== - dependencies: - "@esbuild-kit/core-utils" "^3.0.0" - get-tsconfig "^4.4.0" - "@esbuild/android-arm64@0.17.12": version "0.17.12" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz#15a8e2b407d03989b899e325151dc2e96d19c620" integrity sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA== -"@esbuild/android-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd" - integrity sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA== - "@esbuild/android-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622" @@ -95,11 +58,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.12.tgz#677a09297e1f4f37aba7b4fc4f31088b00484985" integrity sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ== -"@esbuild/android-arm@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d" - integrity sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A== - "@esbuild/android-arm@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.20.tgz#fedb265bc3a589c84cc11f810804f234947c3682" @@ -110,11 +68,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.12.tgz#b292729eef4e0060ae1941f6a021c4d2542a3521" integrity sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w== -"@esbuild/android-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1" - integrity sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww== - "@esbuild/android-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.20.tgz#35cf419c4cfc8babe8893d296cd990e9e9f756f2" @@ -125,11 +78,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz#efa35318df931da05825894e1787b976d55adbe3" integrity sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg== -"@esbuild/darwin-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" - integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg== - "@esbuild/darwin-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz#08172cbeccf95fbc383399a7f39cfbddaeb0d7c1" @@ -140,11 +88,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz#e7b54bb3f6dc81aadfd0485cd1623c648157e64d" integrity sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA== -"@esbuild/darwin-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb" - integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw== - "@esbuild/darwin-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz#d70d5790d8bf475556b67d0f8b7c5bdff053d85d" @@ -155,11 +98,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz#99a18a8579d6299c449566fe91d9b6a54cf2a591" integrity sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ== -"@esbuild/freebsd-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2" - integrity sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ== - "@esbuild/freebsd-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz#98755cd12707f93f210e2494d6a4b51b96977f54" @@ -170,11 +108,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz#0e090190fede307fb4022f671791a50dd5121abd" integrity sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw== -"@esbuild/freebsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4" - integrity sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ== - "@esbuild/freebsd-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz#c1eb2bff03915f87c29cece4c1a7fa1f423b066e" @@ -185,11 +118,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz#7fe2a69f8a1a7153fa2b0f44aabcadb59475c7e0" integrity sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg== -"@esbuild/linux-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb" - integrity sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg== - "@esbuild/linux-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz#bad4238bd8f4fc25b5a021280c770ab5fc3a02a0" @@ -200,11 +128,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz#b87c76ebf1fe03e01fd6bb5cfc2f3c5becd5ee93" integrity sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA== -"@esbuild/linux-arm@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a" - integrity sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA== - "@esbuild/linux-arm@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz#3e617c61f33508a27150ee417543c8ab5acc73b0" @@ -215,11 +138,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz#9e9357090254524d32e6708883a47328f3037858" integrity sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw== -"@esbuild/linux-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a" - integrity sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ== - "@esbuild/linux-ia32@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz#699391cccba9aee6019b7f9892eb99219f1570a7" @@ -230,11 +148,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz#9deb605f9e2c82f59412ddfefb4b6b96d54b5b5b" integrity sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA== -"@esbuild/linux-loong64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72" - integrity sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ== - "@esbuild/linux-loong64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz#e6fccb7aac178dd2ffb9860465ac89d7f23b977d" @@ -245,11 +158,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz#6ef170b974ddf5e6acdfa5b05f22b6e9dfd2b003" integrity sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA== -"@esbuild/linux-mips64el@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289" - integrity sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A== - "@esbuild/linux-mips64el@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz#eeff3a937de9c2310de30622a957ad1bd9183231" @@ -260,11 +168,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz#1638d3d4acf1d34aaf37cf8908c2e1cefed16204" integrity sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A== -"@esbuild/linux-ppc64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7" - integrity sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg== - "@esbuild/linux-ppc64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz#2f7156bde20b01527993e6881435ad79ba9599fb" @@ -275,11 +178,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz#135b6e9270a8e2de2b9094bb21a287517df520ef" integrity sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA== -"@esbuild/linux-riscv64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09" - integrity sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA== - "@esbuild/linux-riscv64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz#6628389f210123d8b4743045af8caa7d4ddfc7a6" @@ -290,11 +188,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz#21e40830770c5d08368e300842bde382ce97d615" integrity sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g== -"@esbuild/linux-s390x@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829" - integrity sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q== - "@esbuild/linux-s390x@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz#255e81fb289b101026131858ab99fba63dcf0071" @@ -305,11 +198,6 @@ resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz" integrity sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA== -"@esbuild/linux-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4" - integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== - "@esbuild/linux-x64@0.18.20": version "0.18.20" resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz" @@ -320,11 +208,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz#c7c3b3017a4b938c76c35f66af529baf62eac527" integrity sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg== -"@esbuild/netbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462" - integrity sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q== - "@esbuild/netbsd-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz#30e8cd8a3dded63975e2df2438ca109601ebe0d1" @@ -335,11 +218,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz#05d04217d980e049001afdbeacbb58d31bb5cefb" integrity sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA== -"@esbuild/openbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691" - integrity sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g== - "@esbuild/openbsd-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz#7812af31b205055874c8082ea9cf9ab0da6217ae" @@ -350,11 +228,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz#cf3862521600e4eb6c440ec3bad31ed40fb87ef3" integrity sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg== -"@esbuild/sunos-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273" - integrity sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg== - "@esbuild/sunos-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz#d5c275c3b4e73c9b0ecd38d1ca62c020f887ab9d" @@ -365,11 +238,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz#43dd7fb5be77bf12a1550355ab2b123efd60868e" integrity sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg== -"@esbuild/win32-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f" - integrity sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag== - "@esbuild/win32-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz#73bc7f5a9f8a77805f357fab97f290d0e4820ac9" @@ -380,11 +248,6 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz#9940963d0bff4ea3035a84e2b4c6e41c5e6296eb" integrity sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng== -"@esbuild/win32-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03" - integrity sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw== - "@esbuild/win32-ia32@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz#ec93cbf0ef1085cc12e71e0d661d20569ff42102" @@ -395,48 +258,43 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz#3a11d13e9a5b0c05db88991b234d8baba1f96487" integrity sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw== -"@esbuild/win32-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" - integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA== - "@esbuild/win32-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d" integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ== -"@inquirer/checkbox@^1.3.11": - version "1.3.11" - resolved "https://registry.yarnpkg.com/@inquirer/checkbox/-/checkbox-1.3.11.tgz#3926d8def3142e54bcc621f7f61eace439bf2966" - integrity sha512-SaQBDr7niZQzoP5Mqzak5pQY7476mvf4Sj2V8VFrbFHWHsavy3nKGKEOgijNHy151bEgqDog1829g/pKa9Qcrw== +"@inquirer/checkbox@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@inquirer/checkbox/-/checkbox-1.4.0.tgz#9e583188be55f22ed624d2829421a3354d3d8c1a" + integrity sha512-7YcekwCvMTjrgjUursrH6AGZUSPw7gKPMvp0VhM3iq9mL46a7AeCfOTQTW0UPeiIfWmZK8wHyAD6wIhfDyLHpw== dependencies: - "@inquirer/core" "^5.0.0" - "@inquirer/type" "^1.1.4" + "@inquirer/core" "^5.1.0" + "@inquirer/type" "^1.1.5" ansi-escapes "^4.3.2" chalk "^4.1.2" figures "^3.2.0" -"@inquirer/confirm@^2.0.12": - version "2.0.12" - resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-2.0.12.tgz#d9fe9d5ce82907f956bd1c7d297ef11fc7a94c3f" - integrity sha512-Oxz3L0ti+0nWYHPPUIrPkxA2KnQZUGBHnk56yF5RjKqPGFrwvgLZdIXNe/w4I/OtdLeOBqHCrJ+kCvNvHVdk9g== +"@inquirer/confirm@^2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-2.0.14.tgz#b87fcdf218d0ce687bd021623e091d3a80744e9e" + integrity sha512-Elzo5VX5lO1q9xy8CChDtDQNVLaucufdZBAM12qdfX1L3NQ+TypnZytGmWDXHBTpBTwuhEuwxNvUw7B0HCURkw== dependencies: - "@inquirer/core" "^5.0.0" - "@inquirer/type" "^1.1.4" + "@inquirer/core" "^5.1.0" + "@inquirer/type" "^1.1.5" chalk "^4.1.2" -"@inquirer/core@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-5.0.0.tgz#0b4b4eb9c076aca7b2cf7d040fbae0eaf98321b5" - integrity sha512-q2o4BcANKFyuUI5V6ejmPs1f9SdbJxfnLmhQVb72Fj7hOudoKsJpByJZ0imv9a/rpKDogA+93vtBBMqsnS7/Fg== +"@inquirer/core@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-5.1.0.tgz#2e3f6abf1dee93eae60cd85a5168c52400f73c9c" + integrity sha512-EVnific72BhMOMo8mElvrYhGFWJZ73X6j0I+fITIPTsdAz6Z9A3w3csKy+XaH87/5QAEIQHR7RSCVXvQpIqNdQ== dependencies: - "@inquirer/type" "^1.1.4" - "@types/mute-stream" "^0.0.1" - "@types/node" "^20.6.0" + "@inquirer/type" "^1.1.5" + "@types/mute-stream" "^0.0.2" + "@types/node" "^20.8.2" "@types/wrap-ansi" "^3.0.0" ansi-escapes "^4.3.2" chalk "^4.1.2" - cli-spinners "^2.9.0" + cli-spinners "^2.9.1" cli-width "^4.1.0" figures "^3.2.0" mute-stream "^1.0.0" @@ -445,84 +303,84 @@ strip-ansi "^6.0.1" wrap-ansi "^6.2.0" -"@inquirer/editor@^1.2.10": - version "1.2.10" - resolved "https://registry.yarnpkg.com/@inquirer/editor/-/editor-1.2.10.tgz#7792e241b4f2b0dbc373b8983a89fb2c8f4df7a5" - integrity sha512-aluYpazbxIdM54L+xNmVHzOjoXGwkliTCvHxhtPg6itmqDGMVmU1z+T2akHt6Xnx9RyrTpbumFB4xn1iI0UfnA== +"@inquirer/editor@^1.2.12": + version "1.2.12" + resolved "https://registry.yarnpkg.com/@inquirer/editor/-/editor-1.2.12.tgz#3dfa72253e8a9d915b43f3c8dbc8df85e3c627ff" + integrity sha512-Y7zXQqcglPbbPkx0DPwx6HQFstJR5uex4hoQprjpdxSj8+Bf04+Og6mK/FNxoQbPvoNecegtmMGxDC+hVcMJZA== dependencies: - "@inquirer/core" "^5.0.0" - "@inquirer/type" "^1.1.4" + "@inquirer/core" "^5.1.0" + "@inquirer/type" "^1.1.5" chalk "^4.1.2" external-editor "^3.1.0" -"@inquirer/expand@^1.1.11": - version "1.1.11" - resolved "https://registry.yarnpkg.com/@inquirer/expand/-/expand-1.1.11.tgz#7ae46bb3f7e4d8611af341485e28efed871bcd90" - integrity sha512-GSZJbYKPBniyXgWeFLsqiv7TSK9QjpQqCr+i/85Yts3wwixXTrAeoqM3TVVgHO/3j+xeFcuhOm1wy/F2QY5aEg== +"@inquirer/expand@^1.1.13": + version "1.1.13" + resolved "https://registry.yarnpkg.com/@inquirer/expand/-/expand-1.1.13.tgz#921d36274c0b143f7bf6cefb42f002be9cd1646f" + integrity sha512-/+7CGCa7iyJIpli0NtukEAjSI7+wGgjYzsByLVSSAk3U696ZlCCP6iPtsWx6d1qfmaMmCzejcjylOj6OAeu4bA== dependencies: - "@inquirer/core" "^5.0.0" - "@inquirer/type" "^1.1.4" + "@inquirer/core" "^5.1.0" + "@inquirer/type" "^1.1.5" chalk "^4.1.2" figures "^3.2.0" -"@inquirer/input@^1.2.11": - version "1.2.11" - resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-1.2.11.tgz#7d2f1f58f69eb7dc33078b35c5ec463344b32a21" - integrity sha512-sV1nO6+RxMFTHAznmxMkbMkjGQ8NGMWr0mvXjU35YQ0OFEL+YlD+DPbNd9s3ltnswODZAcnM1yFvdko3S/Kj/w== +"@inquirer/input@^1.2.13": + version "1.2.13" + resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-1.2.13.tgz#27ee5826e2988735a78f50510c9652d2ef29e39a" + integrity sha512-gALuvSpZRYfqygPjlYWodMZ4TXwALvw7Pk4tRFhE1oMN79rLVlg88Z/X6JCUh+uV2qLaxxgbeP+cgPWTvuWsCg== dependencies: - "@inquirer/core" "^5.0.0" - "@inquirer/type" "^1.1.4" + "@inquirer/core" "^5.1.0" + "@inquirer/type" "^1.1.5" chalk "^4.1.2" -"@inquirer/password@^1.1.11": - version "1.1.11" - resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-1.1.11.tgz#086ab3c9018a34b644922bffb5f84928afa1d41c" - integrity sha512-r2eiLMlTuY+k+yJf6XLbnAEz7EDyWdjOrgVAWjSKoEDBc3T9/rq2I+7WiY9FUFArYY/1LxmsNWavs5NuMICx8Q== +"@inquirer/password@^1.1.13": + version "1.1.13" + resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-1.1.13.tgz#b7f0a0f7feed90e01630a9df4a14eab09697fcd6" + integrity sha512-6STGbL4Vm6ohE2yDBOSENCpCeywnvPux5psZVpvblGDop1oPiZkdsVI+NhsA0c4BE6YT0fNVK8Oqxf5Dgt5k7g== dependencies: - "@inquirer/input" "^1.2.11" - "@inquirer/type" "^1.1.4" + "@inquirer/input" "^1.2.13" + "@inquirer/type" "^1.1.5" ansi-escapes "^4.3.2" chalk "^4.1.2" -"@inquirer/prompts@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@inquirer/prompts/-/prompts-3.1.1.tgz#44cf520bd0bfa00a0292b3c54096fd396575e8f9" - integrity sha512-7m/7Q4eupJYmn0GxM1H1dcekE4F4YlIB6bSKZs2SVeShARYUVPiAKFZ9c15UzYnBtdjCv4zXI17jbNtCNqmxGQ== - dependencies: - "@inquirer/checkbox" "^1.3.11" - "@inquirer/confirm" "^2.0.12" - "@inquirer/core" "^5.0.0" - "@inquirer/editor" "^1.2.10" - "@inquirer/expand" "^1.1.11" - "@inquirer/input" "^1.2.11" - "@inquirer/password" "^1.1.11" - "@inquirer/rawlist" "^1.2.11" - "@inquirer/select" "^1.2.11" - -"@inquirer/rawlist@^1.2.11": - version "1.2.11" - resolved "https://registry.yarnpkg.com/@inquirer/rawlist/-/rawlist-1.2.11.tgz#3a75a7ab231f61be7af7d48872e995d5c65d2dba" - integrity sha512-4S2t2pCCR3VgyB3lbPKoiJ9020HHAi9g4M+DIyXHYwGE++7wURAwKkzb6v78fS0yKfCbyFt3BTcL2UffQRQ9Fg== - dependencies: - "@inquirer/core" "^5.0.0" - "@inquirer/type" "^1.1.4" +"@inquirer/prompts@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@inquirer/prompts/-/prompts-3.2.0.tgz#8f4feaa81560d22e77b55c676e9296a108daf5b1" + integrity sha512-sfT7eDoveChXr8iIfwUYkoVBjUcKqXluhjM0EVhRhN59ZuJCc5DAdnuKwaFXomwESDoN0f+2zHy+MpxUg+EZuQ== + dependencies: + "@inquirer/checkbox" "^1.4.0" + "@inquirer/confirm" "^2.0.14" + "@inquirer/core" "^5.1.0" + "@inquirer/editor" "^1.2.12" + "@inquirer/expand" "^1.1.13" + "@inquirer/input" "^1.2.13" + "@inquirer/password" "^1.1.13" + "@inquirer/rawlist" "^1.2.13" + "@inquirer/select" "^1.3.0" + +"@inquirer/rawlist@^1.2.13": + version "1.2.13" + resolved "https://registry.yarnpkg.com/@inquirer/rawlist/-/rawlist-1.2.13.tgz#e74f003d417add415fea8c349d186eef7cda5032" + integrity sha512-f+bASrCY2x2F90MrBYX7nUSetL6FsVLfskhGWEyVwj6VIXzc9T878z3v7KU3V10D1trWrCVHOdeqEcbnO68yhg== + dependencies: + "@inquirer/core" "^5.1.0" + "@inquirer/type" "^1.1.5" chalk "^4.1.2" -"@inquirer/select@^1.2.11": - version "1.2.11" - resolved "https://registry.yarnpkg.com/@inquirer/select/-/select-1.2.11.tgz#4a99edadd23f398bf51838b89383d3d0cfd80a05" - integrity sha512-LH2wzAsWfu/+wcapeht07zTDefuvGTpv0+9dCAQ68QigF+4gHzpWq5+AbBLbxzuH2Wz4WlHcti85nFUPPM1t3A== +"@inquirer/select@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@inquirer/select/-/select-1.3.0.tgz#00dfa5068bea85bffeb7aa7c402407bb590c8cd4" + integrity sha512-3sL5odCDYI+i+piAFqFa5ULDUKEpc0U1zEY4Wm6gjP6nMAHWM8r1UzMlpQXCyHny91Tz+oeSLeKinAde0z6R7w== dependencies: - "@inquirer/core" "^5.0.0" - "@inquirer/type" "^1.1.4" + "@inquirer/core" "^5.1.0" + "@inquirer/type" "^1.1.5" ansi-escapes "^4.3.2" chalk "^4.1.2" figures "^3.2.0" -"@inquirer/type@^1.1.4": - version "1.1.4" - resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-1.1.4.tgz#8ef3d3d638a59253fbbe4b0297035cddc227eaed" - integrity sha512-a6+RCiXBQEbiA73RT1pBfwiH2I+MPcoZoGKuuUYFkws+6ud7nb5kUQGHFGUSBim25IyVMT/mqbWIrkxetcIb/w== +"@inquirer/type@^1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-1.1.5.tgz#b8c171f755859c8159b10e41e1e3a88f0ca99d7f" + integrity sha512-wmwHvHozpPo4IZkkNtbYenem/0wnfI6hvOcGKmPEa0DwuaH5XUQzFqy6OpEpjEegZMhYIk8HDYITI16BPLtrRA== "@jest/schemas@^29.6.0": version "29.6.0" @@ -691,10 +549,10 @@ resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/mute-stream@^0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.1.tgz#8ec7d16d51e2ceb054d8be0226250169d17af5b2" - integrity sha512-0yQLzYhCqGz7CQPE3iDmYjhb7KMBFOP+tBkyw+/Y2YyDI5wpS7itXXxneN1zSsUwWx3Ji6YiVYrhAnpQGS/vkw== +"@types/mute-stream@^0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.2.tgz#5a011b17307364e48591ac6829a8e40e1c10c6b0" + integrity sha512-FpiGjk6+IOrN0lZEfUUjdra1csU1VxwYFj4S0Zj+TJpu5x5mZW30RkEZojTadrNZHNmpCHgoE62IQZAH0OeuIA== dependencies: "@types/node" "*" @@ -716,10 +574,10 @@ resolved "https://registry.npmjs.org/@types/node/-/node-20.1.5.tgz" integrity sha512-IvGD1CD/nego63ySR7vrAKEX3AJTcmrAN2kn+/sDNLi1Ff5kBzDeEdqWDplK+0HAEoLYej137Sk0cUU8OLOlMg== -"@types/node@^20.6.0": - version "20.6.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.1.tgz#8b589bba9b2af0128796461a0979764562687e6f" - integrity sha512-4LcJvuXQlv4lTHnxwyHQZ3uR9Zw2j7m1C9DfuwoTFQQP4Pmu04O6IfLYgMmHoOCt0nosItLLZAH+sOrRE0Bo8g== +"@types/node@^20.8.2": + version "20.8.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.2.tgz#d76fb80d87d0d8abfe334fc6d292e83e5524efc4" + integrity sha512-Vvycsc9FQdwhxE3y3DzeIxuEJbWGDsnrxvMADzTDF/lcdR9/K+AQIeAghTQsHtotg/q0j3WEOYS/jQgSdWue3w== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -1054,7 +912,7 @@ cids@^1.0.0, cids@^1.1.5, cids@^1.1.6: multihashes "^4.0.1" uint8arrays "^3.0.0" -cli-spinners@^2.9.0: +cli-spinners@^2.9.1: version "2.9.1" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.1.tgz#9c0b9dad69a6d47cbb4333c14319b060ed395a35" integrity sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ== @@ -1246,34 +1104,6 @@ esbuild@^0.18.2, esbuild@~0.18.20: "@esbuild/win32-ia32" "0.18.20" "@esbuild/win32-x64" "0.18.20" -esbuild@~0.17.6: - version "0.17.19" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955" - integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== - optionalDependencies: - "@esbuild/android-arm" "0.17.19" - "@esbuild/android-arm64" "0.17.19" - "@esbuild/android-x64" "0.17.19" - "@esbuild/darwin-arm64" "0.17.19" - "@esbuild/darwin-x64" "0.17.19" - "@esbuild/freebsd-arm64" "0.17.19" - "@esbuild/freebsd-x64" "0.17.19" - "@esbuild/linux-arm" "0.17.19" - "@esbuild/linux-arm64" "0.17.19" - "@esbuild/linux-ia32" "0.17.19" - "@esbuild/linux-loong64" "0.17.19" - "@esbuild/linux-mips64el" "0.17.19" - "@esbuild/linux-ppc64" "0.17.19" - "@esbuild/linux-riscv64" "0.17.19" - "@esbuild/linux-s390x" "0.17.19" - "@esbuild/linux-x64" "0.17.19" - "@esbuild/netbsd-x64" "0.17.19" - "@esbuild/openbsd-x64" "0.17.19" - "@esbuild/sunos-x64" "0.17.19" - "@esbuild/win32-arm64" "0.17.19" - "@esbuild/win32-ia32" "0.17.19" - "@esbuild/win32-x64" "0.17.19" - escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" @@ -1374,6 +1204,11 @@ fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== +fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" @@ -1389,10 +1224,10 @@ get-stream@^6.0.0: resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -get-tsconfig@^4.4.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.0.tgz#06ce112a1463e93196aa90320c35df5039147e34" - integrity sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw== +get-tsconfig@^4.7.2: + version "4.7.2" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.2.tgz#0dcd6fb330391d46332f4c6c1bf89a6514c2ddce" + integrity sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A== dependencies: resolve-pkg-maps "^1.0.0" @@ -2619,16 +2454,16 @@ tsup@^7.2.0: sucrase "^3.20.3" tree-kill "^1.2.2" -tsx@^3.12.8: - version "3.12.8" - resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.12.8.tgz#e9ec95c6b116e28f0187467f839029a3ce17a851" - integrity sha512-Lt9KYaRGF023tlLInPj8rgHwsZU8qWLBj4iRXNWxTfjIkU7canGL806AqKear1j722plHuiYNcL2ZCo6uS9UJA== +tsx@^3.13.0: + version "3.13.0" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.13.0.tgz#f860e511b33fcb41d74df87d7ba239a0b4012dbb" + integrity sha512-rjmRpTu3as/5fjNq/kOkOtihgLxuIz6pbKdj9xwP4J5jOLkBxw/rjN5ANw+KyrrOXV5uB7HC8+SrrSJxT65y+A== dependencies: - "@esbuild-kit/cjs-loader" "^2.4.2" - "@esbuild-kit/core-utils" "^3.2.2" - "@esbuild-kit/esm-loader" "^2.5.5" + esbuild "~0.18.20" + get-tsconfig "^4.7.2" + source-map-support "^0.5.21" optionalDependencies: - fsevents "~2.3.2" + fsevents "~2.3.3" type-detect@^4.0.0, type-detect@^4.0.5: version "4.0.8" @@ -2702,10 +2537,10 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.10.9: - version "1.10.9" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.10.9.tgz#9b16ade429b234f7b33a79544badddbb5498b13c" - integrity sha512-fhQxnMBFwGbyE/VOfcvcavxAPyqIHSgOB793gQcMPH1B9ahQvjMe3C3icqypC01ACaqpDPgYWGfvF/ExTeIPuA== +viem@^1.15.1: + version "1.15.1" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.15.1.tgz#030fb900d8099e6a1bd16164fa4e1e5b8e24607a" + integrity sha512-lxk8wwUK7ZivYAUZ6pH+9Y6jjrfXXjafCOoASa4lw3ULUCT2BajU4SELarlxJQimpsFd7OZD4m4iEXYLF/bt6w== dependencies: "@adraffy/ens-normalize" "1.9.4" "@noble/curves" "1.2.0" @@ -2852,7 +2687,7 @@ yocto-queue@^1.0.0: resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz" integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== -zod@^3.21.4: - version "3.21.4" - resolved "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz" - integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== +zod@^3.22.3: + version "3.22.3" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.3.tgz#2fbc96118b174290d94e8896371c95629e87a060" + integrity sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug== From e4a26888052e70f5b24b6f67e7c6b8b06d1c1e60 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 10 Oct 2023 09:57:58 +0200 Subject: [PATCH 76/94] fix: use mainnet as default --- src/commands/governance.ts | 2 +- src/utils/constants.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/governance.ts b/src/commands/governance.ts index 10bb973..59951a6 100644 --- a/src/commands/governance.ts +++ b/src/commands/governance.ts @@ -29,7 +29,7 @@ export function addCommand(program: Command) { .requiredOption('--proposalId ', 'proposalId to simulate via tenderly') .action(async (name, options) => { const proposalId = BigInt(options.getOptionValue('proposalId')); - await simulateProposal(DEFAULT_GOVERNANCE, DEFAULT_CLIENT, proposalId); + await simulateProposal(DEFAULT_GOVERNANCE, DEFAULT_GOVERNANCE_CLIENT, proposalId); }); govV3 diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 20aa940..4df936e 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,5 +1,5 @@ -import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; -import { goerliClient } from './rpcClients'; +import { GovernanceV3Ethereum } from '@bgd-labs/aave-address-book'; +import { mainnetClient } from './rpcClients'; // arbitrary from EOA for proposal executions export const EOA = '0xD73a92Be73EfbFcF3854433A5FcbAbF9c1316073' as const; @@ -11,5 +11,5 @@ export const VERBOSE = process.env.VERBOSE; // foundry will consume everything on stdOut so in foundry mode we essentially don't log export const FORMAT = (process.env.FORMAT || 'raw') as 'raw' | 'encoded'; -export const DEFAULT_GOVERNANCE = GovernanceV3Goerli.GOVERNANCE; -export const DEFAULT_GOVERNANCE_CLIENT = goerliClient; +export const DEFAULT_GOVERNANCE = GovernanceV3Ethereum.GOVERNANCE; +export const DEFAULT_GOVERNANCE_CLIENT = mainnetClient; From 476657b768f9ec4c577a847dbda4e8935dc1b181 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 10 Oct 2023 09:59:09 +0200 Subject: [PATCH 77/94] fix: remove error log --- .gitignore | 1 + yarn-error.log | 2774 ------------------------------------------------ 2 files changed, 1 insertion(+), 2774 deletions(-) delete mode 100644 yarn-error.log diff --git a/.gitignore b/.gitignore index 2412789..7245653 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ dist node_modules +yarn-error.log # proposal cache cache \ No newline at end of file diff --git a/yarn-error.log b/yarn-error.log deleted file mode 100644 index 2523060..0000000 --- a/yarn-error.log +++ /dev/null @@ -1,2774 +0,0 @@ -Arguments: - /home/sakulstra/.nvm/versions/node/v18.15.0/bin/node /home/sakulstra/.yarn/bin/yarn.js add commander.js - -PATH: - /home/sakulstra/.yarn/bin:/home/sakulstra/.config/yarn/global/node_modules/.bin:/home/sakulstra/.meteor:/home/sakulstra/.nvm/versions/node/v18.15.0/bin:/home/sakulstra/.local/bin:/usr/local/bin:/usr/bin:/var/lib/snapd/snap/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin:/home/sakulstra/.foundry/bin - -Yarn version: - 1.22.19 - -Node version: - 18.15.0 - -Platform: - linux x64 - -Trace: - Error: https://registry.yarnpkg.com/commander.js: Not found - at params.callback [as _callback] (/home/sakulstra/.yarn/lib/cli.js:66145:18) - at self.callback (/home/sakulstra/.yarn/lib/cli.js:140890:22) - at Request.emit (node:events:513:28) - at Request. (/home/sakulstra/.yarn/lib/cli.js:141862:10) - at Request.emit (node:events:513:28) - at IncomingMessage. (/home/sakulstra/.yarn/lib/cli.js:141784:12) - at Object.onceWrapper (node:events:627:28) - at IncomingMessage.emit (node:events:525:35) - at endReadableNT (node:internal/streams/readable:1359:12) - at process.processTicksAndRejections (node:internal/process/task_queues:82:21) - -npm manifest: - { - "name": "@bgd-labs/aave-cli", - "version": "0.0.23", - "description": "A cli to perform various aave governance related tasks", - "private": false, - "scripts": { - "start": "tsx src/cli.ts", - "build": "tsup", - "test": "vitest", - "ci:publish": "npm run build && npm publish --access=public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/bgd-labs/report-engine.git" - }, - "author": "BGD labs", - "license": "MIT", - "bugs": { - "url": "https://github.com/bgd-labs/report-engine/issues" - }, - "homepage": "https://github.com/bgd-labs/report-engine#readme", - "devDependencies": { - "@types/node-fetch": "^2.6.4", - "@types/object-hash": "^3.0.3", - "@types/yargs": "^17.0.24", - "tsup": "^7.2.0", - "tsx": "^3.12.8", - "typescript": "^5.2.2", - "vitest": "^0.34.3" - }, - "type": "module", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "exports": { - ".": { - "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" - }, - "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - }, - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" - } - }, - "bin": { - "aave-cli": "dist/cli.cjs" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@bgd-labs/aave-address-book": "2.3.0", - "bs58": "^5.0.0", - "chalk": "^4.1.2", - "dotenv": "^16.3.1", - "gray-matter": "^4.0.3", - "ipfs-only-hash": "^4.0.0", - "json-bigint": "^1.0.0", - "node-fetch": "^2.6.9", - "object-hash": "^3.0.0", - "viem": "^1.10.4", - "yargs": "^17.7.2", - "zod": "^3.21.4" - } - } - -yarn manifest: - No manifest - -Lockfile: - # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - # yarn lockfile v1 - - - "@adraffy/ens-normalize@1.9.4": - version "1.9.4" - resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" - integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== - - "@assemblyscript/loader@^0.9.4": - version "0.9.4" - resolved "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.9.4.tgz" - integrity sha512-HazVq9zwTVwGmqdwYzu7WyQ6FQVZ7SwET0KKQuKm55jD0IfUpZgN0OPIiZG3zV1iSrVYcN0bdwLRXI/VNCYsUA== - - "@babel/code-frame@^7.0.0": - version "7.21.4" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz" - integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== - dependencies: - "@babel/highlight" "^7.18.6" - - "@babel/helper-validator-identifier@^7.18.6": - version "7.19.1" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - - "@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" - js-tokens "^4.0.0" - - "@bgd-labs/aave-address-book@2.3.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.3.0.tgz#ee937504ca5ec8c7a2d7750cd203aa601d9e04e9" - integrity sha512-P5t94rwHXakJIxtyM0MQWeVFtzkoupGcBcSZnLenRa8dRq1PsDbwDhMtvOMbr94/49Jv6KjTTon+axp158YK6A== - - "@esbuild-kit/cjs-loader@^2.4.2": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz#cb4dde00fbf744a68c4f20162ea15a8242d0fa54" - integrity sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg== - dependencies: - "@esbuild-kit/core-utils" "^3.0.0" - get-tsconfig "^4.4.0" - - "@esbuild-kit/core-utils@^3.0.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz#49945d533dbd5e1b7620aa0fc522c15e6ec089c5" - integrity sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw== - dependencies: - esbuild "~0.17.6" - source-map-support "^0.5.21" - - "@esbuild-kit/core-utils@^3.2.2": - version "3.2.2" - resolved "https://registry.yarnpkg.com/@esbuild-kit/core-utils/-/core-utils-3.2.2.tgz#ac3fe38d6ddcb3aa4658425034bb7a9cefa83495" - integrity sha512-Ub6LaRaAgF80dTSzUdXpFLM1pVDdmEVB9qb5iAzSpyDlX/mfJTFGOnZ516O05p5uWWteNviMKi4PAyEuRxI5gA== - dependencies: - esbuild "~0.18.20" - source-map-support "^0.5.21" - - "@esbuild-kit/esm-loader@^2.5.5": - version "2.5.5" - resolved "https://registry.yarnpkg.com/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz#b82da14fcee3fc1d219869756c06f43f67d1ca71" - integrity sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw== - dependencies: - "@esbuild-kit/core-utils" "^3.0.0" - get-tsconfig "^4.4.0" - - "@esbuild/android-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz#15a8e2b407d03989b899e325151dc2e96d19c620" - integrity sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA== - - "@esbuild/android-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd" - integrity sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA== - - "@esbuild/android-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622" - integrity sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ== - - "@esbuild/android-arm@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.12.tgz#677a09297e1f4f37aba7b4fc4f31088b00484985" - integrity sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ== - - "@esbuild/android-arm@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d" - integrity sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A== - - "@esbuild/android-arm@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.20.tgz#fedb265bc3a589c84cc11f810804f234947c3682" - integrity sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw== - - "@esbuild/android-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.12.tgz#b292729eef4e0060ae1941f6a021c4d2542a3521" - integrity sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w== - - "@esbuild/android-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1" - integrity sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww== - - "@esbuild/android-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.20.tgz#35cf419c4cfc8babe8893d296cd990e9e9f756f2" - integrity sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg== - - "@esbuild/darwin-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz#efa35318df931da05825894e1787b976d55adbe3" - integrity sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg== - - "@esbuild/darwin-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" - integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg== - - "@esbuild/darwin-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz#08172cbeccf95fbc383399a7f39cfbddaeb0d7c1" - integrity sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA== - - "@esbuild/darwin-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz#e7b54bb3f6dc81aadfd0485cd1623c648157e64d" - integrity sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA== - - "@esbuild/darwin-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb" - integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw== - - "@esbuild/darwin-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz#d70d5790d8bf475556b67d0f8b7c5bdff053d85d" - integrity sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ== - - "@esbuild/freebsd-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz#99a18a8579d6299c449566fe91d9b6a54cf2a591" - integrity sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ== - - "@esbuild/freebsd-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2" - integrity sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ== - - "@esbuild/freebsd-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz#98755cd12707f93f210e2494d6a4b51b96977f54" - integrity sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw== - - "@esbuild/freebsd-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz#0e090190fede307fb4022f671791a50dd5121abd" - integrity sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw== - - "@esbuild/freebsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4" - integrity sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ== - - "@esbuild/freebsd-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz#c1eb2bff03915f87c29cece4c1a7fa1f423b066e" - integrity sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ== - - "@esbuild/linux-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz#7fe2a69f8a1a7153fa2b0f44aabcadb59475c7e0" - integrity sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg== - - "@esbuild/linux-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb" - integrity sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg== - - "@esbuild/linux-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz#bad4238bd8f4fc25b5a021280c770ab5fc3a02a0" - integrity sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA== - - "@esbuild/linux-arm@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz#b87c76ebf1fe03e01fd6bb5cfc2f3c5becd5ee93" - integrity sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA== - - "@esbuild/linux-arm@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a" - integrity sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA== - - "@esbuild/linux-arm@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz#3e617c61f33508a27150ee417543c8ab5acc73b0" - integrity sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg== - - "@esbuild/linux-ia32@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz#9e9357090254524d32e6708883a47328f3037858" - integrity sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw== - - "@esbuild/linux-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a" - integrity sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ== - - "@esbuild/linux-ia32@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz#699391cccba9aee6019b7f9892eb99219f1570a7" - integrity sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA== - - "@esbuild/linux-loong64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz#9deb605f9e2c82f59412ddfefb4b6b96d54b5b5b" - integrity sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA== - - "@esbuild/linux-loong64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72" - integrity sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ== - - "@esbuild/linux-loong64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz#e6fccb7aac178dd2ffb9860465ac89d7f23b977d" - integrity sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg== - - "@esbuild/linux-mips64el@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz#6ef170b974ddf5e6acdfa5b05f22b6e9dfd2b003" - integrity sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA== - - "@esbuild/linux-mips64el@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289" - integrity sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A== - - "@esbuild/linux-mips64el@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz#eeff3a937de9c2310de30622a957ad1bd9183231" - integrity sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ== - - "@esbuild/linux-ppc64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz#1638d3d4acf1d34aaf37cf8908c2e1cefed16204" - integrity sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A== - - "@esbuild/linux-ppc64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7" - integrity sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg== - - "@esbuild/linux-ppc64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz#2f7156bde20b01527993e6881435ad79ba9599fb" - integrity sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA== - - "@esbuild/linux-riscv64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz#135b6e9270a8e2de2b9094bb21a287517df520ef" - integrity sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA== - - "@esbuild/linux-riscv64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09" - integrity sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA== - - "@esbuild/linux-riscv64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz#6628389f210123d8b4743045af8caa7d4ddfc7a6" - integrity sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A== - - "@esbuild/linux-s390x@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz#21e40830770c5d08368e300842bde382ce97d615" - integrity sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g== - - "@esbuild/linux-s390x@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829" - integrity sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q== - - "@esbuild/linux-s390x@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz#255e81fb289b101026131858ab99fba63dcf0071" - integrity sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ== - - "@esbuild/linux-x64@0.17.12": - version "0.17.12" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz" - integrity sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA== - - "@esbuild/linux-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4" - integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== - - "@esbuild/linux-x64@0.18.20": - version "0.18.20" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz" - integrity sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w== - - "@esbuild/netbsd-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz#c7c3b3017a4b938c76c35f66af529baf62eac527" - integrity sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg== - - "@esbuild/netbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462" - integrity sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q== - - "@esbuild/netbsd-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz#30e8cd8a3dded63975e2df2438ca109601ebe0d1" - integrity sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A== - - "@esbuild/openbsd-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz#05d04217d980e049001afdbeacbb58d31bb5cefb" - integrity sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA== - - "@esbuild/openbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691" - integrity sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g== - - "@esbuild/openbsd-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz#7812af31b205055874c8082ea9cf9ab0da6217ae" - integrity sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg== - - "@esbuild/sunos-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz#cf3862521600e4eb6c440ec3bad31ed40fb87ef3" - integrity sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg== - - "@esbuild/sunos-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273" - integrity sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg== - - "@esbuild/sunos-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz#d5c275c3b4e73c9b0ecd38d1ca62c020f887ab9d" - integrity sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ== - - "@esbuild/win32-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz#43dd7fb5be77bf12a1550355ab2b123efd60868e" - integrity sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg== - - "@esbuild/win32-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f" - integrity sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag== - - "@esbuild/win32-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz#73bc7f5a9f8a77805f357fab97f290d0e4820ac9" - integrity sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg== - - "@esbuild/win32-ia32@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz#9940963d0bff4ea3035a84e2b4c6e41c5e6296eb" - integrity sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng== - - "@esbuild/win32-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03" - integrity sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw== - - "@esbuild/win32-ia32@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz#ec93cbf0ef1085cc12e71e0d661d20569ff42102" - integrity sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g== - - "@esbuild/win32-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz#3a11d13e9a5b0c05db88991b234d8baba1f96487" - integrity sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw== - - "@esbuild/win32-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" - integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA== - - "@esbuild/win32-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d" - integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ== - - "@jest/schemas@^29.6.0": - version "29.6.0" - resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz" - integrity sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ== - dependencies: - "@sinclair/typebox" "^0.27.8" - - "@jridgewell/sourcemap-codec@^1.4.15": - version "1.4.15" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" - integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== - - "@multiformats/base-x@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@multiformats/base-x/-/base-x-4.0.1.tgz" - integrity sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw== - - "@noble/curves@1.2.0", "@noble/curves@~1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" - integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== - dependencies: - "@noble/hashes" "1.3.2" - - "@noble/hashes@1.3.2", "@noble/hashes@~1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" - integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== - - "@noble/hashes@~1.3.0": - version "1.3.1" - resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz" - integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== - - "@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - - "@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - - "@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - - "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": - version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz" - integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== - - "@protobufjs/base64@^1.1.2": - version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz" - integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== - - "@protobufjs/codegen@^2.0.4": - version "2.0.4" - resolved "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz" - integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== - - "@protobufjs/eventemitter@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz" - integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== - - "@protobufjs/fetch@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz" - integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== - dependencies: - "@protobufjs/aspromise" "^1.1.1" - "@protobufjs/inquire" "^1.1.0" - - "@protobufjs/float@^1.0.2": - version "1.0.2" - resolved "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz" - integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== - - "@protobufjs/inquire@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz" - integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== - - "@protobufjs/path@^1.1.2": - version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz" - integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== - - "@protobufjs/pool@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz" - integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== - - "@protobufjs/utf8@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz" - integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== - - "@scure/base@~1.1.0": - version "1.1.1" - resolved "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz" - integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== - - "@scure/base@~1.1.2": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" - integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== - - "@scure/bip32@1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.2.tgz#90e78c027d5e30f0b22c1f8d50ff12f3fb7559f8" - integrity sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA== - dependencies: - "@noble/curves" "~1.2.0" - "@noble/hashes" "~1.3.2" - "@scure/base" "~1.1.2" - - "@scure/bip39@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" - integrity sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg== - dependencies: - "@noble/hashes" "~1.3.0" - "@scure/base" "~1.1.0" - - "@sinclair/typebox@^0.27.8": - version "0.27.8" - resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" - integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== - - "@types/chai-subset@^1.3.3": - version "1.3.3" - resolved "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz" - integrity sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw== - dependencies: - "@types/chai" "*" - - "@types/chai@*": - version "4.3.4" - resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz" - integrity sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw== - - "@types/chai@^4.3.5": - version "4.3.5" - resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz" - integrity sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng== - - "@types/long@^4.0.1": - version "4.0.2" - resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz" - integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== - - "@types/minimist@^1.2.0": - version "1.2.2" - resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz" - integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== - - "@types/node-fetch@^2.6.4": - version "2.6.4" - resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - - "@types/node@*": - version "18.15.3" - resolved "https://registry.npmjs.org/@types/node/-/node-18.15.3.tgz" - integrity sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw== - - "@types/node@>=13.7.0": - version "20.1.5" - resolved "https://registry.npmjs.org/@types/node/-/node-20.1.5.tgz" - integrity sha512-IvGD1CD/nego63ySR7vrAKEX3AJTcmrAN2kn+/sDNLi1Ff5kBzDeEdqWDplK+0HAEoLYej137Sk0cUU8OLOlMg== - - "@types/normalize-package-data@^2.4.0": - version "2.4.1" - resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz" - integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== - - "@types/object-hash@^3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@types/object-hash/-/object-hash-3.0.3.tgz" - integrity sha512-Mb0SDIhjhBAz4/rDNU0cYcQR4lSJIwy+kFlm0whXLkx+o0pXwEszwyrWD6gXWumxVbAS6XZ9gXK82LR+Uk+cKQ== - - "@types/ws@^8.5.5": - version "8.5.5" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" - integrity sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg== - dependencies: - "@types/node" "*" - - "@types/yargs-parser@*": - version "21.0.0" - resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz" - integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== - - "@types/yargs@^17.0.24": - version "17.0.24" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz" - integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== - dependencies: - "@types/yargs-parser" "*" - - "@vitest/expect@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.34.3.tgz#576e1fd6a3a8b8b7a79a06477f3d450a77d67852" - integrity sha512-F8MTXZUYRBVsYL1uoIft1HHWhwDbSzwAU9Zgh8S6WFC3YgVb4AnFV2GXO3P5Em8FjEYaZtTnQYoNwwBrlOMXgg== - dependencies: - "@vitest/spy" "0.34.3" - "@vitest/utils" "0.34.3" - chai "^4.3.7" - - "@vitest/runner@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.34.3.tgz#ce09b777d133bbcf843e1a67f4a743365764e097" - integrity sha512-lYNq7N3vR57VMKMPLVvmJoiN4bqwzZ1euTW+XXYH5kzr3W/+xQG3b41xJn9ChJ3AhYOSoweu974S1V3qDcFESA== - dependencies: - "@vitest/utils" "0.34.3" - p-limit "^4.0.0" - pathe "^1.1.1" - - "@vitest/snapshot@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-0.34.3.tgz#cb4767aa44711a1072bd2e06204b659275c4f0f2" - integrity sha512-QyPaE15DQwbnIBp/yNJ8lbvXTZxS00kRly0kfFgAD5EYmCbYcA+1EEyRalc93M0gosL/xHeg3lKAClIXYpmUiQ== - dependencies: - magic-string "^0.30.1" - pathe "^1.1.1" - pretty-format "^29.5.0" - - "@vitest/spy@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.34.3.tgz#d4cf25e6ca9230991a0223ecd4ec2df30f0784ff" - integrity sha512-N1V0RFQ6AI7CPgzBq9kzjRdPIgThC340DGjdKdPSE8r86aUSmeliTUgkTqLSgtEwWWsGfBQ+UetZWhK0BgJmkQ== - dependencies: - tinyspy "^2.1.1" - - "@vitest/utils@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.34.3.tgz#6e243189a358b736b9fc0216e6b6979bc857e897" - integrity sha512-kiSnzLG6m/tiT0XEl4U2H8JDBjFtwVlaE8I3QfGiMFR0QvnRDfYfdP3YvTBWM/6iJDAyaPY6yVQiCTUc7ZzTHA== - dependencies: - diff-sequences "^29.4.3" - loupe "^2.3.6" - pretty-format "^29.5.0" - - abitype@0.9.8: - version "0.9.8" - resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c" - integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ== - - acorn-walk@^8.2.0: - version "8.2.0" - resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - - acorn@^8.8.2: - version "8.8.2" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== - - acorn@^8.9.0: - version "8.10.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" - integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== - - ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - - ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - - ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - - ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - - any-promise@^1.0.0: - version "1.3.0" - resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz" - integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== - - anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - - argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - - array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - - arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" - integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== - - assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - - asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - - balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - - base-x@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz" - integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw== - - base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - - bignumber.js@^9.0.0: - version "9.1.1" - resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz" - integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== - - binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - - bl@^5.0.0: - version "5.1.0" - resolved "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz" - integrity sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ== - dependencies: - buffer "^6.0.3" - inherits "^2.0.4" - readable-stream "^3.4.0" - - blakejs@^1.1.0: - version "1.2.1" - resolved "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz" - integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== - - brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - - braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - - bs58@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz" - integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ== - dependencies: - base-x "^4.0.0" - - buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - - buffer@^6.0.3: - version "6.0.3" - resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - - bundle-require@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/bundle-require/-/bundle-require-4.0.1.tgz" - integrity sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ== - dependencies: - load-tsconfig "^0.2.3" - - cac@^6.7.12, cac@^6.7.14: - version "6.7.14" - resolved "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz" - integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== - - camelcase-keys@^6.2.2: - version "6.2.2" - resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz" - integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== - dependencies: - camelcase "^5.3.1" - map-obj "^4.0.0" - quick-lru "^4.0.1" - - camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - - chai@^4.3.7: - version "4.3.7" - resolved "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz" - integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^4.1.2" - get-func-name "^2.0.0" - loupe "^2.3.1" - pathval "^1.1.1" - type-detect "^4.0.5" - - chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - - chalk@^4.1.2: - version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - - check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" - integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== - - chokidar@^3.5.1: - version "3.5.3" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - - cids@^1.0.0, cids@^1.1.5, cids@^1.1.6: - version "1.1.9" - resolved "https://registry.npmjs.org/cids/-/cids-1.1.9.tgz" - integrity sha512-l11hWRfugIcbGuTZwAM5PwpjPPjyb6UZOGwlHSnOBV5o07XhQ4gNpBN67FbODvpjyHtd+0Xs6KNvUcGBiDRsdg== - dependencies: - multibase "^4.0.1" - multicodec "^3.0.1" - multihashes "^4.0.1" - uint8arrays "^3.0.0" - - cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - - color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - - color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - - color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - - color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - - combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - - commander@^4.0.0: - version "4.1.1" - resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz" - integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== - - concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - - cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - - debug@^4.3.1, debug@^4.3.4: - version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - - decamelize-keys@^1.1.0: - version "1.1.1" - resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz" - integrity sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg== - dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" - - decamelize@^1.1.0, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - - deep-eql@^4.1.2: - version "4.1.3" - resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz" - integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== - dependencies: - type-detect "^4.0.0" - - delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - - diff-sequences@^29.4.3: - version "29.4.3" - resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz" - integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== - - dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - - dotenv@^16.3.1: - version "16.3.1" - resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz" - integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== - - emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - - err-code@^3.0.0, err-code@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz" - integrity sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA== - - error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - - esbuild@^0.17.5: - version "0.17.12" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.17.12.tgz" - integrity sha512-bX/zHl7Gn2CpQwcMtRogTTBf9l1nl+H6R8nUbjk+RuKqAE3+8FDulLA+pHvX7aA7Xe07Iwa+CWvy9I8Y2qqPKQ== - optionalDependencies: - "@esbuild/android-arm" "0.17.12" - "@esbuild/android-arm64" "0.17.12" - "@esbuild/android-x64" "0.17.12" - "@esbuild/darwin-arm64" "0.17.12" - "@esbuild/darwin-x64" "0.17.12" - "@esbuild/freebsd-arm64" "0.17.12" - "@esbuild/freebsd-x64" "0.17.12" - "@esbuild/linux-arm" "0.17.12" - "@esbuild/linux-arm64" "0.17.12" - "@esbuild/linux-ia32" "0.17.12" - "@esbuild/linux-loong64" "0.17.12" - "@esbuild/linux-mips64el" "0.17.12" - "@esbuild/linux-ppc64" "0.17.12" - "@esbuild/linux-riscv64" "0.17.12" - "@esbuild/linux-s390x" "0.17.12" - "@esbuild/linux-x64" "0.17.12" - "@esbuild/netbsd-x64" "0.17.12" - "@esbuild/openbsd-x64" "0.17.12" - "@esbuild/sunos-x64" "0.17.12" - "@esbuild/win32-arm64" "0.17.12" - "@esbuild/win32-ia32" "0.17.12" - "@esbuild/win32-x64" "0.17.12" - - esbuild@^0.18.2, esbuild@~0.18.20: - version "0.18.20" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz" - integrity sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA== - optionalDependencies: - "@esbuild/android-arm" "0.18.20" - "@esbuild/android-arm64" "0.18.20" - "@esbuild/android-x64" "0.18.20" - "@esbuild/darwin-arm64" "0.18.20" - "@esbuild/darwin-x64" "0.18.20" - "@esbuild/freebsd-arm64" "0.18.20" - "@esbuild/freebsd-x64" "0.18.20" - "@esbuild/linux-arm" "0.18.20" - "@esbuild/linux-arm64" "0.18.20" - "@esbuild/linux-ia32" "0.18.20" - "@esbuild/linux-loong64" "0.18.20" - "@esbuild/linux-mips64el" "0.18.20" - "@esbuild/linux-ppc64" "0.18.20" - "@esbuild/linux-riscv64" "0.18.20" - "@esbuild/linux-s390x" "0.18.20" - "@esbuild/linux-x64" "0.18.20" - "@esbuild/netbsd-x64" "0.18.20" - "@esbuild/openbsd-x64" "0.18.20" - "@esbuild/sunos-x64" "0.18.20" - "@esbuild/win32-arm64" "0.18.20" - "@esbuild/win32-ia32" "0.18.20" - "@esbuild/win32-x64" "0.18.20" - - esbuild@~0.17.6: - version "0.17.19" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955" - integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== - optionalDependencies: - "@esbuild/android-arm" "0.17.19" - "@esbuild/android-arm64" "0.17.19" - "@esbuild/android-x64" "0.17.19" - "@esbuild/darwin-arm64" "0.17.19" - "@esbuild/darwin-x64" "0.17.19" - "@esbuild/freebsd-arm64" "0.17.19" - "@esbuild/freebsd-x64" "0.17.19" - "@esbuild/linux-arm" "0.17.19" - "@esbuild/linux-arm64" "0.17.19" - "@esbuild/linux-ia32" "0.17.19" - "@esbuild/linux-loong64" "0.17.19" - "@esbuild/linux-mips64el" "0.17.19" - "@esbuild/linux-ppc64" "0.17.19" - "@esbuild/linux-riscv64" "0.17.19" - "@esbuild/linux-s390x" "0.17.19" - "@esbuild/linux-x64" "0.17.19" - "@esbuild/netbsd-x64" "0.17.19" - "@esbuild/openbsd-x64" "0.17.19" - "@esbuild/sunos-x64" "0.17.19" - "@esbuild/win32-arm64" "0.17.19" - "@esbuild/win32-ia32" "0.17.19" - "@esbuild/win32-x64" "0.17.19" - - escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - - escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - - esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - - execa@^5.0.0: - version "5.1.1" - resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - - extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== - dependencies: - is-extendable "^0.1.0" - - fast-glob@^3.2.9: - version "3.2.12" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - - fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== - dependencies: - reusify "^1.0.4" - - fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - - find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - - form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - - fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - - fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - - function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - - get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - - get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" - integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== - - get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - - get-tsconfig@^4.4.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.0.tgz#06ce112a1463e93196aa90320c35df5039147e34" - integrity sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw== - dependencies: - resolve-pkg-maps "^1.0.0" - - glob-parent@^5.1.2, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - - glob@7.1.6: - version "7.1.6" - resolved "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - - globby@^11.0.3: - version "11.1.0" - resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - - gray-matter@^4.0.3: - version "4.0.3" - resolved "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz" - integrity sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q== - dependencies: - js-yaml "^3.13.1" - kind-of "^6.0.2" - section-matter "^1.0.0" - strip-bom-string "^1.0.0" - - hamt-sharding@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/hamt-sharding/-/hamt-sharding-2.0.1.tgz" - integrity sha512-vnjrmdXG9dDs1m/H4iJ6z0JFI2NtgsW5keRkTcM85NGak69Mkf5PHUqBz+Xs0T4sg0ppvj9O5EGAJo40FTxmmA== - dependencies: - sparse-array "^1.3.1" - uint8arrays "^3.0.0" - - hard-rejection@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz" - integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== - - has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - - has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - - has@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - - hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - - hosted-git-info@^4.0.1: - version "4.1.0" - resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz" - integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== - dependencies: - lru-cache "^6.0.0" - - human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - - ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - - ignore@^5.2.0: - version "5.2.4" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== - - indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - - inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - - inherits@2, inherits@^2.0.3, inherits@^2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - - interface-ipld-format@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/interface-ipld-format/-/interface-ipld-format-1.0.1.tgz" - integrity sha512-WV/ar+KQJVoQpqRDYdo7YPGYIUHJxCuOEhdvsRpzLqoOIVCqPKdMMYmsLL1nCRsF3yYNio+PAJbCKiv6drrEAg== - dependencies: - cids "^1.1.6" - multicodec "^3.0.1" - multihashes "^4.0.2" - - ipfs-only-hash@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/ipfs-only-hash/-/ipfs-only-hash-4.0.0.tgz" - integrity sha512-TE1DZCvfw8i3gcsTq3P4TFx3cKFJ3sluu/J3XINkJhIN9OwJgNMqKA+WnKx6ByCb1IoPXsTp1KM7tupElb6SyA== - dependencies: - ipfs-unixfs-importer "^7.0.1" - meow "^9.0.0" - - ipfs-unixfs-importer@^7.0.1: - version "7.0.3" - resolved "https://registry.npmjs.org/ipfs-unixfs-importer/-/ipfs-unixfs-importer-7.0.3.tgz" - integrity sha512-qeFOlD3AQtGzr90sr5Tq1Bi8pT5Nr2tSI8z310m7R4JDYgZc6J1PEZO3XZQ8l1kuGoqlAppBZuOYmPEqaHcVQQ== - dependencies: - bl "^5.0.0" - cids "^1.1.5" - err-code "^3.0.1" - hamt-sharding "^2.0.0" - ipfs-unixfs "^4.0.3" - ipld-dag-pb "^0.22.2" - it-all "^1.0.5" - it-batch "^1.0.8" - it-first "^1.0.6" - it-parallel-batch "^1.0.9" - merge-options "^3.0.4" - multihashing-async "^2.1.0" - rabin-wasm "^0.1.4" - uint8arrays "^2.1.2" - - ipfs-unixfs@^4.0.3: - version "4.0.3" - resolved "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-4.0.3.tgz" - integrity sha512-hzJ3X4vlKT8FQ3Xc4M1szaFVjsc1ZydN+E4VQ91aXxfpjFn9G2wsMo1EFdAXNq/BUnN5dgqIOMP5zRYr3DTsAw== - dependencies: - err-code "^3.0.1" - protobufjs "^6.10.2" - - ipld-dag-pb@^0.22.2: - version "0.22.3" - resolved "https://registry.npmjs.org/ipld-dag-pb/-/ipld-dag-pb-0.22.3.tgz" - integrity sha512-dfG5C5OVAR4FEP7Al2CrHWvAyIM7UhAQrjnOYOIxXGQz5NlEj6wGX0XQf6Ru6or1na6upvV3NQfstapQG8X2rg== - dependencies: - cids "^1.0.0" - interface-ipld-format "^1.0.0" - multicodec "^3.0.1" - multihashing-async "^2.0.0" - protobufjs "^6.10.2" - stable "^0.1.8" - uint8arrays "^2.0.5" - - is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - - is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - - is-core-module@^2.11.0, is-core-module@^2.5.0: - version "2.12.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz" - integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== - dependencies: - has "^1.0.3" - - is-core-module@^2.9.0: - version "2.11.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== - dependencies: - has "^1.0.3" - - is-extendable@^0.1.0: - version "0.1.1" - resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== - - is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - - is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - - is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - - is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - - is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz" - integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== - - is-plain-obj@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - - is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - - isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - - isomorphic-ws@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz" - integrity sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw== - - it-all@^1.0.5: - version "1.0.6" - resolved "https://registry.npmjs.org/it-all/-/it-all-1.0.6.tgz" - integrity sha512-3cmCc6Heqe3uWi3CVM/k51fa/XbMFpQVzFoDsV0IZNHSQDyAXl3c4MjHkFX5kF3922OGj7Myv1nSEUgRtcuM1A== - - it-batch@^1.0.8, it-batch@^1.0.9: - version "1.0.9" - resolved "https://registry.npmjs.org/it-batch/-/it-batch-1.0.9.tgz" - integrity sha512-7Q7HXewMhNFltTsAMdSz6luNhyhkhEtGGbYek/8Xb/GiqYMtwUmopE1ocPSiJKKp3rM4Dt045sNFoUu+KZGNyA== - - it-first@^1.0.6: - version "1.0.7" - resolved "https://registry.npmjs.org/it-first/-/it-first-1.0.7.tgz" - integrity sha512-nvJKZoBpZD/6Rtde6FXqwDqDZGF1sCADmr2Zoc0hZsIvnE449gRFnGctxDf09Bzc/FWnHXAdaHVIetY6lrE0/g== - - it-parallel-batch@^1.0.9: - version "1.0.11" - resolved "https://registry.npmjs.org/it-parallel-batch/-/it-parallel-batch-1.0.11.tgz" - integrity sha512-UWsWHv/kqBpMRmyZJzlmZeoAMA0F3SZr08FBdbhtbe+MtoEBgr/ZUAKrnenhXCBrsopy76QjRH2K/V8kNdupbQ== - dependencies: - it-batch "^1.0.9" - - joycon@^3.0.1: - version "3.1.1" - resolved "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz" - integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== - - js-sha3@^0.8.0: - version "0.8.0" - resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - - js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - - js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - - json-bigint@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz" - integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== - dependencies: - bignumber.js "^9.0.0" - - json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - - jsonc-parser@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz" - integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== - - kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: - version "6.0.3" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - - lilconfig@^2.0.5: - version "2.1.0" - resolved "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz" - integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== - - lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - - load-tsconfig@^0.2.3: - version "0.2.5" - resolved "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz" - integrity sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg== - - local-pkg@^0.4.3: - version "0.4.3" - resolved "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz" - integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g== - - locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - - lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz" - integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== - - long@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz" - integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== - - loupe@^2.3.1, loupe@^2.3.6: - version "2.3.6" - resolved "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz" - integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== - dependencies: - get-func-name "^2.0.0" - - lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - - magic-string@^0.30.1: - version "0.30.2" - resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.2.tgz" - integrity sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug== - dependencies: - "@jridgewell/sourcemap-codec" "^1.4.15" - - map-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" - integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== - - map-obj@^4.0.0: - version "4.3.0" - resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz" - integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== - - meow@^9.0.0: - version "9.0.0" - resolved "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz" - integrity sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize "^1.2.0" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" - - merge-options@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz" - integrity sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ== - dependencies: - is-plain-obj "^2.1.0" - - merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - - merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - - micromatch@^4.0.4: - version "4.0.5" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - - mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - - mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - - mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - - min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - - minimatch@^3.0.4: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - - minimist-options@4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" - integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - kind-of "^6.0.3" - - minimist@^1.2.5: - version "1.2.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - - mlly@^1.2.0: - version "1.2.1" - resolved "https://registry.npmjs.org/mlly/-/mlly-1.2.1.tgz" - integrity sha512-1aMEByaWgBPEbWV2BOPEMySRrzl7rIHXmQxam4DM8jVjalTQDjpN2ZKOLUrwyhfZQO7IXHml2StcHMhooDeEEQ== - dependencies: - acorn "^8.8.2" - pathe "^1.1.0" - pkg-types "^1.0.3" - ufo "^1.1.2" - - mlly@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/mlly/-/mlly-1.4.0.tgz" - integrity sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg== - dependencies: - acorn "^8.9.0" - pathe "^1.1.1" - pkg-types "^1.0.3" - ufo "^1.1.2" - - ms@2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - - multibase@^4.0.1: - version "4.0.6" - resolved "https://registry.npmjs.org/multibase/-/multibase-4.0.6.tgz" - integrity sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ== - dependencies: - "@multiformats/base-x" "^4.0.1" - - multicodec@^3.0.1: - version "3.2.1" - resolved "https://registry.npmjs.org/multicodec/-/multicodec-3.2.1.tgz" - integrity sha512-+expTPftro8VAW8kfvcuNNNBgb9gPeNYV9dn+z1kJRWF2vih+/S79f2RVeIwmrJBUJ6NT9IUPWnZDQvegEh5pw== - dependencies: - uint8arrays "^3.0.0" - varint "^6.0.0" - - multiformats@^9.4.2: - version "9.9.0" - resolved "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz" - integrity sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg== - - multihashes@^4.0.1, multihashes@^4.0.2: - version "4.0.3" - resolved "https://registry.npmjs.org/multihashes/-/multihashes-4.0.3.tgz" - integrity sha512-0AhMH7Iu95XjDLxIeuCOOE4t9+vQZsACyKZ9Fxw2pcsRmlX4iCn1mby0hS0bb+nQOVpdQYWPpnyusw4da5RPhA== - dependencies: - multibase "^4.0.1" - uint8arrays "^3.0.0" - varint "^5.0.2" - - multihashing-async@^2.0.0, multihashing-async@^2.1.0: - version "2.1.4" - resolved "https://registry.npmjs.org/multihashing-async/-/multihashing-async-2.1.4.tgz" - integrity sha512-sB1MiQXPSBTNRVSJc2zM157PXgDtud2nMFUEIvBrsq5Wv96sUclMRK/ecjoP1T/W61UJBqt4tCTwMkUpt2Gbzg== - dependencies: - blakejs "^1.1.0" - err-code "^3.0.0" - js-sha3 "^0.8.0" - multihashes "^4.0.1" - murmurhash3js-revisited "^3.0.0" - uint8arrays "^3.0.0" - - murmurhash3js-revisited@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz" - integrity sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g== - - mz@^2.7.0: - version "2.7.0" - resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz" - integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== - dependencies: - any-promise "^1.0.0" - object-assign "^4.0.1" - thenify-all "^1.0.0" - - nanoid@^3.3.4: - version "3.3.4" - resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz" - integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== - - node-fetch@^2.6.1: - version "2.6.11" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz" - integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== - dependencies: - whatwg-url "^5.0.0" - - node-fetch@^2.6.9: - version "2.6.9" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz" - integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg== - dependencies: - whatwg-url "^5.0.0" - - normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - - normalize-package-data@^3.0.0: - version "3.0.3" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz" - integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== - dependencies: - hosted-git-info "^4.0.1" - is-core-module "^2.5.0" - semver "^7.3.4" - validate-npm-package-license "^3.0.1" - - normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - - npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - - object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - - object-hash@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz" - integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== - - once@^1.3.0: - version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - - onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - - p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - - p-limit@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz" - integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== - dependencies: - yocto-queue "^1.0.0" - - p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - - p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - - parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - - path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - - path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - - path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - - path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - - path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - - pathe@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/pathe/-/pathe-1.1.0.tgz" - integrity sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w== - - pathe@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz" - integrity sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q== - - pathval@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== - - picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - - picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - - pirates@^4.0.1: - version "4.0.5" - resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== - - pkg-types@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz" - integrity sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A== - dependencies: - jsonc-parser "^3.2.0" - mlly "^1.2.0" - pathe "^1.1.0" - - postcss-load-config@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.1.tgz" - integrity sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA== - dependencies: - lilconfig "^2.0.5" - yaml "^2.1.1" - - postcss@^8.4.21: - version "8.4.21" - resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz" - integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== - dependencies: - nanoid "^3.3.4" - picocolors "^1.0.0" - source-map-js "^1.0.2" - - pretty-format@^29.5.0: - version "29.6.2" - resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.2.tgz" - integrity sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg== - dependencies: - "@jest/schemas" "^29.6.0" - ansi-styles "^5.0.0" - react-is "^18.0.0" - - protobufjs@^6.10.2: - version "6.11.3" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz" - integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" - "@types/node" ">=13.7.0" - long "^4.0.0" - - punycode@^2.1.0: - version "2.3.0" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== - - queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - - quick-lru@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" - integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== - - rabin-wasm@^0.1.4: - version "0.1.5" - resolved "https://registry.npmjs.org/rabin-wasm/-/rabin-wasm-0.1.5.tgz" - integrity sha512-uWgQTo7pim1Rnj5TuWcCewRDTf0PEFTSlaUjWP4eY9EbLV9em08v89oCz/WO+wRxpYuO36XEHp4wgYQnAgOHzA== - dependencies: - "@assemblyscript/loader" "^0.9.4" - bl "^5.0.0" - debug "^4.3.1" - minimist "^1.2.5" - node-fetch "^2.6.1" - readable-stream "^3.6.0" - - react-is@^18.0.0: - version "18.2.0" - resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" - integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== - - read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - - read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - - readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.2" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - - readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - - redent@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz" - integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== - dependencies: - indent-string "^4.0.0" - strip-indent "^3.0.0" - - require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - - resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - - resolve-pkg-maps@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" - integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== - - resolve@^1.10.0: - version "1.22.2" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz" - integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== - dependencies: - is-core-module "^2.11.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - - resolve@^1.22.1: - version "1.22.1" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== - dependencies: - is-core-module "^2.9.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - - reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - - rollup@^3.18.0, rollup@^3.2.5: - version "3.20.0" - resolved "https://registry.npmjs.org/rollup/-/rollup-3.20.0.tgz" - integrity sha512-YsIfrk80NqUDrxrjWPXUa7PWvAfegZEXHuPsEZg58fGCdjL1I9C1i/NaG+L+27kxxwkrG/QEDEQc8s/ynXWWGQ== - optionalDependencies: - fsevents "~2.3.2" - - run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - - safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - - section-matter@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz" - integrity sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA== - dependencies: - extend-shallow "^2.0.1" - kind-of "^6.0.0" - - "semver@2 || 3 || 4 || 5": - version "5.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - - semver@^7.3.4: - version "7.5.1" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz" - integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== - dependencies: - lru-cache "^6.0.0" - - shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - - shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - - siginfo@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz" - integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== - - signal-exit@^3.0.3: - version "3.0.7" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - - slash@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - - source-map-js@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== - - source-map-support@^0.5.21: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - - source-map@0.8.0-beta.0: - version "0.8.0-beta.0" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz" - integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== - dependencies: - whatwg-url "^7.0.0" - - source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - - sparse-array@^1.3.1: - version "1.3.2" - resolved "https://registry.npmjs.org/sparse-array/-/sparse-array-1.3.2.tgz" - integrity sha512-ZT711fePGn3+kQyLuv1fpd3rNSkNF8vd5Kv2D+qnOANeyKs3fx6bUMGWRPvgTTcYV64QMqZKZwcuaQSP3AZ0tg== - - spdx-correct@^3.0.0: - version "3.2.0" - resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz" - integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - - spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - - spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - - spdx-license-ids@^3.0.0: - version "3.0.13" - resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz" - integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== - - sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" - integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== - - stable@^0.1.8: - version "0.1.8" - resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz" - integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== - - stackback@0.0.2: - version "0.0.2" - resolved "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz" - integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== - - std-env@^3.3.3: - version "3.3.3" - resolved "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz" - integrity sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg== - - string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - - string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - - strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - - strip-bom-string@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz" - integrity sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g== - - strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - - strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - - strip-literal@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz" - integrity sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q== - dependencies: - acorn "^8.8.2" - - sucrase@^3.20.3: - version "3.30.0" - resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.30.0.tgz" - integrity sha512-7d37d3vLF0IeH2dzvHpzDNDxUqpbDHJXTJOAnQ8jvMW04o2Czps6mxtaSnKWpE+hUS/eczqfWPUgQTrazKZPnQ== - dependencies: - commander "^4.0.0" - glob "7.1.6" - lines-and-columns "^1.1.6" - mz "^2.7.0" - pirates "^4.0.1" - ts-interface-checker "^0.1.9" - - supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - - supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - - supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - - thenify-all@^1.0.0: - version "1.6.0" - resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz" - integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== - dependencies: - thenify ">= 3.1.0 < 4" - - "thenify@>= 3.1.0 < 4": - version "3.3.1" - resolved "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz" - integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== - dependencies: - any-promise "^1.0.0" - - tinybench@^2.5.0: - version "2.5.0" - resolved "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz" - integrity sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA== - - tinypool@^0.7.0: - version "0.7.0" - resolved "https://registry.npmjs.org/tinypool/-/tinypool-0.7.0.tgz" - integrity sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww== - - tinyspy@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz" - integrity sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w== - - to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - - tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz" - integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== - dependencies: - punycode "^2.1.0" - - tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - - tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - - trim-newlines@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz" - integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== - - ts-interface-checker@^0.1.9: - version "0.1.13" - resolved "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz" - integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== - - tsup@^7.2.0: - version "7.2.0" - resolved "https://registry.npmjs.org/tsup/-/tsup-7.2.0.tgz" - integrity sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ== - dependencies: - bundle-require "^4.0.0" - cac "^6.7.12" - chokidar "^3.5.1" - debug "^4.3.1" - esbuild "^0.18.2" - execa "^5.0.0" - globby "^11.0.3" - joycon "^3.0.1" - postcss-load-config "^4.0.1" - resolve-from "^5.0.0" - rollup "^3.2.5" - source-map "0.8.0-beta.0" - sucrase "^3.20.3" - tree-kill "^1.2.2" - - tsx@^3.12.8: - version "3.12.8" - resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.12.8.tgz#e9ec95c6b116e28f0187467f839029a3ce17a851" - integrity sha512-Lt9KYaRGF023tlLInPj8rgHwsZU8qWLBj4iRXNWxTfjIkU7canGL806AqKear1j722plHuiYNcL2ZCo6uS9UJA== - dependencies: - "@esbuild-kit/cjs-loader" "^2.4.2" - "@esbuild-kit/core-utils" "^3.2.2" - "@esbuild-kit/esm-loader" "^2.5.5" - optionalDependencies: - fsevents "~2.3.2" - - type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - - type-fest@^0.18.0: - version "0.18.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz" - integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== - - type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - - type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - - typescript@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" - integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== - - ufo@^1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz" - integrity sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ== - - uint8arrays@^2.0.5, uint8arrays@^2.1.2: - version "2.1.10" - resolved "https://registry.npmjs.org/uint8arrays/-/uint8arrays-2.1.10.tgz" - integrity sha512-Q9/hhJa2836nQfEJSZTmr+pg9+cDJS9XEAp7N2Vg5MzL3bK/mkMVfjscRGYruP9jNda6MAdf4QD/y78gSzkp6A== - dependencies: - multiformats "^9.4.2" - - uint8arrays@^3.0.0: - version "3.1.1" - resolved "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz" - integrity sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg== - dependencies: - multiformats "^9.4.2" - - util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - - validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - - varint@^5.0.2: - version "5.0.2" - resolved "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz" - integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== - - varint@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" - integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== - - viem@^1.10.4: - version "1.10.4" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.10.4.tgz#0c08364192194b067cede4583ad8cf7b02d2dbeb" - integrity sha512-GRnz1KLWh7rDFvR0fMUBt8orVu/QbGJ3QqlLo7M71H4rig39TvjDoVyMp7eFK18+Zs6niqev1f8woX9fv3cwVg== - dependencies: - "@adraffy/ens-normalize" "1.9.4" - "@noble/curves" "1.2.0" - "@noble/hashes" "1.3.2" - "@scure/bip32" "1.3.2" - "@scure/bip39" "1.2.1" - "@types/ws" "^8.5.5" - abitype "0.9.8" - isomorphic-ws "5.0.0" - ws "8.13.0" - - vite-node@0.34.3: - version "0.34.3" - resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.34.3.tgz#de134fe38bc1555ac8ab5e489d7df6159a3e1a4c" - integrity sha512-+0TzJf1g0tYXj6tR2vEyiA42OPq68QkRZCu/ERSo2PtsDJfBpDyEfuKbRvLmZqi/CgC7SCBtyC+WjTGNMRIaig== - dependencies: - cac "^6.7.14" - debug "^4.3.4" - mlly "^1.4.0" - pathe "^1.1.1" - picocolors "^1.0.0" - vite "^3.0.0 || ^4.0.0" - - "vite@^3.0.0 || ^4.0.0": - version "4.2.0" - resolved "https://registry.npmjs.org/vite/-/vite-4.2.0.tgz" - integrity sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g== - dependencies: - esbuild "^0.17.5" - postcss "^8.4.21" - resolve "^1.22.1" - rollup "^3.18.0" - optionalDependencies: - fsevents "~2.3.2" - - vitest@^0.34.3: - version "0.34.3" - resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.34.3.tgz#863d61c133d01b16e49fd52d380c09fa5ac03188" - integrity sha512-7+VA5Iw4S3USYk+qwPxHl8plCMhA5rtfwMjgoQXMT7rO5ldWcdsdo3U1QD289JgglGK4WeOzgoLTsGFu6VISyQ== - dependencies: - "@types/chai" "^4.3.5" - "@types/chai-subset" "^1.3.3" - "@types/node" "*" - "@vitest/expect" "0.34.3" - "@vitest/runner" "0.34.3" - "@vitest/snapshot" "0.34.3" - "@vitest/spy" "0.34.3" - "@vitest/utils" "0.34.3" - acorn "^8.9.0" - acorn-walk "^8.2.0" - cac "^6.7.14" - chai "^4.3.7" - debug "^4.3.4" - local-pkg "^0.4.3" - magic-string "^0.30.1" - pathe "^1.1.1" - picocolors "^1.0.0" - std-env "^3.3.3" - strip-literal "^1.0.1" - tinybench "^2.5.0" - tinypool "^0.7.0" - vite "^3.0.0 || ^4.0.0" - vite-node "0.34.3" - why-is-node-running "^2.2.2" - - webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - - webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - - whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - - whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - - which@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - - why-is-node-running@^2.2.2: - version "2.2.2" - resolved "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz" - integrity sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA== - dependencies: - siginfo "^2.0.0" - stackback "0.0.2" - - wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - - wrappy@1: - version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - - ws@8.13.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== - - y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - - yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - - yaml@^2.1.1: - version "2.3.1" - resolved "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz" - integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== - - yargs-parser@^20.2.3: - version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - - yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - - yargs@^17.7.2: - version "17.7.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - - yocto-queue@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz" - integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== - - zod@^3.21.4: - version "3.21.4" - resolved "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz" - integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== From 535f5865e530c8810a4f2493b02d686948cb7807 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 10 Oct 2023 10:04:14 +0200 Subject: [PATCH 78/94] fix: show correct version --- src/cli.ts | 3 ++- tsconfig.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index f502a0d..35ab46a 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -5,6 +5,7 @@ import { addCommand as addIpfsCommand } from './commands/ipfsUpload'; import { addCommand as addDiffSnapshots } from './commands/diffSnaphots'; import { addCommand as addGovernance } from './commands/governance'; import { addCommand as addFork } from './commands/fork'; +import packageJson from '../package.json'; const program = new Command(); @@ -21,7 +22,7 @@ program .on('option:format', function (format) { process.env.FORMAT = format; }) - .version('0.0.0') + .version(packageJson.version) .showHelpAfterError(); addGovernance(program); addDiffSnapshots(program); diff --git a/tsconfig.json b/tsconfig.json index d14327f..b467d9d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "strict": true, "target": "ESNext", "moduleResolution": "Node", - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true } } From 5552e3d80578dd2d0f3ff299ca7f1617c09a4a4b Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 10 Oct 2023 23:04:40 +0200 Subject: [PATCH 79/94] fix: remove goerli leftovers --- src/govv3/governance.ts | 28 +++++++++++++--------------- src/govv3/proofs.ts | 11 ++++------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index de8defa..93c6bb0 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -11,7 +11,12 @@ import { } from 'viem'; import merge from 'deepmerge'; import { FilterLogWithTimestamp, getLogs } from '../utils/logs'; -import { IGovernanceCore_ABI } from '@bgd-labs/aave-address-book'; +import { + AaveSafetyModule, + AaveV3Ethereum, + GovernanceV3Ethereum, + IGovernanceCore_ABI, +} from '@bgd-labs/aave-address-book'; import { TenderlyRequest, TenderlySimulationResponse, tenderly } from '../utils/tenderlyClient'; import { EOA } from '../utils/constants'; import { @@ -24,9 +29,6 @@ import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from '. import { readJSONCache, writeJSONCache } from '../utils/cache'; import { logInfo } from '../utils/logger'; -// TODO remove once final -const AaveSafetyModule = { STK_AAVE: '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' } as const; - type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; type CanceledLog = FilterLogWithTimestamp; @@ -288,7 +290,6 @@ export const getGovernance = ({ async getVotingProofs(proposalId: bigint, voter: Hex, votingChainId: bigint) { const proposal = await getProposal(proposalId); - // TODO: replace with real addresses const [stkAaveProof, aaveProof, aAaveProof, representativeProof] = await Promise.all([ getProof( publicClient, @@ -298,28 +299,25 @@ export const getGovernance = ({ ), getProof( publicClient, - '0xb6D88BfC5b145a558b279cf7692e6F02064889d0', - [getSolidityStorageSlotAddress(VOTING_SLOTS['0xb6D88BfC5b145a558b279cf7692e6F02064889d0'].balance, voter)], + AaveV3Ethereum.ASSETS.AAVE.UNDERLYING, + [getSolidityStorageSlotAddress(VOTING_SLOTS[AaveV3Ethereum.ASSETS.AAVE.UNDERLYING].balance, voter)], proposal.snapshotBlockHash ), getProof( publicClient, - '0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd', + AaveV3Ethereum.ASSETS.AAVE.A_TOKEN, [ - getSolidityStorageSlotAddress(VOTING_SLOTS['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd'].balance, voter), - getSolidityStorageSlotAddress(VOTING_SLOTS['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd'].delegation, voter), + getSolidityStorageSlotAddress(VOTING_SLOTS[AaveV3Ethereum.ASSETS.AAVE.A_TOKEN].balance, voter), + getSolidityStorageSlotAddress(VOTING_SLOTS[AaveV3Ethereum.ASSETS.AAVE.A_TOKEN].delegation, voter), ], proposal.snapshotBlockHash ), getProof( publicClient, - '0x586207Df62c7D5D1c9dBb8F61EdF77cc30925C4F', + GovernanceV3Ethereum.GOVERNANCE, [ getSolidityStorageSlotBytes( - getSolidityStorageSlotAddress( - VOTING_SLOTS['0x586207Df62c7D5D1c9dBb8F61EdF77cc30925C4F'].representative, - voter - ), + getSolidityStorageSlotAddress(VOTING_SLOTS[GovernanceV3Ethereum.GOVERNANCE].representative, voter), toHex(votingChainId, { size: 32 }) ), ], diff --git a/src/govv3/proofs.ts b/src/govv3/proofs.ts index ec32dd2..3e29897 100644 --- a/src/govv3/proofs.ts +++ b/src/govv3/proofs.ts @@ -1,9 +1,6 @@ -import { GovernanceV3Goerli } from '@bgd-labs/aave-address-book'; +import { AaveSafetyModule, AaveV3Ethereum, GovernanceV3Ethereum } from '@bgd-labs/aave-address-book'; import { Block, Hex, PublicClient, fromRlp, toHex, toRlp } from 'viem'; -// TODO remove once final -const AaveSafetyModule = { STK_AAVE: '0x1406A9Ea2B0ec8FD4bCa4F876DAae2a70a9856Ec' } as const; - /** * Slots that represent configuration values relevant for all accounts */ @@ -18,12 +15,12 @@ export const WAREHOUSE_SLOTS = { */ export const VOTING_SLOTS = { [AaveSafetyModule.STK_AAVE]: { balance: 0n }, // balance - ['0xD1ff82609FB63A0eee6FE7D2896d80d29491cCCd' /*AaveV3Ethereum.ASSETS.AAVE.A_TOKEN*/]: { + [AaveV3Ethereum.ASSETS.AAVE.A_TOKEN]: { balance: 52n, // balance delegation: 64n, }, // delegation - ['0xb6D88BfC5b145a558b279cf7692e6F02064889d0' /*AaveV3Ethereum.ASSETS.AAVE.UNDERLYING*/]: { balance: 0n }, // balance - [GovernanceV3Goerli.GOVERNANCE]: { representative: 9n }, // representative + [AaveV3Ethereum.ASSETS.AAVE.UNDERLYING]: { balance: 0n }, // balance + [GovernanceV3Ethereum.GOVERNANCE]: { representative: 9n }, // representative } as const; export interface Proof { From 38cb1dba53b1d2d0c0cab59eaab4a5bb0ac70f05 Mon Sep 17 00:00:00 2001 From: kartojal Date: Wed, 11 Oct 2023 12:34:38 +0200 Subject: [PATCH 80/94] feat: show address if missing block explorer (#61) * feat: expose tenderly setCode * fix: work around concat bug * chore(release): Release v0.0.26 :rocket: :tada: (#58) Co-authored-by: Release bot :robot * chore: upgrade ci to use release-please (#60) * feat: show address if missing block explorer, to prevent errors when using a chain id different than CHAIN_ID, in local networks or new networks --------- Co-authored-by: sakulstra Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Release bot :robot --- .github/workflows/dispatch-draft-release.yml | 12 ------ .github/workflows/release-please.yml | 34 ++++++++++++++++ .github/workflows/test-release.yml | 22 ----------- CHANGELOG.md | 12 ++++++ package.json | 2 +- .../__snapshots__/reserve.spec.ts.snap | 38 ++++++++++++++++++ src/reports/reserve.spec.ts | 12 +++++- src/reports/reserve.ts | 39 ++++++++----------- src/utils/storageSlots.ts | 5 ++- 9 files changed, 116 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/dispatch-draft-release.yml create mode 100644 .github/workflows/release-please.yml delete mode 100644 .github/workflows/test-release.yml diff --git a/.github/workflows/dispatch-draft-release.yml b/.github/workflows/dispatch-draft-release.yml deleted file mode 100644 index de180c9..0000000 --- a/.github/workflows/dispatch-draft-release.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Draft release - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} - cancel-in-progress: true - -on: - workflow_dispatch: - -jobs: - draft-release: - uses: bgd-labs/github-workflows/.github/workflows/draft-release.yml@main diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..58f6c25 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,34 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please +jobs: + test-node: + uses: bgd-labs/github-workflows/.github/workflows/test-node.yml@main + + release-please: + runs-on: ubuntu-latest + outputs: + releaseCreated: ${{ steps.release.outputs.release_created }} + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: node + package-name: aave-cli + pull-request-header: 'I have created a release' + + release-node: + uses: bgd-labs/github-workflows/.github/workflows/release-node.yml@main + if: ${{ needs.release-please.outputs.releaseCreated }} + needs: + - test-node + - release-please + secrets: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml deleted file mode 100644 index f2c09ad..0000000 --- a/.github/workflows/test-release.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Test & release - -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: true - -on: - push: - branches: - - main - -jobs: - test-node: - uses: bgd-labs/github-workflows/.github/workflows/test-node.yml@main - release: - uses: bgd-labs/github-workflows/.github/workflows/release.yml@main - needs: test-node - release-node: - uses: bgd-labs/github-workflows/.github/workflows/release-node.yml@main - needs: test-node - secrets: - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index b7208a4..2d0af29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.0.26](https://github.com/bgd-labs/report-engine/compare/v0.0.25...v0.0.26) (2023-10-03) + + +### Features + +* expose tenderly setCode ([e45aff4](https://github.com/bgd-labs/report-engine/commit/e45aff413ef831434b38e330d1bbe451fa84509e)) + + +### Bug Fixes + +* work around concat bug ([6bfb027](https://github.com/bgd-labs/report-engine/commit/6bfb0275b59a19cbe944b2976ae5c3e7167e96b5)) + ### [0.0.25](https://github.com/bgd-labs/report-engine/compare/v0.0.24...v0.0.25) (2023-09-25) diff --git a/package.json b/package.json index e12ed6d..24e3fda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bgd-labs/aave-cli", - "version": "0.0.25", + "version": "0.0.26", "description": "A cli to perform various aave governance related tasks", "private": false, "scripts": { diff --git a/src/reports/__snapshots__/reserve.spec.ts.snap b/src/reports/__snapshots__/reserve.spec.ts.snap index f32da78..307400a 100644 --- a/src/reports/__snapshots__/reserve.spec.ts.snap +++ b/src/reports/__snapshots__/reserve.spec.ts.snap @@ -46,3 +46,41 @@ exports[`reserve > renderReserve > should properly render new reserve 1`] = ` | interestRateStrategy | [0x9b34E3e183c9b0d1a08fF57a8fb59c821616295f](https://etherscan.io/address/0x9b34E3e183c9b0d1a08fF57a8fb59c821616295f) | " `; + +exports[`reserve > renderReserve > should properly render new reserve with local chain id 1`] = ` +"#### WBTC (0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f) + +| description | value | +| --- | --- | +| decimals | 8 | +| isActive | true | +| isFrozen | false | +| supplyCap | 2,100 WBTC | +| borrowCap | 1,115 WBTC | +| debtCeiling | 1,000 $ | +| isSiloed | false | +| isFlashloanable | false | +| eModeCategory | 0 | +| oracle | 0x6ce185860a4963106506C203335A2910413708e9 | +| oracleDecimals | 8 | +| oracleDescription | BTC / USD | +| oracleName | BTC / USD | +| oracleLatestAnswer | 22519.04551524 | +| usageAsCollateralEnabled | true | +| ltv | 70 % | +| liquidationThreshold | 75.55 % | +| liquidationBonus | 10 % | +| liquidationProtocolFee | 10 % | +| reserveFactor | 20 % | +| aToken | 0x078f358208685046a11C85e8ad32895DED33A249 | +| aTokenImpl | 0xa5ba6E5EC19a1Bf23C857991c857dB62b2Aa187B | +| variableDebtToken | 0x92b42c66840C7AD907b4BF74879FF3eF7c529473 | +| variableDebtTokenImpl | 0x81387c40EB75acB02757C1Ae55D5936E78c9dEd3 | +| stableDebtToken | 0x633b207Dd676331c413D4C013a6294B0FE47cD0e | +| stableDebtTokenImpl | 0x52A1CeB68Ee6b7B5D13E0376A1E0E4423A8cE26e | +| borrowingEnabled | true | +| stableBorrowRateEnabled | false | +| isBorrowableInIsolation | false | +| interestRateStrategy | 0x9b34E3e183c9b0d1a08fF57a8fb59c821616295f | +" +`; diff --git a/src/reports/reserve.spec.ts b/src/reports/reserve.spec.ts index 6132fa6..bd32e52 100644 --- a/src/reports/reserve.spec.ts +++ b/src/reports/reserve.spec.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest'; import { diff } from './diff'; -import { AaveV3Reserve } from './snapshot-types'; +import { AaveV3Reserve, CHAIN_ID } from './snapshot-types'; import { renderReserve, renderReserveDiff, renderReserveValue } from './reserve'; const WBTC_MOCK = { @@ -49,12 +49,22 @@ describe('reserve', () => { it('lt', () => { expect(renderReserveValue('liquidationThreshold', WBTC_MOCK, 1)).toBe('75.55 %'); }); + it('address with block explorer', () => { + expect(renderReserveValue('aToken', WBTC_MOCK, 1)).toBe(`[${WBTC_MOCK.aToken}](https://etherscan.io/address/${WBTC_MOCK.aToken})`); + }); + it('address without block explorer', () => { + expect(renderReserveValue('aToken', WBTC_MOCK, 31337 as CHAIN_ID)).toBe(WBTC_MOCK.aToken); + }); }); describe('renderReserve', () => { it('should properly render new reserve', () => { const out = renderReserve(WBTC_MOCK, 1); expect(out).toMatchSnapshot(); }); + it('should properly render new reserve with local chain id', () => { + const out = renderReserve(WBTC_MOCK, 31337 as CHAIN_ID); + expect(out).toMatchSnapshot(); + }); it('should properly render altered reserve', () => { const input: AaveV3Reserve = { ...WBTC_MOCK, borrowCap: 100 }; const out = diff(WBTC_MOCK, { ...input }); diff --git a/src/reports/reserve.ts b/src/reports/reserve.ts index 0b7f032..e111773 100644 --- a/src/reports/reserve.ts +++ b/src/reports/reserve.ts @@ -1,26 +1,19 @@ import { formatUnits } from 'viem'; import { AaveV3Reserve, CHAIN_ID } from './snapshot-types'; -export const getBlockExplorerLink: { - [key in CHAIN_ID]: (address: string) => string; -} = { - [CHAIN_ID.MAINNET]: (address) => - `[${address}](https://etherscan.io/address/${address})`, - [CHAIN_ID.OPTIMISM]: (address) => - `[${address}](https://optimistic.etherscan.io/address/${address})`, - [CHAIN_ID.POLYGON]: (address) => - `[${address}](https://polygonscan.com/address/${address})`, - [CHAIN_ID.FANTOM]: (address) => - `[${address}](https://ftmscan.com/address/${address})`, - [CHAIN_ID.ARBITRUM]: (address) => - `[${address}](https://arbiscan.io/address/${address})`, - [CHAIN_ID.AVALANCHE]: (address) => - `[${address}](https://snowtrace.io/address/${address})`, - [CHAIN_ID.METIS]: (address) => - `[${address}](https://andromeda-explorer.metis.io/address/${address})`, - [CHAIN_ID.BASE]: (address) => - `[${address}](https://basescan.org/address/${address})`, -}; +export const getBlockExplorerLink = (chain: number, address: string): string => { + switch (chain) { + case CHAIN_ID.MAINNET: return `[${address}](https://etherscan.io/address/${address})`; + case CHAIN_ID.OPTIMISM: return `[${address}](https://optimistic.etherscan.io/address/${address})`; + case CHAIN_ID.POLYGON: return `[${address}](https://polygonscan.com/address/${address})`; + case CHAIN_ID.FANTOM: return `[${address}](https://ftmscan.com/address/${address})`; + case CHAIN_ID.ARBITRUM: return `[${address}](https://arbiscan.io/address/${address})`; + case CHAIN_ID.AVALANCHE: return `[${address}](https://snowtrace.io/address/${address})`; + case CHAIN_ID.METIS: return `[${address}](https://andromeda-explorer.metis.io/address/${address})`; + case CHAIN_ID.BASE: return `[${address}](https://basescan.org/address/${address})`; + default: return address; + }; +} export function renderReserveValue( key: T, @@ -47,18 +40,18 @@ export function renderReserveValue( ? '0 %' : `${((reserve[key] as number) - 10000) / 100} %`; if (key === 'interestRateStrategy') - return getBlockExplorerLink[chainId](reserve[key] as string); + return getBlockExplorerLink(chainId, reserve[key] as string); if (key === 'oracleLatestAnswer' && reserve.oracleDecimals) return formatUnits(BigInt(reserve[key]), reserve.oracleDecimals); if (typeof reserve[key] === 'number') return reserve[key].toLocaleString('en-US'); if (typeof reserve[key] === 'string' && /0x.+/.test(reserve[key] as string)) - return getBlockExplorerLink[chainId](reserve[key] as string); + return getBlockExplorerLink(chainId, reserve[key] as string); return reserve[key]; } function renderReserveHeadline(reserve: AaveV3Reserve, chainId: CHAIN_ID) { - return `#### ${reserve.symbol} (${getBlockExplorerLink[chainId]( + return `#### ${reserve.symbol} (${getBlockExplorerLink(chainId, reserve.underlying )})\n\n`; } diff --git a/src/utils/storageSlots.ts b/src/utils/storageSlots.ts index 1a00e10..acdf890 100644 --- a/src/utils/storageSlots.ts +++ b/src/utils/storageSlots.ts @@ -61,7 +61,10 @@ export function getDynamicArraySlot(baseSlot: bigint, arrayIndex: number, itemSi export function getBytesValue(value: string | Hex) { const bytesString = toBytes(value); if (bytesString.length > 31) throw new Error('Error: strings > 31 bytes are not implemented'); - return concat([toHex(pad(bytesString, { size: 31, dir: 'right' })), toHex(bytesString.length * 2, { size: 1 })]); + return pad( + concat([toHex(pad(bytesString, { size: 31, dir: 'right' })), toHex(bytesString.length * 2, { size: 1 })]), + { size: 32 } + ); } /** From 531fd626b27b87bb5f6f6ad7a539751e4e54d337 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 11 Oct 2023 13:00:18 +0200 Subject: [PATCH 81/94] fix: remove duplcate method --- package.json | 2 +- src/govv3/utils/markdownUtils.ts | 14 +++++-- src/reports/reserve.ts | 67 +++++++------------------------- src/utils/rpcClients.ts | 39 +++++++++++++++---- yarn.lock | 26 +++++-------- 5 files changed, 66 insertions(+), 82 deletions(-) diff --git a/package.json b/package.json index 24e3fda..7e3fca5 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.15.1", + "viem": "^1.16.3", "zod": "^3.22.3" } } diff --git a/src/govv3/utils/markdownUtils.ts b/src/govv3/utils/markdownUtils.ts index 9eec6d2..c0a05a7 100644 --- a/src/govv3/utils/markdownUtils.ts +++ b/src/govv3/utils/markdownUtils.ts @@ -11,9 +11,10 @@ export function boolToMarkdown(value: boolean) { * @param address to be linked * @param code whether to link to the code tab */ -export function toAddressLink(address: Hex, md: boolean, client: PublicClient): string { +export function toAddressLink(address: Hex, md: boolean, client?: PublicClient): string { + if (!client) return address; const link = `${client.chain?.blockExplorers?.default.url}/address/${address}`; - if (md) return `[${address}](${link})`; + if (md) return toMarkdownLink(link, address); return link; } @@ -22,12 +23,17 @@ export function toAddressLink(address: Hex, md: boolean, client: PublicClient): * @param address to be linked * @param code whether to link to the code tab */ -export function toTxLink(txn: Hex, md: boolean, client: PublicClient): string { +export function toTxLink(txn: Hex, md: boolean, client?: PublicClient): string { + if (!client) return txn; const link = `${client.chain?.blockExplorers?.default.url}/tx/${txn}`; - if (md) return `[${txn}](${link})`; + if (md) return toMarkdownLink(link, txn); return link; } +export function toMarkdownLink(link: string, title?: any) { + return `[${title || link}](${link})`; +} + export function renderCheckResult(check: { name: string }, result: CheckResult) { let response = `### Check: ${check.name} ${boolToMarkdown(!result.errors.length)}\n\n`; if (result.errors.length) response += `#### Errors\n\n${result.errors.join('\n')}\n\n`; diff --git a/src/reports/reserve.ts b/src/reports/reserve.ts index e111773..e243948 100644 --- a/src/reports/reserve.ts +++ b/src/reports/reserve.ts @@ -1,59 +1,25 @@ -import { formatUnits } from 'viem'; +import { Hex, formatUnits } from 'viem'; import { AaveV3Reserve, CHAIN_ID } from './snapshot-types'; +import { toAddressLink } from '../govv3/utils/markdownUtils'; +import { CHAIN_ID_CLIENT_MAP } from '../utils/rpcClients'; -export const getBlockExplorerLink = (chain: number, address: string): string => { - switch (chain) { - case CHAIN_ID.MAINNET: return `[${address}](https://etherscan.io/address/${address})`; - case CHAIN_ID.OPTIMISM: return `[${address}](https://optimistic.etherscan.io/address/${address})`; - case CHAIN_ID.POLYGON: return `[${address}](https://polygonscan.com/address/${address})`; - case CHAIN_ID.FANTOM: return `[${address}](https://ftmscan.com/address/${address})`; - case CHAIN_ID.ARBITRUM: return `[${address}](https://arbiscan.io/address/${address})`; - case CHAIN_ID.AVALANCHE: return `[${address}](https://snowtrace.io/address/${address})`; - case CHAIN_ID.METIS: return `[${address}](https://andromeda-explorer.metis.io/address/${address})`; - case CHAIN_ID.BASE: return `[${address}](https://basescan.org/address/${address})`; - default: return address; - }; -} - -export function renderReserveValue( - key: T, - reserve: AaveV3Reserve, - chainId: CHAIN_ID -) { - if ( - [ - 'reserveFactor', - 'liquidationProtocolFee', - 'liquidationThreshold', - 'ltv', - ].includes(key) - ) +export function renderReserveValue(key: T, reserve: AaveV3Reserve, chainId: CHAIN_ID) { + if (['reserveFactor', 'liquidationProtocolFee', 'liquidationThreshold', 'ltv'].includes(key)) return `${formatUnits(BigInt(reserve[key]), 2)} %`; - if (['supplyCap', 'borrowCap'].includes(key)) - return `${reserve[key].toLocaleString('en-US')} ${reserve.symbol}`; - if (key === 'debtCeiling') - return `${Number(formatUnits(BigInt(reserve[key]), 2)).toLocaleString( - 'en-US' - )} $`; - if (key === 'liquidationBonus') - return reserve[key] === 0 - ? '0 %' - : `${((reserve[key] as number) - 10000) / 100} %`; - if (key === 'interestRateStrategy') - return getBlockExplorerLink(chainId, reserve[key] as string); + if (['supplyCap', 'borrowCap'].includes(key)) return `${reserve[key].toLocaleString('en-US')} ${reserve.symbol}`; + if (key === 'debtCeiling') return `${Number(formatUnits(BigInt(reserve[key]), 2)).toLocaleString('en-US')} $`; + if (key === 'liquidationBonus') return reserve[key] === 0 ? '0 %' : `${((reserve[key] as number) - 10000) / 100} %`; + if (key === 'interestRateStrategy') return toAddressLink(reserve[key] as Hex, true, CHAIN_ID_CLIENT_MAP[chainId]); if (key === 'oracleLatestAnswer' && reserve.oracleDecimals) return formatUnits(BigInt(reserve[key]), reserve.oracleDecimals); - if (typeof reserve[key] === 'number') - return reserve[key].toLocaleString('en-US'); + if (typeof reserve[key] === 'number') return reserve[key].toLocaleString('en-US'); if (typeof reserve[key] === 'string' && /0x.+/.test(reserve[key] as string)) - return getBlockExplorerLink(chainId, reserve[key] as string); + return toAddressLink(reserve[key] as Hex, true, CHAIN_ID_CLIENT_MAP[chainId]); return reserve[key]; } function renderReserveHeadline(reserve: AaveV3Reserve, chainId: CHAIN_ID) { - return `#### ${reserve.symbol} (${getBlockExplorerLink(chainId, - reserve.underlying - )})\n\n`; + return `#### ${reserve.symbol} (${toAddressLink(reserve.underlying as Hex, true, CHAIN_ID_CLIENT_MAP[chainId])})\n\n`; } const ORDER: (keyof AaveV3Reserve)[] = [ @@ -124,8 +90,7 @@ export type ReserveDiff = { export function renderReserveDiff(diff: ReserveDiff, chainId: CHAIN_ID) { let content = renderReserveHeadline(diff as AaveV3Reserve, chainId); - content += - '| description | value before | value after |\n| --- | --- | --- |\n'; + content += '| description | value before | value after |\n| --- | --- | --- |\n'; (Object.keys(diff) as (keyof AaveV3Reserve)[]) .filter((key) => diff[key].hasOwnProperty('from')) .sort(sortReserveKeys) @@ -134,11 +99,7 @@ export function renderReserveDiff(diff: ReserveDiff, chainId: CHAIN_ID) { key, { ...diff, [key]: diff[key].from }, chainId - )} | ${renderReserveValue( - key, - { ...diff, [key]: diff[key].to }, - chainId - )} |\n`; + )} | ${renderReserveValue(key, { ...diff, [key]: diff[key].to }, chainId)} |\n`; }); return content; } diff --git a/src/utils/rpcClients.ts b/src/utils/rpcClients.ts index db013be..7ba8ec8 100644 --- a/src/utils/rpcClients.ts +++ b/src/utils/rpcClients.ts @@ -1,5 +1,17 @@ -import { createPublicClient, http, fallback } from 'viem'; -import { mainnet, arbitrum, polygon, optimism, metis, base, sepolia, goerli, bsc } from 'viem/chains'; +import { createPublicClient, http, fallback, PublicClient } from 'viem'; +import { + mainnet, + arbitrum, + polygon, + optimism, + metis, + base, + sepolia, + goerli, + bsc, + fantom, + avalanche, +} from 'viem/chains'; export const mainnetClient = createPublicClient({ chain: mainnet, @@ -31,22 +43,35 @@ export const baseClient = createPublicClient({ transport: http(process.env.RPC_BASE), }); -export const bscClient = createPublicClient({ +export const fantomClient = createPublicClient({ + chain: fantom, + transport: http(process.env.RPC_FANTOM), +}); + +export const bnbClient = createPublicClient({ chain: bsc, - transport: http(process.env.RPC_BSC), + transport: http(process.env.RPC_BNB), +}); + +export const avalancheClient = createPublicClient({ + chain: avalanche, + transport: http(process.env.RPC_AVALANCHE), }); export const sepoliaClient = createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }); export const goerliClient = createPublicClient({ chain: goerli, transport: http(process.env.RPC_GOERLI) }); -export const CHAIN_ID_CLIENT_MAP = { +export const CHAIN_ID_CLIENT_MAP: Record = { [mainnet.id]: mainnetClient, [arbitrum.id]: arbitrumClient, [polygon.id]: polygonClient, - [optimism.id]: optimismClient, + [optimism.id]: optimismClient as PublicClient, [metis.id]: metisClient, - [base.id]: baseClient, + [base.id]: baseClient as PublicClient, [sepolia.id]: sepoliaClient, [goerli.id]: goerliClient, + [fantom.id]: fantomClient, + [bsc.id]: bnbClient, + [avalanche.id]: avalancheClient, } as const; diff --git a/yarn.lock b/yarn.lock index e342b4d..cc6e968 100644 --- a/yarn.lock +++ b/yarn.lock @@ -594,13 +594,6 @@ resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g== -"@types/ws@^8.5.5": - version "8.5.5" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" - integrity sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg== - dependencies: - "@types/node" "*" - "@types/yargs-parser@*": version "21.0.0" resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz" @@ -1485,10 +1478,10 @@ isexe@^2.0.0: resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isomorphic-ws@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz" - integrity sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw== +isows@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.3.tgz#93c1cf0575daf56e7120bab5c8c448b0809d0d74" + integrity sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg== it-all@^1.0.5: version "1.0.6" @@ -2537,19 +2530,18 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.15.1: - version "1.15.1" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.15.1.tgz#030fb900d8099e6a1bd16164fa4e1e5b8e24607a" - integrity sha512-lxk8wwUK7ZivYAUZ6pH+9Y6jjrfXXjafCOoASa4lw3ULUCT2BajU4SELarlxJQimpsFd7OZD4m4iEXYLF/bt6w== +viem@^1.16.3: + version "1.16.3" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.16.3.tgz#154e9a93bc5434d46fcae49ed0d6ec0a34f4d2c9" + integrity sha512-5IErEXuJVrSoMnEYidOh5lzPpTOZ/e33riDiZCxToap2DpLBMDpZCKoZZgroQgH7mAjfZcylv/LS+YIP/Gmeyg== dependencies: "@adraffy/ens-normalize" "1.9.4" "@noble/curves" "1.2.0" "@noble/hashes" "1.3.2" "@scure/bip32" "1.3.2" "@scure/bip39" "1.2.1" - "@types/ws" "^8.5.5" abitype "0.9.8" - isomorphic-ws "5.0.0" + isows "1.0.3" ws "8.13.0" vite-node@0.34.3: From 56a951e336d7b943976525642a90e8813a2d159a Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 24 Oct 2023 10:58:00 +0200 Subject: [PATCH 82/94] feat: use getProofs --- package.json | 8 ++++---- src/govv3/governance.ts | 7 ++++--- src/govv3/proofs.ts | 33 ++++++++++----------------------- yarn.lock | 32 ++++++++++++++++---------------- 4 files changed, 34 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 7e3fca5..f985935 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@types/object-hash": "^3.0.3", "@types/yargs": "^17.0.24", "tsup": "^7.2.0", - "tsx": "^3.13.0", + "tsx": "^3.14.0", "typescript": "^5.2.2", "vitest": "^0.34.3" }, @@ -53,7 +53,7 @@ }, "dependencies": { "@bgd-labs/aave-address-book": "2.7.0", - "@commander-js/extra-typings": "^11.0.0", + "@commander-js/extra-typings": "^11.1.0", "@inquirer/prompts": "^3.2.0", "bs58": "^5.0.0", "chalk": "^4.1.2", @@ -65,7 +65,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.16.3", - "zod": "^3.22.3" + "viem": "^1.16.6", + "zod": "^3.22.4" } } diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index 93c6bb0..b7aaada 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -25,9 +25,10 @@ import { getSolidityStorageSlotUint, } from '../utils/storageSlots'; import { setBits } from '../utils/storageSlots'; -import { Proof, VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from './proofs'; +import { VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from './proofs'; import { readJSONCache, writeJSONCache } from '../utils/cache'; import { logInfo } from '../utils/logger'; +import { GetProofReturnType } from 'viem/_types/actions/public/getProof'; type CreatedLog = FilterLogWithTimestamp; type QueuedLog = FilterLogWithTimestamp; @@ -84,7 +85,7 @@ export interface Governance { proposalId: bigint, params: { executedLog?: ExecutedLog } ) => Promise; - getStorageRoots(proposalId: bigint): Promise; + getStorageRoots(proposalId: bigint): Promise; /** * Returns the proofs that are non-zero for a specified address * @param proposalId @@ -336,7 +337,7 @@ export const getGovernance = ({ slots // filter out zero proofs as they don't add any value .filter((slot, ix) => { - const shouldSubmitProof = proof.storageProof[ix].value !== '0x0'; + const shouldSubmitProof = proof.storageProof[ix].value !== 0n; if (!shouldSubmitProof) logInfo('Proof', `Skipping slot ${slot} on ${proof.address} as value is zero for voter ${voter}`); return shouldSubmitProof; diff --git a/src/govv3/proofs.ts b/src/govv3/proofs.ts index 3e29897..32a6cbe 100644 --- a/src/govv3/proofs.ts +++ b/src/govv3/proofs.ts @@ -23,49 +23,36 @@ export const VOTING_SLOTS = { [GovernanceV3Ethereum.GOVERNANCE]: { representative: 9n }, // representative } as const; -export interface Proof { - address: Hex; - accountProof: Hex[]; - balance: Hex; - codeHash: Hex; - nonce: Hex; - storageHash: Hex; - storageProof: { - key: Hex; - value: Hex; - proof: Hex[]; - }[]; -} - export async function getProof(publicClient: PublicClient, address: Hex, slots: readonly Hex[], blockHash: Hex) { const block = await publicClient.getBlock({ blockHash }); - return publicClient.request({ - method: 'eth_getProof' as any, - params: [address, slots.map((slot) => slot), toHex(block.number)] as any, - }) as Promise; + return publicClient.getProof({ + address, + storageKeys: slots.map((slot) => slot), + blockNumber: block.number, + }); } // IMPORTANT valid only for post-Shapella blocks, as it includes `withdrawalsRoot` export const getBLockRLP = (rawBlock: Block): Hex => { - const rawData = [ + const rawData: Hex[] = [ rawBlock.parentHash, rawBlock.sha3Uncles, rawBlock.miner, rawBlock.stateRoot, rawBlock.transactionsRoot, rawBlock.receiptsRoot, - rawBlock.logsBloom, - '0x', //toHex(rawBlock.difficulty), + rawBlock.logsBloom!, + '0x0', //toHex(rawBlock.difficulty), toHex(rawBlock.number || 0), // 0 to account for type null toHex(rawBlock.gasLimit), toHex(rawBlock.gasUsed), toHex(rawBlock.timestamp), rawBlock.extraData, rawBlock.mixHash, - rawBlock.nonce, + rawBlock.nonce!, toHex(rawBlock.baseFeePerGas || 0), // 0 to account for type null // @ts-ignore looks like this field is not yet added into the type - rawBlock.withdrawalsRoot, + rawBlock.withdrawalsRoot!, ]; return toRlp(rawData); }; diff --git a/yarn.lock b/yarn.lock index cc6e968..79cdff0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -38,10 +38,10 @@ resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.7.0.tgz#ae26abb1a340fe795b9a2febd87f842c2ed06a99" integrity sha512-TYErogNQIecHnnr7NXxGSnr1d/QuXNP9o5L8wRzx0+GIJiCi7Dmy9dlJxQO/nEky/Nq512l09xYKjRVnTz37Tg== -"@commander-js/extra-typings@^11.0.0": - version "11.0.0" - resolved "https://registry.yarnpkg.com/@commander-js/extra-typings/-/extra-typings-11.0.0.tgz#eb922a59550454cad1f319d3d33e675e12e92fa0" - integrity sha512-06ol6Kn5gPjFY6v0vWOZ84nQwyqhZdaeZCHYH3vhwewjpOEjniF1KHZxh18887G3poWiJ8qyq5pb6ANuiddfPQ== +"@commander-js/extra-typings@^11.1.0": + version "11.1.0" + resolved "https://registry.yarnpkg.com/@commander-js/extra-typings/-/extra-typings-11.1.0.tgz#dd19fcb8cc6e33ede237fc1b7af96c70833d8f93" + integrity sha512-GuvZ38d23H+7Tz2C9DhzCepivsOsky03s5NI+KCy7ke1FNUvsJ2oO47scQ9YaGGhgjgNW5OYYNSADmbjcSoIhw== "@esbuild/android-arm64@0.17.12": version "0.17.12" @@ -2447,10 +2447,10 @@ tsup@^7.2.0: sucrase "^3.20.3" tree-kill "^1.2.2" -tsx@^3.13.0: - version "3.13.0" - resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.13.0.tgz#f860e511b33fcb41d74df87d7ba239a0b4012dbb" - integrity sha512-rjmRpTu3as/5fjNq/kOkOtihgLxuIz6pbKdj9xwP4J5jOLkBxw/rjN5ANw+KyrrOXV5uB7HC8+SrrSJxT65y+A== +tsx@^3.14.0: + version "3.14.0" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.14.0.tgz#be6e2176b6f210fe8f48124fb6e22e0f075e927b" + integrity sha512-xHtFaKtHxM9LOklMmJdI3BEnQq/D5F73Of2E1GDrITi9sgoVkvIsrQUTY1G8FlmGtA+awCI4EBlTRRYxkL2sRg== dependencies: esbuild "~0.18.20" get-tsconfig "^4.7.2" @@ -2530,10 +2530,10 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.16.3: - version "1.16.3" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.16.3.tgz#154e9a93bc5434d46fcae49ed0d6ec0a34f4d2c9" - integrity sha512-5IErEXuJVrSoMnEYidOh5lzPpTOZ/e33riDiZCxToap2DpLBMDpZCKoZZgroQgH7mAjfZcylv/LS+YIP/Gmeyg== +viem@^1.16.6: + version "1.16.6" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.16.6.tgz#78118c9269506a59e2bc4deab13f1646e113d3fc" + integrity sha512-jcWcFQ+xzIfDwexwPJRvCuCRJKEkK9iHTStG7mpU5MmuSBpACs4nATBDyXNFtUiyYTFzLlVEwWkt68K0nCSImg== dependencies: "@adraffy/ens-normalize" "1.9.4" "@noble/curves" "1.2.0" @@ -2679,7 +2679,7 @@ yocto-queue@^1.0.0: resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz" integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== -zod@^3.22.3: - version "3.22.3" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.3.tgz#2fbc96118b174290d94e8896371c95629e87a060" - integrity sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug== +zod@^3.22.4: + version "3.22.4" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff" + integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg== From d6cf0f2c4cd568f3aa7c12bb69dbb1316b2af72c Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 24 Oct 2023 13:09:16 +0200 Subject: [PATCH 83/94] feat: add gnosis --- src/utils/rpcClients.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils/rpcClients.ts b/src/utils/rpcClients.ts index 7ba8ec8..3326f08 100644 --- a/src/utils/rpcClients.ts +++ b/src/utils/rpcClients.ts @@ -11,6 +11,7 @@ import { bsc, fantom, avalanche, + gnosis, } from 'viem/chains'; export const mainnetClient = createPublicClient({ @@ -58,6 +59,11 @@ export const avalancheClient = createPublicClient({ transport: http(process.env.RPC_AVALANCHE), }); +export const gnosisClient = createPublicClient({ + chain: gnosis, + transport: http(process.env.RPC_GNOSIS), +}); + export const sepoliaClient = createPublicClient({ chain: sepolia, transport: http(process.env.RPC_SEPOLIA) }); export const goerliClient = createPublicClient({ chain: goerli, transport: http(process.env.RPC_GOERLI) }); @@ -74,4 +80,5 @@ export const CHAIN_ID_CLIENT_MAP: Record = { [fantom.id]: fantomClient, [bsc.id]: bnbClient, [avalanche.id]: avalancheClient, + [gnosis.id]: gnosisClient, } as const; From 8ce278def3bebfc138bf3ab9b97415ba43e5a1e9 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 1 Nov 2023 00:26:49 +0100 Subject: [PATCH 84/94] fix: stop using fallback rpc --- src/utils/rpcClients.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/rpcClients.ts b/src/utils/rpcClients.ts index 3326f08..79a41bb 100644 --- a/src/utils/rpcClients.ts +++ b/src/utils/rpcClients.ts @@ -16,7 +16,7 @@ import { export const mainnetClient = createPublicClient({ chain: mainnet, - transport: fallback([http(), http(process.env.RPC_MAINNET)]), + transport: http(process.env.RPC_MAINNET), }); export const arbitrumClient = createPublicClient({ From 3a31ac6bb68af58888d723868e98770b4d69363b Mon Sep 17 00:00:00 2001 From: sakulstra Date: Fri, 3 Nov 2023 15:11:15 +0100 Subject: [PATCH 85/94] fix: update payloadId undefined check --- .env.example | 2 ++ src/commands/fork.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 3ffa05f..fc3c2a8 100644 --- a/.env.example +++ b/.env.example @@ -7,6 +7,8 @@ RPC_POLYGON= RPC_OPTIMISM= RPC_BASE= RPC_GOERLI= +RPC_BNB= +RPC_GNOSIS= TENDERLY_ACCESS_TOKEN= TENDERLY_PROJECT_SLUG= diff --git a/src/commands/fork.ts b/src/commands/fork.ts index 7f0f32c..b494755 100644 --- a/src/commands/fork.ts +++ b/src/commands/fork.ts @@ -32,7 +32,7 @@ export function addCommand(program: Command) { } else if (options.proposalId) { return `${unix}-proposalId-${options.proposalId}`; } else if (options.payloadId) { - return `${unix}-payloadAddress-${options.payloadId}`; + return `${unix}-payloadId-${options.payloadId}`; } return 'vanilla-fork'; } @@ -50,7 +50,7 @@ export function addCommand(program: Command) { blockNumber: forkConfig.blockNumber || payload.block_number, }); await tenderly.unwrapAndExecuteSimulationPayloadOnFork(fork, payload); - } else if (payloadId) { + } else if (payloadId != undefined) { if (!payloadsControllerAddress) throw new Error('you need to provide a payloadsController'); const payloadsController = getPayloadsController( payloadsControllerAddress as Hex, From 3d181352b83e3e6d30577ea5267cbee639ffdf9e Mon Sep 17 00:00:00 2001 From: sakulstra Date: Fri, 3 Nov 2023 15:56:10 +0100 Subject: [PATCH 86/94] fix: update deps --- package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index f985935..5a1e981 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "access": "public" }, "dependencies": { - "@bgd-labs/aave-address-book": "2.7.0", + "@bgd-labs/aave-address-book": "2.10.0", "@commander-js/extra-typings": "^11.1.0", "@inquirer/prompts": "^3.2.0", "bs58": "^5.0.0", @@ -65,7 +65,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.16.6", + "viem": "^1.18.4", "zod": "^3.22.4" } } diff --git a/yarn.lock b/yarn.lock index 79cdff0..deed881 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,10 +33,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@bgd-labs/aave-address-book@2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.7.0.tgz#ae26abb1a340fe795b9a2febd87f842c2ed06a99" - integrity sha512-TYErogNQIecHnnr7NXxGSnr1d/QuXNP9o5L8wRzx0+GIJiCi7Dmy9dlJxQO/nEky/Nq512l09xYKjRVnTz37Tg== +"@bgd-labs/aave-address-book@2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.10.0.tgz#19873ec0edf9ee1f1a5539162e6092b0a2b2c4b4" + integrity sha512-DVglkDCYUf7etb6mnCziIY2HPgap4X3AnC/1tC0ZqpXFrhO0lQzWBiMeWy20r1x/b81iHMQa02ULaco3LhdeVw== "@commander-js/extra-typings@^11.1.0": version "11.1.0" @@ -2530,10 +2530,10 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.16.6: - version "1.16.6" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.16.6.tgz#78118c9269506a59e2bc4deab13f1646e113d3fc" - integrity sha512-jcWcFQ+xzIfDwexwPJRvCuCRJKEkK9iHTStG7mpU5MmuSBpACs4nATBDyXNFtUiyYTFzLlVEwWkt68K0nCSImg== +viem@^1.18.4: + version "1.18.4" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.18.4.tgz#2bb17c6e7c4082f06cd8a6ed8a34eedf6e4a3bc9" + integrity sha512-im+y30k+IGT6VtfD/q1V0RX5PaiHPsFTHkKqvTjTqV+ZT8RgJXzOGPXr5E0uPIm2cbJAJp6A9nR9BCHY7BKR2Q== dependencies: "@adraffy/ens-normalize" "1.9.4" "@noble/curves" "1.2.0" From 9bfce3afa7ef62b352e4cfead399739b0b61b790 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Fri, 3 Nov 2023 16:00:14 +0100 Subject: [PATCH 87/94] fix: add some more logs --- src/utils/logs.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/logs.ts b/src/utils/logs.ts index 04fc5b7..b09fdd4 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -58,6 +58,8 @@ export async function getLogs( ); writeJSONCache(filePath, fileName, combinedCache); return combinedCache; + } else { + logInfo(client.chain?.name!, 'no new logs found'); } return cache; } @@ -74,6 +76,7 @@ export async function getPastLogsRecursive< toBlock: bigint, filterFn: (from: bigint, to?: bigint) => Promise['filter']> ): Promise> { + logInfo(client.chain?.name!, `looking for logs between ${fromBlock} to ${toBlock}`); if (fromBlock <= toBlock) { try { return await client.getFilterLogs({ From c92485faf7d387248a66a6cebf7048f9ef5d244e Mon Sep 17 00:00:00 2001 From: sakulstra Date: Fri, 3 Nov 2023 16:07:14 +0100 Subject: [PATCH 88/94] fix: update test --- .env.example | 2 +- src/utils/logs.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index fc3c2a8..c72b2c7 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ PINATA_KEY= PINATA_SECRET= -RPC_MAINNET= +RPC_MAINNET=https://eth.llamarpc.com RPC_ARBITRUM= RPC_POLYGON= RPC_OPTIMISM= diff --git a/src/utils/logs.spec.ts b/src/utils/logs.spec.ts index ab270c5..e9b438c 100644 --- a/src/utils/logs.spec.ts +++ b/src/utils/logs.spec.ts @@ -3,7 +3,7 @@ import { findContractDeploymentBlock } from './logs'; import { GovernanceV3Ethereum } from '@bgd-labs/aave-address-book'; import { mainnetClient } from './rpcClients'; -describe('logs', () => { +describe.skip('logs', () => { it( 'findContractDeploymentBlock', async () => { From 921c91d53fb751e8620bac7d5310d206e8485e74 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Fri, 3 Nov 2023 21:33:22 +0100 Subject: [PATCH 89/94] fix: use logs instead of filters --- src/govv3/governance.ts | 135 ++++++++++---------------------- src/govv3/payloadsController.ts | 73 ++++++++--------- src/utils/logs.ts | 54 ++++++------- 3 files changed, 101 insertions(+), 161 deletions(-) diff --git a/src/govv3/governance.ts b/src/govv3/governance.ts index b7aaada..5c20d16 100644 --- a/src/govv3/governance.ts +++ b/src/govv3/governance.ts @@ -6,11 +6,12 @@ import { WalletClient, encodeFunctionData, fromHex, + getAbiItem, getContract, toHex, } from 'viem'; import merge from 'deepmerge'; -import { FilterLogWithTimestamp, getLogs } from '../utils/logs'; +import { LogWithTimestamp, getLogs } from '../utils/logs'; import { AaveSafetyModule, AaveV3Ethereum, @@ -29,13 +30,21 @@ import { VOTING_SLOTS, WAREHOUSE_SLOTS, getAccountRPL, getProof } from './proofs import { readJSONCache, writeJSONCache } from '../utils/cache'; import { logInfo } from '../utils/logger'; import { GetProofReturnType } from 'viem/_types/actions/public/getProof'; +import type { ExtractAbiEvent } from 'abitype'; -type CreatedLog = FilterLogWithTimestamp; -type QueuedLog = FilterLogWithTimestamp; -type CanceledLog = FilterLogWithTimestamp; -type ExecutedLog = FilterLogWithTimestamp; -type PayloadSentLog = FilterLogWithTimestamp; -type VotingActivatedLog = FilterLogWithTimestamp; +type CreatedEvent = ExtractAbiEvent; +type QueuedEvent = ExtractAbiEvent; +type CanceledEvent = ExtractAbiEvent; +type ExecutedEvent = ExtractAbiEvent; +type PayloadSentEvent = ExtractAbiEvent; +type VotingActivatedEvent = ExtractAbiEvent; + +type CreatedLog = LogWithTimestamp; +type QueuedLog = LogWithTimestamp; +type CanceledLog = LogWithTimestamp; +type ExecutedLog = LogWithTimestamp; +type PayloadSentLog = LogWithTimestamp; +type VotingActivatedLog = LogWithTimestamp; export enum ProposalState { Null, // proposal does not exists @@ -54,13 +63,13 @@ function isStateFinal(state: ProposalState) { export interface Governance { governanceContract: GetContractReturnType; - cacheLogs: () => Promise<{ - createdLogs: Array; - queuedLogs: Array; - executedLogs: Array; - payloadSentLogs: Array; - votingActivatedLogs: Array; - canceledLogs: Array; + cacheLogs: (searchStartBlock?: bigint) => Promise<{ + createdLogs: CreatedLog[]; + queuedLogs: QueuedLog[]; + executedLogs: ExecutedLog[]; + payloadSentLogs: PayloadSentLog[]; + votingActivatedLogs: VotingActivatedLog[]; + canceledLogs: CanceledLog[]; }>; /** * Thin caching wrapper on top of getProposal. @@ -183,86 +192,28 @@ export const getGovernance = ({ return { governanceContract, - async cacheLogs() { - const createdLogs = await getLogs( - publicClient, - (fromBlock, toBlock) => { - return governanceContract.createEventFilter.ProposalCreated( - {}, - { - fromBlock: fromBlock, - toBlock, - } - ); - }, - address - ); - const queuedLogs = await getLogs( - publicClient, - (fromBlock, toBlock) => { - return governanceContract.createEventFilter.ProposalQueued( - {}, - { - fromBlock: fromBlock, - toBlock, - } - ); - }, - address - ); - const executedLogs = await getLogs( - publicClient, - (fromBlock, toBlock) => { - return governanceContract.createEventFilter.ProposalExecuted( - {}, - { - fromBlock: fromBlock, - toBlock, - } - ); - }, - address - ); - const payloadSentLogs = await getLogs( - publicClient, - (fromBlock, toBlock) => { - return governanceContract.createEventFilter.PayloadSent( - {}, - { - fromBlock: fromBlock, - toBlock, - } - ); - }, - address - ); - const votingActivatedLogs = await getLogs( - publicClient, - (fromBlock, toBlock) => { - return governanceContract.createEventFilter.VotingActivated( - {}, - { - fromBlock: fromBlock, - toBlock, - } - ); - }, - address - ); - const canceledLogs = await getLogs( + async cacheLogs(searchStartBlock) { + const logs = await getLogs( publicClient, - (fromBlock, toBlock) => { - return governanceContract.createEventFilter.ProposalCanceled( - {}, - { - fromBlock: fromBlock, - toBlock, - } - ); - }, - address + [ + getAbiItem({ abi: IGovernanceCore_ABI, name: 'ProposalCreated' }), + getAbiItem({ abi: IGovernanceCore_ABI, name: 'ProposalQueued' }), + getAbiItem({ abi: IGovernanceCore_ABI, name: 'ProposalExecuted' }), + getAbiItem({ abi: IGovernanceCore_ABI, name: 'PayloadSent' }), + getAbiItem({ abi: IGovernanceCore_ABI, name: 'VotingActivated' }), + getAbiItem({ abi: IGovernanceCore_ABI, name: 'ProposalCanceled' }), + ], + address, + searchStartBlock ); - return { createdLogs, queuedLogs, executedLogs, payloadSentLogs, votingActivatedLogs, canceledLogs }; + const createdLogs = logs.filter((log) => log.eventName === 'ProposalCreated'); + const queuedLogs = logs.filter((log) => log.eventName === 'ProposalQueued'); + const executedLogs = logs.filter((log) => log.eventName === 'ProposalExecuted'); + const payloadSentLogs = logs.filter((log) => log.eventName === 'PayloadSent'); + const votingActivatedLogs = logs.filter((log) => log.eventName === 'VotingActivated'); + const canceledLogs = logs.filter((log) => log.eventName === 'ProposalCanceled'); + + return { createdLogs, queuedLogs, executedLogs, payloadSentLogs, votingActivatedLogs, canceledLogs } as any; }, getProposal, async getProposalAndLogs(proposalId, logs) { diff --git a/src/govv3/payloadsController.ts b/src/govv3/payloadsController.ts index 29b5715..6af1ed7 100644 --- a/src/govv3/payloadsController.ts +++ b/src/govv3/payloadsController.ts @@ -5,17 +5,23 @@ import { PublicClient, encodeFunctionData, encodePacked, + getAbiItem, getContract, } from 'viem'; -import { FilterLogWithTimestamp, getLogs } from '../utils/logs'; +import { LogWithTimestamp, getLogs } from '../utils/logs'; import { TenderlyRequest, tenderly, TenderlySimulationResponse } from '../utils/tenderlyClient'; import { EOA } from '../utils/constants'; import { getSolidityStorageSlotUint } from '../utils/storageSlots'; import { IPayloadsControllerCore_ABI } from '@bgd-labs/aave-address-book'; +import type { ExtractAbiEvent } from 'abitype'; -type PayloadCreatedLog = FilterLogWithTimestamp; -type PayloadQueuedLog = FilterLogWithTimestamp; -type PayloadExecutedLog = FilterLogWithTimestamp; +type PayloadCreatedEvent = ExtractAbiEvent; +type PayloadQueuedEvent = ExtractAbiEvent; +type PayloadExecutedEvent = ExtractAbiEvent; + +type PayloadCreatedLog = LogWithTimestamp; +type PayloadQueuedLog = LogWithTimestamp; +type PayloadExecutedLog = LogWithTimestamp; export enum PayloadState { None, @@ -29,10 +35,10 @@ export enum PayloadState { export interface PayloadsController { controllerContract: GetContractReturnType; // cache created / queued / Executed logs - cacheLogs: () => Promise<{ - createdLogs: Array; - queuedLogs: Array; - executedLogs: Array; + cacheLogs: (searchStartBlock?: bigint) => Promise<{ + createdLogs: PayloadCreatedLog[]; + queuedLogs: PayloadQueuedLog[]; + executedLogs: PayloadExecutedLog[]; }>; // executes an existing payload getPayload: ( @@ -95,41 +101,26 @@ export const getPayloadsController = (address: Hex, publicClient: PublicClient): return { controllerContract, - cacheLogs: async () => { - const createdLogs = await getLogs( + cacheLogs: async (searchStartBlock) => { + const logs = await getLogs( publicClient, - (fromBlock, toBlock) => { - return controllerContract.createEventFilter.PayloadCreated( - {}, - { - fromBlock: fromBlock, - toBlock: toBlock, - } - ); - }, - address - ); - const queuedLogs = await getLogs( - publicClient, - (fromBlock, toBlock) => { - return controllerContract.createEventFilter.PayloadQueued({ - fromBlock: fromBlock, - toBlock: toBlock, - }); - }, - address + [ + getAbiItem({ abi: IPayloadsControllerCore_ABI, name: 'PayloadCreated' }), + getAbiItem({ abi: IPayloadsControllerCore_ABI, name: 'PayloadQueued' }), + getAbiItem({ abi: IPayloadsControllerCore_ABI, name: 'PayloadExecuted' }), + ], + address, + searchStartBlock ); - const executedLogs = await getLogs( - publicClient, - (fromBlock, toBlock) => { - return controllerContract.createEventFilter.PayloadExecuted({ - fromBlock: fromBlock, - toBlock: toBlock, - }); - }, - address - ); - return { createdLogs, queuedLogs, executedLogs }; + const createdLogs = logs.filter((log) => log.eventName === 'PayloadCreated') as PayloadCreatedLog[]; + const queuedLogs = logs.filter((log) => log.eventName === 'PayloadQueued') as PayloadQueuedLog[]; + const executedLogs = logs.filter((log) => log.eventName === 'PayloadQueued') as PayloadExecutedLog[]; + + return { + createdLogs, + queuedLogs, + executedLogs, + }; }, getPayload: async (id, logs) => { const createdLog = logs.createdLogs.find((l) => l.args.payloadId === id)!; diff --git a/src/utils/logs.ts b/src/utils/logs.ts index b09fdd4..2462ef6 100644 --- a/src/utils/logs.ts +++ b/src/utils/logs.ts @@ -1,5 +1,5 @@ -import { Block, GetFilterLogsParameters, GetFilterLogsReturnType, Hex, PublicClient } from 'viem'; -import type { Abi } from 'abitype'; +import { GetLogsReturnType, Hex, Log, PublicClient } from 'viem'; +import type { Abi, AbiEvent } from 'abitype'; import { logInfo } from './logger'; import { readJSONCache, writeJSONCache } from './cache'; @@ -7,9 +7,12 @@ type ArrayElement = ArrayType extends read ? ElementType : never; -export type FilterLogWithTimestamp = ArrayElement< - GetFilterLogsReturnType -> & { timestamp: number }; +export type LogWithTimestamp< + TAbiEvent extends AbiEvent | undefined = undefined, + TAbiEvents extends readonly AbiEvent[] | readonly unknown[] | undefined = TAbiEvent extends AbiEvent + ? [TAbiEvent] + : undefined +> = ArrayElement> & { timestamp: number }; /** * Fetches the logs and stores them in a cache folder. @@ -17,25 +20,27 @@ export type FilterLogWithTimestamp * @param filter * @returns logs */ -export async function getLogs( +export async function getLogs( client: PublicClient, - filterFn: (from: bigint, to?: bigint) => Promise['filter']>, - address: Hex -): Promise>> { + events: TAbiEvents, + address: Hex, + searchStartBlock?: bigint +): Promise>> { const currentBlock = await client.getBlockNumber(); /** * need to specify range as some node prividers (e.g. default on base) throw range error on filter creation */ - const filter = await filterFn(0n, 1n); const filePath = client.chain!.id.toString(); - const fileName = filter.eventName!; + const fileName = address; // read stale cache if it exists - const cache: Array> = readJSONCache(filePath, fileName) || []; + const cache: Array> = readJSONCache(filePath, fileName) || []; const startBlock = cache.length > 0 ? BigInt(cache[cache.length - 1].blockNumber as bigint) + 1n + : searchStartBlock + ? searchStartBlock : (await findContractDeploymentBlock(client, 0n, currentBlock, address)) || 0n; - const logs = await getPastLogsRecursive(client, startBlock, currentBlock, filterFn); + const logs = await getPastLogsRecursive(client, startBlock, currentBlock, events, address); const newLogs = await Promise.all( logs .filter( @@ -52,10 +57,7 @@ export async function getLogs( ? Number(a.blockNumber) - Number(b.blockNumber) : Number(a.logIndex) - Number(b.logIndex) ); - logInfo( - client.chain?.name!, - `Store ${newLogs.length} logs for event: ${filter.eventName} on chainId: ${client.chain!.id}` - ); + logInfo(client.chain?.name!, `Store ${newLogs.length} logs for event: ${address} on chainId: ${client.chain!.id}`); writeJSONCache(filePath, fileName, combinedCache); return combinedCache; } else { @@ -67,25 +69,21 @@ export async function getLogs( /** * fetches logs recursively */ -export async function getPastLogsRecursive< - TAbi extends Abi | readonly unknown[], - TEventName extends string | undefined ->( +export async function getPastLogsRecursive( client: PublicClient, fromBlock: bigint, toBlock: bigint, - filterFn: (from: bigint, to?: bigint) => Promise['filter']> -): Promise> { + events: TAbiEvents, + address: Hex +): Promise> { logInfo(client.chain?.name!, `looking for logs between ${fromBlock} to ${toBlock}`); if (fromBlock <= toBlock) { try { - return await client.getFilterLogs({ - filter: await filterFn(fromBlock, toBlock), - }); + return await client.getLogs({ fromBlock, toBlock, events, address }); } catch (error) { const midBlock = BigInt(fromBlock + toBlock) >> BigInt(1); - const arr1 = await getPastLogsRecursive(client, fromBlock, midBlock, filterFn); - const arr2 = await getPastLogsRecursive(client, midBlock + BigInt(1), toBlock, filterFn); + const arr1 = await getPastLogsRecursive(client, fromBlock, midBlock, events, address); + const arr2 = await getPastLogsRecursive(client, midBlock + BigInt(1), toBlock, events, address); return [...arr1, ...arr2]; } } From 5219ac6aa103c1213e50ba8849ae134266afbd6c Mon Sep 17 00:00:00 2001 From: sakulstra Date: Mon, 6 Nov 2023 09:52:20 +0100 Subject: [PATCH 90/94] feat: readable dates --- src/govv3/generatePayloadReport.ts | 35 +++++++++++++++++------------ src/govv3/generateProposalReport.ts | 16 +++++++++---- src/govv3/utils/markdownUtils.ts | 4 ++++ 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/govv3/generatePayloadReport.ts b/src/govv3/generatePayloadReport.ts index 0218a58..1dbbbe4 100644 --- a/src/govv3/generatePayloadReport.ts +++ b/src/govv3/generatePayloadReport.ts @@ -1,12 +1,8 @@ -import { Hex, PublicClient, getAddress } from 'viem'; -import { StateDiff, TenderlySimulationResponse } from '../utils/tenderlyClient'; -import { PayloadsController } from './payloadsController'; -import { tenderlyDeepDiff } from './utils/tenderlyDeepDiff'; -import { interpretStateChange } from './utils/stateDiffInterpreter'; -import { getContractName } from './utils/solidityUtils'; -import { boolToMarkdown, renderCheckResult, toTxLink } from './utils/markdownUtils'; +import { PublicClient } from 'viem'; +import { TenderlySimulationResponse } from '../utils/tenderlyClient'; +import { PayloadsController, getPayloadsController } from './payloadsController'; +import { renderCheckResult, renderUnixTime, toTxLink } from './utils/markdownUtils'; import { checkTargetsNoSelfdestruct, checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; -import { CheckResult, ProposalCheck } from './checks/types'; import { checkLogs } from './checks/logs'; import { checkTargetsVerifiedEtherscan, checkTouchedContractsVerifiedEtherscan } from './checks/targetsVerified'; import { checkStateChanges } from './checks/state'; @@ -21,19 +17,30 @@ type GenerateReportRequest = { export async function generateReport({ payloadId, payloadInfo, simulation, publicClient }: GenerateReportRequest) { const { payload, executedLog, queuedLog, createdLog } = payloadInfo; // generate file header - let report = `## Payload ${payloadId} on ${simulation.simulation.network_id} + let report = `## Payload ${payloadId} on ${publicClient.chain!.name} - creator: ${payload.creator} - maximumAccessLevelRequired: ${payload.maximumAccessLevelRequired} - state: ${payload.state} - actions: ${JSON.stringify(payload.actions, (key, value) => (typeof value === 'bigint' ? value.toString() : value))} -- createdAt: [${payload.createdAt}](${toTxLink(createdLog.transactionHash, false, publicClient)})\n`; +- createdAt: [${renderUnixTime(payload.createdAt)}](${toTxLink(createdLog.transactionHash, false, publicClient)})\n`; if (queuedLog) { - report += `- queuedAt: [${payload.queuedAt}](${toTxLink(queuedLog.transactionHash, false, publicClient)})\n`; - } - if (executedLog) { - report += `- executedAt: [${payload.executedAt}](${toTxLink(executedLog.transactionHash, false, publicClient)})\n`; + report += `- queuedAt: [${renderUnixTime(payload.queuedAt)}](${toTxLink( + queuedLog.transactionHash, + false, + publicClient + )})\n`; + if (executedLog) { + report += `- executedAt: [${renderUnixTime(payload.executedAt)}](${toTxLink( + executedLog.transactionHash, + false, + publicClient + )})\n`; + } else { + report += `- earliest execution at: ${renderUnixTime(payload.queuedAt + 60 * 60 * 24)}\n`; + } } + report += '\n'; const checks = [ diff --git a/src/govv3/generateProposalReport.ts b/src/govv3/generateProposalReport.ts index 500fe37..d3483a2 100644 --- a/src/govv3/generateProposalReport.ts +++ b/src/govv3/generateProposalReport.ts @@ -3,7 +3,7 @@ import { StateDiff, TenderlySimulationResponse } from '../utils/tenderlyClient'; import { tenderlyDeepDiff } from './utils/tenderlyDeepDiff'; import { interpretStateChange } from './utils/stateDiffInterpreter'; import { getContractName } from './utils/solidityUtils'; -import { boolToMarkdown, renderCheckResult, toTxLink } from './utils/markdownUtils'; +import { boolToMarkdown, renderCheckResult, renderUnixTime, toTxLink } from './utils/markdownUtils'; import { checkTouchedContractsNoSelfdestruct } from './checks/selfDestruct'; import { checkLogs } from './checks/logs'; import { checkTouchedContractsVerifiedEtherscan } from './checks/targetsVerified'; @@ -32,12 +32,20 @@ export async function generateProposalReport({ - creator: ${proposal.creator} - maximumAccessLevelRequired: ${proposal.accessLevel} - payloads: ${JSON.stringify(proposal.payloads, (key, value) => (typeof value === 'bigint' ? value.toString() : value))} -- createdAt: [${proposal.creationTime}](${toTxLink(createdLog.transactionHash, false, publicClient)})\n`; +- createdAt: [${renderUnixTime(proposal.creationTime)}](${toTxLink( + createdLog.transactionHash, + false, + publicClient + )})\n`; if (queuedLog) { - report += `- queuedAt: [${proposal.queuingTime}](${toTxLink(queuedLog.transactionHash, false, publicClient)})\n`; + report += `- queuedAt: [${renderUnixTime(proposal.queuingTime)}](${toTxLink( + queuedLog.transactionHash, + false, + publicClient + )})\n`; } if (executedLog) { - report += `- executedAt: [${executedLog.timestamp}](${toTxLink( + report += `- executedAt: [${renderUnixTime(executedLog.timestamp)}](${toTxLink( executedLog.transactionHash, false, publicClient diff --git a/src/govv3/utils/markdownUtils.ts b/src/govv3/utils/markdownUtils.ts index c0a05a7..7e64ec4 100644 --- a/src/govv3/utils/markdownUtils.ts +++ b/src/govv3/utils/markdownUtils.ts @@ -41,3 +41,7 @@ export function renderCheckResult(check: { name: string }, result: CheckResult) if (result.info.length) response += `#### Info\n\n${result.info.join('\n')}\n\n`; return response; } + +export function renderUnixTime(time: number) { + return new Date(time * 1000).toLocaleString('en-GB', { timeZone: 'UTC' }); +} From 494450535b68acb7d2f52ced7142385480782d43 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Mon, 6 Nov 2023 09:53:07 +0100 Subject: [PATCH 91/94] fix: fetch correct logs for executed --- src/govv3/payloadsController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/govv3/payloadsController.ts b/src/govv3/payloadsController.ts index 6af1ed7..a3b9829 100644 --- a/src/govv3/payloadsController.ts +++ b/src/govv3/payloadsController.ts @@ -114,7 +114,7 @@ export const getPayloadsController = (address: Hex, publicClient: PublicClient): ); const createdLogs = logs.filter((log) => log.eventName === 'PayloadCreated') as PayloadCreatedLog[]; const queuedLogs = logs.filter((log) => log.eventName === 'PayloadQueued') as PayloadQueuedLog[]; - const executedLogs = logs.filter((log) => log.eventName === 'PayloadQueued') as PayloadExecutedLog[]; + const executedLogs = logs.filter((log) => log.eventName === 'PayloadExecuted') as PayloadExecutedLog[]; return { createdLogs, From f56689e8207f52b5f183fbcda6e65475fe0b52ca Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 8 Nov 2023 12:30:14 +0100 Subject: [PATCH 92/94] fix: nicer errors --- package.json | 9 ++++----- src/commands/ipfsUpload.ts | 5 +++++ src/ipfs/aipValidation.ts | 13 ++++++++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 5a1e981..37f3c11 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,12 @@ }, "homepage": "https://github.com/bgd-labs/report-engine#readme", "devDependencies": { - "@types/node-fetch": "^2.6.4", - "@types/object-hash": "^3.0.3", - "@types/yargs": "^17.0.24", + "@types/node-fetch": "^2.6.9", + "@types/object-hash": "^3.0.6", "tsup": "^7.2.0", "tsx": "^3.14.0", "typescript": "^5.2.2", - "vitest": "^0.34.3" + "vitest": "^0.34.6" }, "type": "module", "main": "./dist/index.cjs", @@ -65,7 +64,7 @@ "json-bigint": "^1.0.0", "node-fetch": "^2.6.9", "object-hash": "^3.0.0", - "viem": "^1.18.4", + "viem": "^1.18.9", "zod": "^3.22.4" } } diff --git a/src/commands/ipfsUpload.ts b/src/commands/ipfsUpload.ts index 91ef45a..2c4ddaa 100644 --- a/src/commands/ipfsUpload.ts +++ b/src/commands/ipfsUpload.ts @@ -4,6 +4,7 @@ import Hash from 'ipfs-only-hash'; import bs58 from 'bs58'; import { validateAIPHeader } from '../ipfs/aipValidation'; import { Command } from '@commander-js/extra-typings'; +import { logError } from '../utils/logger'; // https://ethereum.stackexchange.com/questions/44506/ipfs-hash-algorithm async function getHash(data: string) { @@ -55,6 +56,10 @@ export function addCommand(program: Command) { .option('--verbose') .action(async (source, { upload, verbose }) => { const filePath = path.join(process.cwd(), source); + if (!fs.existsSync(filePath)) { + logError('Upload', `Cannot find file at: ${filePath}`); + throw new Error('FILE_NOT_FOUND'); + } const content = fs.readFileSync(filePath, 'utf8'); validateAIPHeader(content); diff --git a/src/ipfs/aipValidation.ts b/src/ipfs/aipValidation.ts index ef3c88b..dc62622 100644 --- a/src/ipfs/aipValidation.ts +++ b/src/ipfs/aipValidation.ts @@ -1,5 +1,6 @@ -import { z } from "zod"; -import matter from "gray-matter"; +import { ZodError, z } from 'zod'; +import matter from 'gray-matter'; +import { logError } from '../utils/logger'; const aipType = z.object({ discussions: z.string(), @@ -14,6 +15,12 @@ const aipType = z.object({ */ export function validateAIPHeader(content: string) { const fm = matter(content); - aipType.parse(fm.data); + try { + aipType.parse(fm.data); + } catch (e) { + logError('AIP', 'AIP validation failed'); + (e as ZodError).issues.map((issue) => logError(`AIP`, `${issue.path[0]} is ${issue.message}`)); + throw e; + } return fm.data.title; } From f740d85174cfb3908aebcce1898bb62fe433d641 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 8 Nov 2023 12:34:59 +0100 Subject: [PATCH 93/94] fix: better error messages --- src/ipfs/aipValidation.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ipfs/aipValidation.ts b/src/ipfs/aipValidation.ts index dc62622..4505fbf 100644 --- a/src/ipfs/aipValidation.ts +++ b/src/ipfs/aipValidation.ts @@ -19,7 +19,12 @@ export function validateAIPHeader(content: string) { aipType.parse(fm.data); } catch (e) { logError('AIP', 'AIP validation failed'); - (e as ZodError).issues.map((issue) => logError(`AIP`, `${issue.path[0]} is ${issue.message}`)); + (e as ZodError).issues.map((issue) => + logError( + `AIP`, + `On field ${issue.path[0]} received ${(issue as any).received} but expected ${(issue as any).expected}` + ) + ); throw e; } return fm.data.title; From 7d5b7abdd084469d28114e05441a55d06c469809 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Wed, 8 Nov 2023 12:36:55 +0100 Subject: [PATCH 94/94] feat: add yarn lock --- yarn.lock | 367 ++++++++++++++++-------------------------------------- 1 file changed, 107 insertions(+), 260 deletions(-) diff --git a/yarn.lock b/yarn.lock index deed881..b21e95a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -43,221 +43,111 @@ resolved "https://registry.yarnpkg.com/@commander-js/extra-typings/-/extra-typings-11.1.0.tgz#dd19fcb8cc6e33ede237fc1b7af96c70833d8f93" integrity sha512-GuvZ38d23H+7Tz2C9DhzCepivsOsky03s5NI+KCy7ke1FNUvsJ2oO47scQ9YaGGhgjgNW5OYYNSADmbjcSoIhw== -"@esbuild/android-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz#15a8e2b407d03989b899e325151dc2e96d19c620" - integrity sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA== - "@esbuild/android-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622" integrity sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ== -"@esbuild/android-arm@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.12.tgz#677a09297e1f4f37aba7b4fc4f31088b00484985" - integrity sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ== - "@esbuild/android-arm@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.20.tgz#fedb265bc3a589c84cc11f810804f234947c3682" integrity sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw== -"@esbuild/android-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.12.tgz#b292729eef4e0060ae1941f6a021c4d2542a3521" - integrity sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w== - "@esbuild/android-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.20.tgz#35cf419c4cfc8babe8893d296cd990e9e9f756f2" integrity sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg== -"@esbuild/darwin-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz#efa35318df931da05825894e1787b976d55adbe3" - integrity sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg== - "@esbuild/darwin-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz#08172cbeccf95fbc383399a7f39cfbddaeb0d7c1" integrity sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA== -"@esbuild/darwin-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz#e7b54bb3f6dc81aadfd0485cd1623c648157e64d" - integrity sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA== - "@esbuild/darwin-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz#d70d5790d8bf475556b67d0f8b7c5bdff053d85d" integrity sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ== -"@esbuild/freebsd-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz#99a18a8579d6299c449566fe91d9b6a54cf2a591" - integrity sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ== - "@esbuild/freebsd-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz#98755cd12707f93f210e2494d6a4b51b96977f54" integrity sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw== -"@esbuild/freebsd-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz#0e090190fede307fb4022f671791a50dd5121abd" - integrity sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw== - "@esbuild/freebsd-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz#c1eb2bff03915f87c29cece4c1a7fa1f423b066e" integrity sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ== -"@esbuild/linux-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz#7fe2a69f8a1a7153fa2b0f44aabcadb59475c7e0" - integrity sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg== - "@esbuild/linux-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz#bad4238bd8f4fc25b5a021280c770ab5fc3a02a0" integrity sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA== -"@esbuild/linux-arm@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz#b87c76ebf1fe03e01fd6bb5cfc2f3c5becd5ee93" - integrity sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA== - "@esbuild/linux-arm@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz#3e617c61f33508a27150ee417543c8ab5acc73b0" integrity sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg== -"@esbuild/linux-ia32@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz#9e9357090254524d32e6708883a47328f3037858" - integrity sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw== - "@esbuild/linux-ia32@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz#699391cccba9aee6019b7f9892eb99219f1570a7" integrity sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA== -"@esbuild/linux-loong64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz#9deb605f9e2c82f59412ddfefb4b6b96d54b5b5b" - integrity sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA== - "@esbuild/linux-loong64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz#e6fccb7aac178dd2ffb9860465ac89d7f23b977d" integrity sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg== -"@esbuild/linux-mips64el@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz#6ef170b974ddf5e6acdfa5b05f22b6e9dfd2b003" - integrity sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA== - "@esbuild/linux-mips64el@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz#eeff3a937de9c2310de30622a957ad1bd9183231" integrity sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ== -"@esbuild/linux-ppc64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz#1638d3d4acf1d34aaf37cf8908c2e1cefed16204" - integrity sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A== - "@esbuild/linux-ppc64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz#2f7156bde20b01527993e6881435ad79ba9599fb" integrity sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA== -"@esbuild/linux-riscv64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz#135b6e9270a8e2de2b9094bb21a287517df520ef" - integrity sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA== - "@esbuild/linux-riscv64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz#6628389f210123d8b4743045af8caa7d4ddfc7a6" integrity sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A== -"@esbuild/linux-s390x@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz#21e40830770c5d08368e300842bde382ce97d615" - integrity sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g== - "@esbuild/linux-s390x@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz#255e81fb289b101026131858ab99fba63dcf0071" integrity sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ== -"@esbuild/linux-x64@0.17.12": - version "0.17.12" - resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz" - integrity sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA== - "@esbuild/linux-x64@0.18.20": version "0.18.20" resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz" integrity sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w== -"@esbuild/netbsd-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz#c7c3b3017a4b938c76c35f66af529baf62eac527" - integrity sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg== - "@esbuild/netbsd-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz#30e8cd8a3dded63975e2df2438ca109601ebe0d1" integrity sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A== -"@esbuild/openbsd-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz#05d04217d980e049001afdbeacbb58d31bb5cefb" - integrity sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA== - "@esbuild/openbsd-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz#7812af31b205055874c8082ea9cf9ab0da6217ae" integrity sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg== -"@esbuild/sunos-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz#cf3862521600e4eb6c440ec3bad31ed40fb87ef3" - integrity sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg== - "@esbuild/sunos-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz#d5c275c3b4e73c9b0ecd38d1ca62c020f887ab9d" integrity sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ== -"@esbuild/win32-arm64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz#43dd7fb5be77bf12a1550355ab2b123efd60868e" - integrity sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg== - "@esbuild/win32-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz#73bc7f5a9f8a77805f357fab97f290d0e4820ac9" integrity sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg== -"@esbuild/win32-ia32@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz#9940963d0bff4ea3035a84e2b4c6e41c5e6296eb" - integrity sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng== - "@esbuild/win32-ia32@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz#ec93cbf0ef1085cc12e71e0d661d20569ff42102" integrity sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g== -"@esbuild/win32-x64@0.17.12": - version "0.17.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz#3a11d13e9a5b0c05db88991b234d8baba1f96487" - integrity sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw== - "@esbuild/win32-x64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d" @@ -556,13 +446,13 @@ dependencies: "@types/node" "*" -"@types/node-fetch@^2.6.4": - version "2.6.4" - resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== +"@types/node-fetch@^2.6.9": + version "2.6.9" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.9.tgz#15f529d247f1ede1824f7e7acdaa192d5f28071e" + integrity sha512-bQVlnMLFJ2d35DkPNjEPmd9ueO/rh5EiaZt2bhqiSarPjZIuIV6bPQVqcrEyvNo+AfTrRGVazle1tl597w3gfA== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.0" "@types/node@*": version "18.15.3" @@ -584,66 +474,54 @@ resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz" integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== -"@types/object-hash@^3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@types/object-hash/-/object-hash-3.0.3.tgz" - integrity sha512-Mb0SDIhjhBAz4/rDNU0cYcQR4lSJIwy+kFlm0whXLkx+o0pXwEszwyrWD6gXWumxVbAS6XZ9gXK82LR+Uk+cKQ== +"@types/object-hash@^3.0.6": + version "3.0.6" + resolved "https://registry.yarnpkg.com/@types/object-hash/-/object-hash-3.0.6.tgz#25c052428199d374ef723b7b0ed44b5bfe1b3029" + integrity sha512-fOBV8C1FIu2ELinoILQ+ApxcUKz4ngq+IWUYrxSGjXzzjUALijilampwkMgEtJ+h2njAW3pi853QpzNVCHB73w== "@types/wrap-ansi@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g== -"@types/yargs-parser@*": - version "21.0.0" - resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz" - integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== - -"@types/yargs@^17.0.24": - version "17.0.24" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz" - integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== - dependencies: - "@types/yargs-parser" "*" - -"@vitest/expect@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.34.3.tgz#576e1fd6a3a8b8b7a79a06477f3d450a77d67852" - integrity sha512-F8MTXZUYRBVsYL1uoIft1HHWhwDbSzwAU9Zgh8S6WFC3YgVb4AnFV2GXO3P5Em8FjEYaZtTnQYoNwwBrlOMXgg== +"@vitest/expect@0.34.6": + version "0.34.6" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.34.6.tgz#608a7b7a9aa3de0919db99b4cc087340a03ea77e" + integrity sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw== dependencies: - "@vitest/spy" "0.34.3" - "@vitest/utils" "0.34.3" - chai "^4.3.7" + "@vitest/spy" "0.34.6" + "@vitest/utils" "0.34.6" + chai "^4.3.10" -"@vitest/runner@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.34.3.tgz#ce09b777d133bbcf843e1a67f4a743365764e097" - integrity sha512-lYNq7N3vR57VMKMPLVvmJoiN4bqwzZ1euTW+XXYH5kzr3W/+xQG3b41xJn9ChJ3AhYOSoweu974S1V3qDcFESA== +"@vitest/runner@0.34.6": + version "0.34.6" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.34.6.tgz#6f43ca241fc96b2edf230db58bcde5b974b8dcaf" + integrity sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ== dependencies: - "@vitest/utils" "0.34.3" + "@vitest/utils" "0.34.6" p-limit "^4.0.0" pathe "^1.1.1" -"@vitest/snapshot@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-0.34.3.tgz#cb4767aa44711a1072bd2e06204b659275c4f0f2" - integrity sha512-QyPaE15DQwbnIBp/yNJ8lbvXTZxS00kRly0kfFgAD5EYmCbYcA+1EEyRalc93M0gosL/xHeg3lKAClIXYpmUiQ== +"@vitest/snapshot@0.34.6": + version "0.34.6" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-0.34.6.tgz#b4528cf683b60a3e8071cacbcb97d18b9d5e1d8b" + integrity sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w== dependencies: magic-string "^0.30.1" pathe "^1.1.1" pretty-format "^29.5.0" -"@vitest/spy@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.34.3.tgz#d4cf25e6ca9230991a0223ecd4ec2df30f0784ff" - integrity sha512-N1V0RFQ6AI7CPgzBq9kzjRdPIgThC340DGjdKdPSE8r86aUSmeliTUgkTqLSgtEwWWsGfBQ+UetZWhK0BgJmkQ== +"@vitest/spy@0.34.6": + version "0.34.6" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.34.6.tgz#b5e8642a84aad12896c915bce9b3cc8cdaf821df" + integrity sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ== dependencies: tinyspy "^2.1.1" -"@vitest/utils@0.34.3": - version "0.34.3" - resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.34.3.tgz#6e243189a358b736b9fc0216e6b6979bc857e897" - integrity sha512-kiSnzLG6m/tiT0XEl4U2H8JDBjFtwVlaE8I3QfGiMFR0QvnRDfYfdP3YvTBWM/6iJDAyaPY6yVQiCTUc7ZzTHA== +"@vitest/utils@0.34.6": + version "0.34.6" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.34.6.tgz#38a0a7eedddb8e7291af09a2409cb8a189516968" + integrity sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A== dependencies: diff-sequences "^29.4.3" loupe "^2.3.6" @@ -840,18 +718,18 @@ camelcase@^5.3.1: resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -chai@^4.3.7: - version "4.3.7" - resolved "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz" - integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== +chai@^4.3.10: + version "4.3.10" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.10.tgz#d784cec635e3b7e2ffb66446a63b4e33bd390384" + integrity sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g== dependencies: assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^4.1.2" - get-func-name "^2.0.0" - loupe "^2.3.1" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" pathval "^1.1.1" - type-detect "^4.0.5" + type-detect "^4.0.8" chalk@^2.0.0: version "2.4.2" @@ -875,10 +753,12 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" - integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== +check-error@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" + integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== + dependencies: + get-func-name "^2.0.2" chokidar@^3.5.1: version "3.5.3" @@ -990,9 +870,9 @@ decamelize@^1.1.0, decamelize@^1.2.0: resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -deep-eql@^4.1.2: +deep-eql@^4.1.3: version "4.1.3" - resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== dependencies: type-detect "^4.0.0" @@ -1041,35 +921,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -esbuild@^0.17.5: - version "0.17.12" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.17.12.tgz" - integrity sha512-bX/zHl7Gn2CpQwcMtRogTTBf9l1nl+H6R8nUbjk+RuKqAE3+8FDulLA+pHvX7aA7Xe07Iwa+CWvy9I8Y2qqPKQ== - optionalDependencies: - "@esbuild/android-arm" "0.17.12" - "@esbuild/android-arm64" "0.17.12" - "@esbuild/android-x64" "0.17.12" - "@esbuild/darwin-arm64" "0.17.12" - "@esbuild/darwin-x64" "0.17.12" - "@esbuild/freebsd-arm64" "0.17.12" - "@esbuild/freebsd-x64" "0.17.12" - "@esbuild/linux-arm" "0.17.12" - "@esbuild/linux-arm64" "0.17.12" - "@esbuild/linux-ia32" "0.17.12" - "@esbuild/linux-loong64" "0.17.12" - "@esbuild/linux-mips64el" "0.17.12" - "@esbuild/linux-ppc64" "0.17.12" - "@esbuild/linux-riscv64" "0.17.12" - "@esbuild/linux-s390x" "0.17.12" - "@esbuild/linux-x64" "0.17.12" - "@esbuild/netbsd-x64" "0.17.12" - "@esbuild/openbsd-x64" "0.17.12" - "@esbuild/sunos-x64" "0.17.12" - "@esbuild/win32-arm64" "0.17.12" - "@esbuild/win32-ia32" "0.17.12" - "@esbuild/win32-x64" "0.17.12" - -esbuild@^0.18.2, esbuild@~0.18.20: +esbuild@^0.18.10, esbuild@^0.18.2, esbuild@~0.18.20: version "0.18.20" resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz" integrity sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA== @@ -1178,10 +1030,10 @@ find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -1212,6 +1064,11 @@ get-func-name@^2.0.0: resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== +get-func-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== + get-stream@^6.0.0: version "6.0.1" resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" @@ -1424,13 +1281,6 @@ is-core-module@^2.11.0, is-core-module@^2.5.0: dependencies: has "^1.0.3" -is-core-module@^2.9.0: - version "2.11.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== - dependencies: - has "^1.0.3" - is-extendable@^0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" @@ -1587,7 +1437,7 @@ long@^4.0.0: resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== -loupe@^2.3.1, loupe@^2.3.6: +loupe@^2.3.6: version "2.3.6" resolved "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz" integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== @@ -1789,10 +1639,10 @@ mz@^2.7.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nanoid@^3.3.4: - version "3.3.4" - resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz" - integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== +nanoid@^3.3.6: + version "3.3.7" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" + integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== node-fetch@^2.6.1: version "2.6.11" @@ -1977,12 +1827,12 @@ postcss-load-config@^4.0.1: lilconfig "^2.0.5" yaml "^2.1.1" -postcss@^8.4.21: - version "8.4.21" - resolved "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz" - integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== +postcss@^8.4.27: + version "8.4.31" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d" + integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ== dependencies: - nanoid "^3.3.4" + nanoid "^3.3.6" picocolors "^1.0.0" source-map-js "^1.0.2" @@ -2108,27 +1958,25 @@ resolve@^1.10.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -resolve@^1.22.1: - version "1.22.1" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== - dependencies: - is-core-module "^2.9.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - reusify@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rollup@^3.18.0, rollup@^3.2.5: +rollup@^3.2.5: version "3.20.0" resolved "https://registry.npmjs.org/rollup/-/rollup-3.20.0.tgz" integrity sha512-YsIfrk80NqUDrxrjWPXUa7PWvAfegZEXHuPsEZg58fGCdjL1I9C1i/NaG+L+27kxxwkrG/QEDEQc8s/ynXWWGQ== optionalDependencies: fsevents "~2.3.2" +rollup@^3.27.1: + version "3.29.4" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.4.tgz#4d70c0f9834146df8705bfb69a9a19c9e1109981" + integrity sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw== + optionalDependencies: + fsevents "~2.3.2" + run-async@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-3.0.0.tgz#42a432f6d76c689522058984384df28be379daad" @@ -2458,7 +2306,7 @@ tsx@^3.14.0: optionalDependencies: fsevents "~2.3.3" -type-detect@^4.0.0, type-detect@^4.0.5: +type-detect@^4.0.0, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== @@ -2530,10 +2378,10 @@ varint@^6.0.0: resolved "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -viem@^1.18.4: - version "1.18.4" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.18.4.tgz#2bb17c6e7c4082f06cd8a6ed8a34eedf6e4a3bc9" - integrity sha512-im+y30k+IGT6VtfD/q1V0RX5PaiHPsFTHkKqvTjTqV+ZT8RgJXzOGPXr5E0uPIm2cbJAJp6A9nR9BCHY7BKR2Q== +viem@^1.18.9: + version "1.18.9" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.18.9.tgz#8be8fe3148b1c6c3bccc853001df98f91a8aeb30" + integrity sha512-eAXtoTwAFA3YEgjTYMb5ZTQrDC0UPx5qyZ4sv90TirVKepcM9mBPksTkC1SSWya0UdxhBmhEBL/CiYMjmGCTWg== dependencies: "@adraffy/ens-normalize" "1.9.4" "@noble/curves" "1.2.0" @@ -2544,47 +2392,46 @@ viem@^1.18.4: isows "1.0.3" ws "8.13.0" -vite-node@0.34.3: - version "0.34.3" - resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.34.3.tgz#de134fe38bc1555ac8ab5e489d7df6159a3e1a4c" - integrity sha512-+0TzJf1g0tYXj6tR2vEyiA42OPq68QkRZCu/ERSo2PtsDJfBpDyEfuKbRvLmZqi/CgC7SCBtyC+WjTGNMRIaig== +vite-node@0.34.6: + version "0.34.6" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.34.6.tgz#34d19795de1498562bf21541a58edcd106328a17" + integrity sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA== dependencies: cac "^6.7.14" debug "^4.3.4" mlly "^1.4.0" pathe "^1.1.1" picocolors "^1.0.0" - vite "^3.0.0 || ^4.0.0" + vite "^3.0.0 || ^4.0.0 || ^5.0.0-0" -"vite@^3.0.0 || ^4.0.0": - version "4.2.0" - resolved "https://registry.npmjs.org/vite/-/vite-4.2.0.tgz" - integrity sha512-AbDTyzzwuKoRtMIRLGNxhLRuv1FpRgdIw+1y6AQG73Q5+vtecmvzKo/yk8X/vrHDpETRTx01ABijqUHIzBXi0g== +"vite@^3.0.0 || ^4.0.0 || ^5.0.0-0", "vite@^3.1.0 || ^4.0.0 || ^5.0.0-0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.0.tgz#ec406295b4167ac3bc23e26f9c8ff559287cff26" + integrity sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw== dependencies: - esbuild "^0.17.5" - postcss "^8.4.21" - resolve "^1.22.1" - rollup "^3.18.0" + esbuild "^0.18.10" + postcss "^8.4.27" + rollup "^3.27.1" optionalDependencies: fsevents "~2.3.2" -vitest@^0.34.3: - version "0.34.3" - resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.34.3.tgz#863d61c133d01b16e49fd52d380c09fa5ac03188" - integrity sha512-7+VA5Iw4S3USYk+qwPxHl8plCMhA5rtfwMjgoQXMT7rO5ldWcdsdo3U1QD289JgglGK4WeOzgoLTsGFu6VISyQ== +vitest@^0.34.6: + version "0.34.6" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.34.6.tgz#44880feeeef493c04b7f795ed268f24a543250d7" + integrity sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q== dependencies: "@types/chai" "^4.3.5" "@types/chai-subset" "^1.3.3" "@types/node" "*" - "@vitest/expect" "0.34.3" - "@vitest/runner" "0.34.3" - "@vitest/snapshot" "0.34.3" - "@vitest/spy" "0.34.3" - "@vitest/utils" "0.34.3" + "@vitest/expect" "0.34.6" + "@vitest/runner" "0.34.6" + "@vitest/snapshot" "0.34.6" + "@vitest/spy" "0.34.6" + "@vitest/utils" "0.34.6" acorn "^8.9.0" acorn-walk "^8.2.0" cac "^6.7.14" - chai "^4.3.7" + chai "^4.3.10" debug "^4.3.4" local-pkg "^0.4.3" magic-string "^0.30.1" @@ -2594,8 +2441,8 @@ vitest@^0.34.3: strip-literal "^1.0.1" tinybench "^2.5.0" tinypool "^0.7.0" - vite "^3.0.0 || ^4.0.0" - vite-node "0.34.3" + vite "^3.1.0 || ^4.0.0 || ^5.0.0-0" + vite-node "0.34.6" why-is-node-running "^2.2.2" webidl-conversions@^3.0.0: