From 62b79975ad2e55f96f704cadc7c00eb10cec3cd5 Mon Sep 17 00:00:00 2001 From: therealemjy Date: Fri, 22 Nov 2024 13:00:14 +0100 Subject: [PATCH] feat: add support for omnichain proposals --- .changeset/brown-birds-arrive.md | 5 + .changeset/good-terms-fail.md | 5 + .changeset/honest-items-lick.md | 5 + .changeset/hungry-vans-exist.md | 5 + .changeset/perfect-spoons-sin.md | 5 + .changeset/rare-camels-switch.md | 5 + .changeset/thin-hairs-vanish.md | 5 + .changeset/unlucky-planets-swim.md | 5 + apps/evm/.env.template | 2 +- apps/evm/.graphclientrc.yml | 0 apps/evm/CHANGELOG.md | 4 +- apps/evm/package.json | 14 +- apps/evm/src/__mocks__/api/proposals.json | 265 --- .../src/__mocks__/models/proposalPreviews.ts | 17 - apps/evm/src/__mocks__/models/proposals.ts | 248 ++- ...proposalCommands.ts => remoteProposals.ts} | 103 +- .../src/__mocks__/subgraph/bscProposals.json | 1248 ++++++++++++ .../__mocks__/subgraph/nonBscProposals.json | 122 ++ .../__mocks__/subgraph/proposalPreviews.json | 238 --- apps/evm/src/clients/api/__mocks__/index.ts | 29 +- apps/evm/src/clients/api/index.ts | 7 +- .../cancelProposal/useCancelProposal.ts | 2 +- .../createProposal/useCreateProposal.ts | 2 +- .../mutations/executeProposal/index.spec.ts | 6 +- .../api/mutations/executeProposal/index.ts | 13 +- .../executeProposal/useExecuteProposal.ts | 37 +- .../queueProposal/useQueueProposal.ts | 2 +- .../clients/api/mutations/vote/useCastVote.ts | 24 +- .../mutations/vote/useCastVoteWithReason.ts | 12 +- .../__snapshots__/index.spec.ts.snap | 183 +- .../getProposal/__tests__/index.spec.ts | 52 +- .../clients/api/queries/getProposal/index.ts | 71 +- .../clients/api/queries/getProposal/types.ts | 57 - .../__snapshots__/index.spec.ts.snap | 192 ++ .../__tests__/index.spec.ts | 49 + .../getProposal/useGetCachedProposal/index.ts | 24 + .../api/queries/getProposal/useGetProposal.ts | 79 +- .../__snapshots__/index.spec.ts.snap | 424 ----- .../__snapshots__/index.spec.ts.snap | 1603 ++++++++++++++++ .../__tests__/index.spec.ts | 22 +- .../index.ts | 80 +- .../useGetProposals.ts} | 64 +- .../__snapshots__/index.spec.ts.snap | 60 +- .../getVoterHistory}/formatToProposal.ts | 16 +- .../formatVoterHistoryResponse.ts | 2 +- .../api/queries/getVoterHistory/types.ts | 51 +- .../__snapshots__/index.spec.ts.snap | 21 +- .../api/queries/getVoters/formatToVoters.ts | 17 +- .../getXvsBridgeMintStatus/index.spec.ts | 6 +- .../queries/getXvsBridgeMintStatus/index.ts | 10 +- .../useGetXvsBridgeMintStatus.ts | 6 +- .../src/clients/subgraph/__mocks__/index.ts | 17 +- apps/evm/src/clients/subgraph/gql/index.ts | 4 - apps/evm/src/clients/subgraph/index.ts | 8 +- .../getProposalPreviews.graphql | 38 - .../governance/getProposalPreviews/index.ts | 19 - .../fragments/bscProposal.graphql | 92 + .../getBscProposal/getBscProposal.graphql | 5 + .../governanceBsc/getBscProposal/index.ts | 22 + .../getBscProposals/getBscProposals.graphql | 9 + .../governanceBsc/getBscProposals/index.ts | 22 + .../fragments/nonBscProposal.graphql | 23 + .../getNonBscProposals.graphql | 5 + .../getNonBscProposals/index.ts | 22 + .../getIsolatedPoolParticipantsCount/index.ts | 2 +- .../__snapshots__/index.spec.ts.snap | 150 ++ .../__tests__/index.spec.ts | 12 + .../utilities/enrichRemoteProposals/index.ts | 58 + .../__snapshots__/index.spec.ts.snap | 144 ++ .../formatToProposal/__tests__/index.spec.ts | 24 + .../__snapshots__/index.spec.ts.snap | 20 + .../__tests__/index.spec.ts | 17 + .../formatToProposalActions/index.ts | 22 + .../__snapshots__/index.spec.ts.snap | 153 ++ .../__tests__/index.spec.ts | 110 ++ .../__tests__/index.spec.ts | 127 ++ .../getRemoteProposalState/index.ts | 55 + .../formatToRemoteProposal/index.ts | 122 ++ .../utilities/formatToProposal/index.ts | 238 +++ .../__snapshots__/index.spec.ts.snap | 32 - .../__tests__/index.spec.ts | 22 - .../formatToProposalPreview/index.ts | 64 - .../LabeledProgressCircle/index.tsx | 30 + .../src/components/MarkdownViewer/index.tsx | 14 +- .../src/components/ProgressCircle/index.tsx | 4 +- apps/evm/src/components/index.ts | 1 + apps/evm/src/config/codegen.ts | 22 +- apps/evm/src/config/index.ts | 4 +- apps/evm/src/constants/chainMetadata.ts | 26 +- apps/evm/src/constants/functionKey.ts | 2 +- apps/evm/src/constants/layerZero.ts | 10 + .../containers/ChainExplorerLink/index.tsx | 4 +- .../ConnectWallet/Container/index.tsx | 7 + .../ConnectWallet/__tests__/index.spec.tsx | 91 + .../src/containers/ConnectWallet/index.tsx | 83 +- .../src/containers/ConnectWallet/styles.ts | 15 - .../src/containers/Layout/Footer/index.tsx | 4 +- .../evm/src/containers/ProposalCard/styles.ts | 4 +- .../ReadableActionSignature/index.tsx | 10 +- .../useFormatTo/__tests__/index.spec.tsx | 9 - .../__tests__/index.spec.tsx | 7 - .../__tests__/index.spec.tsx | 13 +- .../__tests__/index.spec.ts | 19 +- .../src/hooks/useIsFeatureEnabled/index.tsx | 8 +- apps/evm/src/libs/contracts/config/index.ts | 41 +- .../libs/errors/importProposalErrorPhrases.ts | 1 + .../libs/translations/translations/en.json | 44 +- apps/evm/src/libs/wallet/index.ts | 3 + .../ProposalPreview/index.tsx | 2 + .../Status/Indicator/index.tsx | 43 + .../GovernanceProposal/Status/index.tsx | 68 + .../ProposalList/GovernanceProposal/index.tsx | 158 +- .../ProposalList/GovernanceProposal/styles.ts | 50 - .../pages/Governance/ProposalList/index.tsx | 12 +- .../pages/Governance/VotingWallet/index.tsx | 4 +- .../index.omnichainGovernance.spec.tsx.snap | 3 + .../__snapshots__/index.spec.tsx.snap | 3 + ...ec.tsx => index.governanceSearch.spec.tsx} | 6 +- .../index.omnichainGovernance.spec.tsx | 37 + .../pages/Governance/__tests__/index.spec.tsx | 20 +- apps/evm/src/pages/Governance/testIds.ts | 1 + .../BscCommand/ActionButton/index.tsx | 122 ++ .../Commands/BscCommand/CurrentStep/index.tsx | 139 ++ .../Proposal/Commands/BscCommand/index.tsx | 100 + .../Command/ActionsAccordion/index.tsx | 43 + .../Proposal/Commands/Command/Cta/index.tsx | 86 - .../Commands/Command/StepInfo/index.tsx | 157 -- .../pages/Proposal/Commands/Command/index.tsx | 170 +- .../Proposal/Commands/Command/useCommand.tsx | 37 - .../Proposal/Commands/Description/index.tsx | 12 + .../NonBscCommand/CurrentStep/index.tsx | 148 ++ .../Proposal/Commands/NonBscCommand/index.tsx | 128 ++ .../Proposal/Commands/Progress/index.tsx | 23 +- .../pages/Proposal/Commands/Status/index.tsx | 62 + .../__snapshots__/index.spec.tsx.snap | 2 +- .../Commands/__tests__/index.spec.tsx | 71 - .../evm/src/pages/Proposal/Commands/index.tsx | 50 +- .../useIsProposalCancelableByUser/index.tsx | 40 + .../useIsProposalExecutable/index.tsx | 24 + .../src/pages/Proposal/Description/index.tsx | 11 +- .../src/pages/Proposal/Description/styles.ts | 11 - .../ProposalSummary/Stepper/index.tsx | 5 +- .../pages/Proposal/ProposalSummary/index.tsx | 51 +- .../src/pages/Proposal/VoteSummary/index.tsx | 2 +- .../src/pages/Proposal/VoteSummary/styles.ts | 16 +- .../index. omnichainGovernance.spec.tsx.snap | 35 + .../index.omnichainGovernance.tsx.snap | 35 + .../index. omnichainGovernance.spec.tsx | 433 +++++ .../index.multichainGovernance.spec.tsx | 39 - .../pages/Proposal/__tests__/index.spec.tsx | 57 +- apps/evm/src/pages/Proposal/index.tsx | 31 +- apps/evm/src/pages/Proposal/styles.ts | 25 - apps/evm/src/pages/Proposal/testIds.ts | 2 + .../src/pages/Voter/Transactions/index.tsx | 26 +- apps/evm/src/testUtils/render.tsx | 34 +- apps/evm/src/types/index.ts | 81 +- ...nExplorerUrl.ts => generateExplorerUrl.ts} | 10 +- .../getProposalState/__tests__/index.spec.ts | 4 +- .../getProposalState/index.ts | 16 +- .../getProposalType/__tests__/index.spec.ts | 2 +- .../getProposalType/index.ts | 2 +- .../__tests__/index.spec.ts | 2 +- .../getUserVoteSupport/index.ts | 2 +- apps/evm/src/utilities/index.ts | 7 +- .../src/components/Benefits/Benefits.tsx | 2 +- yarn.lock | 1683 ++++++++++++++++- 166 files changed, 9398 insertions(+), 2705 deletions(-) create mode 100644 .changeset/brown-birds-arrive.md create mode 100644 .changeset/good-terms-fail.md create mode 100644 .changeset/honest-items-lick.md create mode 100644 .changeset/hungry-vans-exist.md create mode 100644 .changeset/perfect-spoons-sin.md create mode 100644 .changeset/rare-camels-switch.md create mode 100644 .changeset/thin-hairs-vanish.md create mode 100644 .changeset/unlucky-planets-swim.md create mode 100644 apps/evm/.graphclientrc.yml delete mode 100644 apps/evm/src/__mocks__/api/proposals.json delete mode 100644 apps/evm/src/__mocks__/models/proposalPreviews.ts rename apps/evm/src/__mocks__/models/{proposalCommands.ts => remoteProposals.ts} (59%) create mode 100644 apps/evm/src/__mocks__/subgraph/bscProposals.json create mode 100644 apps/evm/src/__mocks__/subgraph/nonBscProposals.json delete mode 100644 apps/evm/src/__mocks__/subgraph/proposalPreviews.json delete mode 100644 apps/evm/src/clients/api/queries/getProposal/types.ts create mode 100644 apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/__tests__/__snapshots__/index.spec.ts.snap create mode 100644 apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/__tests__/index.spec.ts create mode 100644 apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/index.ts delete mode 100644 apps/evm/src/clients/api/queries/getProposalPreviews/__tests__/__snapshots__/index.spec.ts.snap create mode 100644 apps/evm/src/clients/api/queries/getProposals/__tests__/__snapshots__/index.spec.ts.snap rename apps/evm/src/clients/api/queries/{getProposalPreviews => getProposals}/__tests__/index.spec.ts (60%) rename apps/evm/src/clients/api/queries/{getProposalPreviews => getProposals}/index.ts (61%) rename apps/evm/src/clients/api/queries/{getProposalPreviews/useGetProposalPreviews.ts => getProposals/useGetProposals.ts} (59%) rename apps/evm/src/{utilities => clients/api/queries/getVoterHistory}/formatToProposal.ts (88%) delete mode 100644 apps/evm/src/clients/subgraph/gql/index.ts delete mode 100644 apps/evm/src/clients/subgraph/queries/governance/getProposalPreviews/getProposalPreviews.graphql delete mode 100644 apps/evm/src/clients/subgraph/queries/governance/getProposalPreviews/index.ts create mode 100644 apps/evm/src/clients/subgraph/queries/governanceBsc/fragments/bscProposal.graphql create mode 100644 apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposal/getBscProposal.graphql create mode 100644 apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposal/index.ts create mode 100644 apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposals/getBscProposals.graphql create mode 100644 apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposals/index.ts create mode 100644 apps/evm/src/clients/subgraph/queries/governanceNonBsc/fragments/nonBscProposal.graphql create mode 100644 apps/evm/src/clients/subgraph/queries/governanceNonBsc/getNonBscProposals/getNonBscProposals.graphql create mode 100644 apps/evm/src/clients/subgraph/queries/governanceNonBsc/getNonBscProposals/index.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/__tests__/__snapshots__/index.spec.ts.snap create mode 100644 apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/__tests__/index.spec.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/index.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/__tests__/__snapshots__/index.spec.ts.snap create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/__tests__/index.spec.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/__tests__/__snapshots__/index.spec.ts.snap create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/__tests__/index.spec.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/index.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/__tests__/__snapshots__/index.spec.ts.snap create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/__tests__/index.spec.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/getRemoteProposalState/__tests__/index.spec.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/getRemoteProposalState/index.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/index.ts create mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposal/index.ts delete mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/__tests__/__snapshots__/index.spec.ts.snap delete mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/__tests__/index.spec.ts delete mode 100644 apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/index.ts create mode 100644 apps/evm/src/components/LabeledProgressCircle/index.tsx create mode 100644 apps/evm/src/containers/ConnectWallet/Container/index.tsx create mode 100644 apps/evm/src/containers/ConnectWallet/__tests__/index.spec.tsx delete mode 100644 apps/evm/src/containers/ConnectWallet/styles.ts create mode 100644 apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/Status/Indicator/index.tsx create mode 100644 apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/Status/index.tsx create mode 100644 apps/evm/src/pages/Governance/__tests__/__snapshots__/index.omnichainGovernance.spec.tsx.snap create mode 100644 apps/evm/src/pages/Governance/__tests__/__snapshots__/index.spec.tsx.snap rename apps/evm/src/pages/Governance/__tests__/{indexSearch.spec.tsx => index.governanceSearch.spec.tsx} (91%) create mode 100644 apps/evm/src/pages/Governance/__tests__/index.omnichainGovernance.spec.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/BscCommand/ActionButton/index.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/BscCommand/CurrentStep/index.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/BscCommand/index.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/Command/ActionsAccordion/index.tsx delete mode 100644 apps/evm/src/pages/Proposal/Commands/Command/Cta/index.tsx delete mode 100644 apps/evm/src/pages/Proposal/Commands/Command/StepInfo/index.tsx delete mode 100644 apps/evm/src/pages/Proposal/Commands/Command/useCommand.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/Description/index.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/NonBscCommand/CurrentStep/index.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/NonBscCommand/index.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/Status/index.tsx delete mode 100644 apps/evm/src/pages/Proposal/Commands/__tests__/index.spec.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/useIsProposalCancelableByUser/index.tsx create mode 100644 apps/evm/src/pages/Proposal/Commands/useIsProposalExecutable/index.tsx create mode 100644 apps/evm/src/pages/Proposal/__tests__/__snapshots__/index. omnichainGovernance.spec.tsx.snap create mode 100644 apps/evm/src/pages/Proposal/__tests__/__snapshots__/index.omnichainGovernance.tsx.snap create mode 100644 apps/evm/src/pages/Proposal/__tests__/index. omnichainGovernance.spec.tsx delete mode 100644 apps/evm/src/pages/Proposal/__tests__/index.multichainGovernance.spec.tsx rename apps/evm/src/utilities/{generateChainExplorerUrl.ts => generateExplorerUrl.ts} (64%) rename apps/evm/src/{clients/subgraph/utilities/formatToProposalPreview => utilities}/getProposalState/__tests__/index.spec.ts (93%) rename apps/evm/src/{clients/subgraph/utilities/formatToProposalPreview => utilities}/getProposalState/index.ts (76%) rename apps/evm/src/{clients/subgraph/utilities/formatToProposalPreview => utilities}/getProposalType/__tests__/index.spec.ts (91%) rename apps/evm/src/{clients/subgraph/utilities/formatToProposalPreview => utilities}/getProposalType/index.ts (82%) rename apps/evm/src/{clients/subgraph/utilities/formatToProposalPreview => utilities}/getUserVoteSupport/__tests__/index.spec.ts (91%) rename apps/evm/src/{clients/subgraph/utilities/formatToProposalPreview => utilities}/getUserVoteSupport/index.ts (82%) diff --git a/.changeset/brown-birds-arrive.md b/.changeset/brown-birds-arrive.md new file mode 100644 index 0000000000..13de194d06 --- /dev/null +++ b/.changeset/brown-birds-arrive.md @@ -0,0 +1,5 @@ +--- +"@venusprotocol/evm": patch +--- + +fix small responsive issues with Governance feature diff --git a/.changeset/good-terms-fail.md b/.changeset/good-terms-fail.md new file mode 100644 index 0000000000..161dde0ddb --- /dev/null +++ b/.changeset/good-terms-fail.md @@ -0,0 +1,5 @@ +--- +"@venusprotocol/evm": patch +--- + +fix governance subgraph URLs on Ethereum and Arbitrum One diff --git a/.changeset/honest-items-lick.md b/.changeset/honest-items-lick.md new file mode 100644 index 0000000000..45e1ed1531 --- /dev/null +++ b/.changeset/honest-items-lick.md @@ -0,0 +1,5 @@ +--- +"@venusprotocol/evm": minor +--- + +wire up execute button of remote proposals diff --git a/.changeset/hungry-vans-exist.md b/.changeset/hungry-vans-exist.md new file mode 100644 index 0000000000..c888ce25fd --- /dev/null +++ b/.changeset/hungry-vans-exist.md @@ -0,0 +1,5 @@ +--- +"@venusprotocol/evm": minor +--- + +add links to transactions in Commands section of Proposal page diff --git a/.changeset/perfect-spoons-sin.md b/.changeset/perfect-spoons-sin.md new file mode 100644 index 0000000000..488b238da0 --- /dev/null +++ b/.changeset/perfect-spoons-sin.md @@ -0,0 +1,5 @@ +--- +"@venusprotocol/evm": minor +--- + +fetch Proposal page data from subgraph diff --git a/.changeset/rare-camels-switch.md b/.changeset/rare-camels-switch.md new file mode 100644 index 0000000000..b058471fc7 --- /dev/null +++ b/.changeset/rare-camels-switch.md @@ -0,0 +1,5 @@ +--- +"@venusprotocol/evm": minor +--- + +list omnichain proposals on Proposal page diff --git a/.changeset/thin-hairs-vanish.md b/.changeset/thin-hairs-vanish.md new file mode 100644 index 0000000000..a621db9b46 --- /dev/null +++ b/.changeset/thin-hairs-vanish.md @@ -0,0 +1,5 @@ +--- +"@venusprotocol/evm": minor +--- + +display executed payloads counts on proposal list diff --git a/.changeset/unlucky-planets-swim.md b/.changeset/unlucky-planets-swim.md new file mode 100644 index 0000000000..0925ead9e3 --- /dev/null +++ b/.changeset/unlucky-planets-swim.md @@ -0,0 +1,5 @@ +--- +"@venusprotocol/evm": minor +--- + +split governance subgraphs + remove proposal previews diff --git a/apps/evm/.env.template b/apps/evm/.env.template index 98b8188d6c..1ece123916 100644 --- a/apps/evm/.env.template +++ b/apps/evm/.env.template @@ -37,7 +37,7 @@ VITE_RPC_HTTP_URL_OPBNB_TESTNET= VITE_SUBGRAPH_MARKETS_URL_OPBNB_TESTNET= VITE_SUBGRAPH_GOVERNANCE_URL_OPBNB_TESTNET= -## Arbitrum +# Arbitrum One VITE_RPC_HTTP_URL_ARBITRUM_ONE= VITE_SUBGRAPH_MARKETS_URL_ARBITRUM_ONE= VITE_SUBGRAPH_GOVERNANCE_URL_ARBITRUM_ONE= diff --git a/apps/evm/.graphclientrc.yml b/apps/evm/.graphclientrc.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/apps/evm/CHANGELOG.md b/apps/evm/CHANGELOG.md index 8bec4d7391..df5c8bcf6a 100644 --- a/apps/evm/CHANGELOG.md +++ b/apps/evm/CHANGELOG.md @@ -427,14 +427,14 @@ ### Minor Changes -- ea7b207: hide operations when multichainGovernance feature is enabled +- ea7b207: hide operations when omnichainGovernance feature is enabled - ff6eae0: add median user averages for Prime estimations in Ethereum - 8f39ec2: Add Commands component under Proposal page ### Patch Changes - 8126a05: Add support for the ezETH token -- 7d39f90: Add multichainGovernance feature flag +- 7d39f90: Add omnichainGovernance feature flag ## 2.131.1 diff --git a/apps/evm/package.json b/apps/evm/package.json index aeeba7af2e..8983c92dd5 100644 --- a/apps/evm/package.json +++ b/apps/evm/package.json @@ -17,8 +17,9 @@ "tsc": "tsc --noEmit", "extract-translations": "yarn i18next", "generate-subgraph-types:isolated-pools": "yarn graphql-codegen --config src/config/codegen.ts --project isolatedPools", - "generate-subgraph-types:governance": "yarn graphql-codegen --config src/config/codegen.ts --project governance", - "generate-subgraph-types": "npm-run-all --parallel generate-subgraph-types:isolated-pools generate-subgraph-types:governance", + "generate-subgraph-types:governance-bsc": "yarn graphql-codegen --config src/config/codegen.ts --project governanceBsc", + "generate-subgraph-types:governance-non-bsc": "yarn graphql-codegen --config src/config/codegen.ts --project governanceNonBsc", + "generate-subgraph-types": "yarn generate-subgraph-types:isolated-pools && yarn generate-subgraph-types:governance-bsc && yarn generate-subgraph-types:governance-non-bsc", "generate-contracts": "rimraf src/libs/contracts/generated/getters && rimraf src/libs/contracts/generated/infos && src/libs/contracts/scripts/generateContractRecords/index.ts && yarn biome format --vcs-use-ignore-file=false --write src/libs/contracts/generated", "generate-pancake-swap-tokens": "src/libs/tokens/scripts/generatePancakeSwapTokenRecords/index.ts && yarn biome format --vcs-use-ignore-file=false --write src/libs/tokens/generated/pancakeSwapTokens/bscMainnet.ts", "generate-token-accent-colors": "src/libs/tokens/scripts/generateTokenAccentColors/index.ts && yarn biome format --vcs-use-ignore-file=false --write src/libs/tokens/generated/tokenAccentColors.ts", @@ -87,10 +88,11 @@ "@changesets/cli": "^2.27.1", "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-provider": "^5.7.0", - "@graphql-codegen/add": "^5.0.0", + "@graphprotocol/client-cli": "^3.0.7", + "@graphql-codegen/add": "^5.0.3", "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", - "@graphql-codegen/typed-document-node": "^5.0.1", + "@graphql-codegen/client-preset": "^4.5.1", + "@graphql-codegen/typed-document-node": "^5.0.12", "@graphql-codegen/typescript-operations": "^4.0.1", "@rollup/plugin-inject": "^5.0.3", "@storybook/addon-essentials": "^8.4.2", @@ -115,7 +117,7 @@ "@types/recharts": "^1.8.23", "@types/redux-actions": "^2.6.2", "@types/styled-components": "^5.1.26", - "@venusprotocol/governance-contracts": "2.4.0", + "@venusprotocol/governance-contracts": "^2.5.0", "@venusprotocol/isolated-pools": "3.6.0", "@venusprotocol/oracle": "2.6.0", "@venusprotocol/protocol-reserve": "2.4.0", diff --git a/apps/evm/src/__mocks__/api/proposals.json b/apps/evm/src/__mocks__/api/proposals.json deleted file mode 100644 index 740a302492..0000000000 --- a/apps/evm/src/__mocks__/api/proposals.json +++ /dev/null @@ -1,265 +0,0 @@ -{ - "limit": 5, - "page": 0, - "result": [ - { - "description": "{\"version\":\"v1\",\"title\":\"VIP Comptroller Diamond proxy\",\"description\":\"This vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented.\",\"forDescription\":\"I agree that Venus Protocol should proceed with the upgrading the Comptroller contract with diamond proxy\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with the Comptroller contract upgradation\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds with the Comptroller upgradation or not\"}", - "createdBlock": 33499559, - "createdTxHash": "0xb8a70919dbf83e5c63af8efbad418b2a81ca9f4937b12f806482581abaf03b65", - "createdTimestamp": 1695195575, - "startBlock": 33499709, - "startTimestamp": 1695196025, - "cancelBlock": null, - "cancelTxHash": null, - "cancelTimestamp": null, - "endBlock": 33499859, - "endTimestamp": 1695196475, - "queuedBlock": null, - "queuedTxHash": null, - "queuedTimestamp": null, - "executedBlock": null, - "executedTxHash": null, - "executedTimestamp": null, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "eta": null, - "forVotesMantissa": "605461000000000000000000", - "againstVotesMantissa": "0", - "state": 3, - "abstainedVotesMantissa": "0", - "governorName": "GovernorBravoDelegateV4", - "proposalType": 0, - "proposalId": 98, - "proposalActions": [], - "votes": [ - { - "proposalId": 98, - "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "support": 1, - "blockNumber": 33335869, - "blockTimestamp": 1694704478, - "votesMantissa": "605461000000000000000000", - "reason": "" - } - ] - }, - { - "proposalId": 97, - "description": "{\"version\":\"v1\",\"title\":\"VIP Comptroller Diamond proxy\",\"description\":\"This vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented.\",\"forDescription\":\"I agree that Venus Protocol should proceed with the upgrading the Comptroller contract with diamond proxy\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with the Comptroller contract upgradation\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds with the Comptroller upgradation or not\"}", - "createdBlock": 33499559, - "createdTxHash": "0xb8a70919dbf83e5c63af8efbad418b2a81ca9f4937b12f806482581abaf03b65", - "createdTimestamp": 1695195575, - "startBlock": 33499709, - "startTimestamp": 1695196025, - "cancelBlock": null, - "cancelTxHash": null, - "cancelTimestamp": null, - "endBlock": 33499859, - "endTimestamp": 1695196475, - "queuedBlock": null, - "queuedTxHash": null, - "queuedTimestamp": null, - "executedBlock": null, - "executedTxHash": null, - "executedTimestamp": null, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "eta": null, - "forVotesMantissa": "605461000000000000000000", - "againstVotesMantissa": "500000000000000000000000", - "state": 1, - "abstainedVotesMantissa": "500000000000000000000000", - "governorName": "GovernorBravoDelegateV4", - "proposalType": 0, - "proposalActions": [], - "votes": [ - { - "proposalId": 97, - "address": "0xc444949e0054a23c44fc45789738bdf64aed2391", - "support": 1, - "blockNumber": 33335869, - "blockTimestamp": 1694704478, - "votesMantissa": "605461000000000000000000", - "reason": "yes" - }, - { - "proposalId": 97, - "address": "0x60277add339d936c4ab907376afee4f7ac17d760", - "support": 0, - "blockNumber": 33335869, - "blockTimestamp": 1694704478, - "votesMantissa": "500000000000000000000000", - "reason": "no" - }, - { - "proposalId": 97, - "address": "0xb98fa0292e2927018c03ad5110673b7daa1424a7", - "support": 2, - "blockNumber": 33335869, - "blockTimestamp": 1694704478, - "votesMantissa": "500000000000000000000000", - "reason": "abstain" - } - ] - }, - { - "description": "{\"version\":\"v1\",\"title\":\"VIP Comptroller Diamond proxy\",\"description\":\"This vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented.\",\"forDescription\":\"I agree that Venus Protocol should proceed with the upgrading the Comptroller contract with diamond proxy\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with the Comptroller contract upgradation\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds with the Comptroller upgradation or not\"}", - "createdBlock": 33446367, - "createdTxHash": "0x67c11aa7e66f92063d8e0fbfa3f528ad3266dafb3d26a976e008da930fde8209", - "createdTimestamp": 1695035981, - "startBlock": 33446517, - "startTimestamp": 1695036431, - "cancelBlock": 33480496, - "cancelTxHash": "0xec844bf514a6803c33ae93c168933d149ed16919a882f222a450b45f7895f86c", - "cancelTimestamp": 1695138386, - "endBlock": 33446667, - "endTimestamp": 1695036881, - "queuedBlock": 33470957, - "queuedTxHash": "0x7f288a72f9d53e35720f6eaed2c3ad344cb1e08944a554a26004aa73cd16800c", - "queuedTimestamp": 1695109769, - "executedBlock": null, - "executedTxHash": null, - "executedTimestamp": null, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "eta": 1695110369, - "forVotesMantissa": "605461000000000000000000", - "againstVotesMantissa": "0", - "state": 2, - "abstainedVotesMantissa": "0", - "governorName": "GovernorBravoDelegateV4", - "proposalType": 0, - "proposalId": 96, - "proposalActions": [], - "votes": [ - { - "proposalId": 96, - "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "support": 1, - "blockNumber": 33335869, - "blockTimestamp": 1694704478, - "votesMantissa": "605461000000000000000000", - "reason": "" - } - ] - }, - { - "description": "{\"version\":\"v2\",\"title\":\"test\",\"description\":\"1\",\"forDescription\":\"1\",\"againstDescription\":\"2\",\"abstainDescription\":\"3\"}", - "createdBlock": 33358542, - "createdTxHash": "0xfe924152536a7f775689c664aca3754c9694b78040c2ae7a0b56f84fed602acb", - "createdTimestamp": 1694772500, - "startBlock": 33358692, - "startTimestamp": 1694772950, - "cancelBlock": null, - "cancelTxHash": null, - "cancelTimestamp": null, - "endBlock": 33358842, - "endTimestamp": 1694773400, - "queuedBlock": null, - "queuedTxHash": null, - "queuedTimestamp": null, - "executedBlock": null, - "executedTxHash": null, - "executedTimestamp": null, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "eta": null, - "forVotesMantissa": "605461000000000000000000", - "againstVotesMantissa": "0", - "state": 3, - "abstainedVotesMantissa": "0", - "governorName": "GovernorBravoDelegateV4", - "proposalType": 0, - "proposalId": 95, - "proposalActions": [], - "votes": [ - { - "proposalId": 95, - "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "support": 1, - "blockNumber": 33335869, - "blockTimestamp": 1694704478, - "votesMantissa": "605461000000000000000000", - "reason": "" - } - ] - }, - { - "description": "{\"version\":\"v2\",\"title\":\"123\",\"description\":\"Crit\",\"forDescription\":\"Yes\",\"againstDescription\":\"No\",\"abstainDescription\":\"Meh\"}", - "createdBlock": 33340881, - "createdTxHash": "0x27f1c81bfb014d08d2181af3bd9fa363b93a022e3f3c6798395e74b02f238a5f", - "createdTimestamp": 1694719515, - "startBlock": 33340931, - "startTimestamp": 1694719665, - "cancelBlock": null, - "cancelTxHash": null, - "cancelTimestamp": null, - "endBlock": 33340981, - "endTimestamp": 1694719815, - "queuedBlock": null, - "queuedTxHash": null, - "queuedTimestamp": null, - "executedBlock": null, - "executedTxHash": null, - "executedTimestamp": null, - "proposer": "0x6eace20e1f89d0b24e5b295af1802dfbc730b37d", - "eta": null, - "forVotesMantissa": "605461000000000000000000", - "againstVotesMantissa": "0", - "state": 4, - "abstainedVotesMantissa": "0", - "governorName": "GovernorBravoDelegateV4", - "proposalType": 0, - "proposalId": 94, - "proposalActions": [], - "votes": [ - { - "proposalId": 94, - "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "support": 1, - "blockNumber": 33335869, - "blockTimestamp": 1694704478, - "votesMantissa": "605461000000000000000000", - "reason": "" - } - ] - }, - { - "description": "{\"version\":\"v2\",\"title\":\"123\",\"description\":\"123\",\"forDescription\":\"Ok\",\"againstDescription\":\"No\",\"abstainDescription\":\"Meh\"}", - "createdBlock": 33336708, - "createdTxHash": "0xd016993b6b81bfbc5e6070edd88106809ebb0b7b58e67d33b526d027c1f5f076", - "createdTimestamp": 1694706995, - "startBlock": 33336858, - "startTimestamp": 1694707445, - "cancelBlock": null, - "cancelTxHash": null, - "cancelTimestamp": null, - "endBlock": 33337008, - "endTimestamp": 1694707895, - "queuedBlock": null, - "queuedTxHash": null, - "queuedTimestamp": null, - "executedBlock": null, - "executedTxHash": null, - "executedTimestamp": null, - "proposer": "0x6eace20e1f89d0b24e5b295af1802dfbc730b37d", - "eta": null, - "forVotesMantissa": "605461000000000000000000", - "againstVotesMantissa": "0", - "state": 5, - "abstainedVotesMantissa": "0", - "governorName": "GovernorBravoDelegateV4", - "proposalType": 0, - "proposalId": 93, - "proposalActions": [], - "votes": [ - { - "proposalId": 93, - "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "support": 1, - "blockNumber": 33335869, - "blockTimestamp": 1694704478, - "votesMantissa": "605461000000000000000000", - "reason": "" - } - ] - } - ], - "total": 96 -} diff --git a/apps/evm/src/__mocks__/models/proposalPreviews.ts b/apps/evm/src/__mocks__/models/proposalPreviews.ts deleted file mode 100644 index ae130a8bc1..0000000000 --- a/apps/evm/src/__mocks__/models/proposalPreviews.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { type ProposalPreviewsQuery, formatToProposalPreview } from 'clients/subgraph'; - -import BigNumber from 'bignumber.js'; -import proposalPreviewsResponse from '../subgraph/proposalPreviews.json'; - -const currentBlockNumber = 38563073; -const blockTimeMs = 3000; -const proposalMinQuorumVotesMantissa = new BigNumber('600000000000000000000000'); - -export const proposalPreviews = proposalPreviewsResponse.proposals.map(gqlProposal => - formatToProposalPreview({ - gqlProposal: gqlProposal as ProposalPreviewsQuery['proposals'][number], - proposalMinQuorumVotesMantissa, - currentBlockNumber, - blockTimeMs, - }), -); diff --git a/apps/evm/src/__mocks__/models/proposals.ts b/apps/evm/src/__mocks__/models/proposals.ts index 45f144c7cf..acfda0763b 100644 --- a/apps/evm/src/__mocks__/models/proposals.ts +++ b/apps/evm/src/__mocks__/models/proposals.ts @@ -1,10 +1,240 @@ -import { formatToProposal } from 'utilities'; +import BigNumber from 'bignumber.js'; +import { type Proposal, ProposalState } from 'types'; +import { remoteProposals } from './remoteProposals'; -import proposalResponse from '../api/proposals.json'; -import fakeAddress from './address'; - -const proposals = proposalResponse.result.map(p => - formatToProposal({ ...p, accountAddress: fakeAddress }), -); - -export default proposals; +export const proposals: Proposal[] = [ + { + abstainedVotesMantissa: new BigNumber('0'), + againstVotesMantissa: new BigNumber('0'), + createdDate: new Date('2023-09-20T07:39:35.000Z'), + description: { + version: 'v1', + title: 'VIP Comptroller Diamond proxy', + description: + 'This vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented.', + }, + endBlock: 33499859, + endDate: new Date('2023-09-20T07:54:35.000Z'), + queuedDate: new Date('2023-09-20T09:54:35.000Z'), + executionEtaDate: new Date('2023-09-21T06:54:35.000Z'), + executedDate: new Date('2023-09-21T07:54:35.000Z'), + forVotesMantissa: new BigNumber('605461000000000000000000'), + proposalId: 98, + proposerAddress: '0x2ce1d0ffd7e869d9df33e28552b12ddded326706', + startDate: new Date('2023-09-20T07:47:05.000Z'), + state: ProposalState.Executed, + createdTxHash: '0xb8a70919dbf83e5c63af8efbad418b2a81ca9f4937b12f806482581abaf03b65', + totalVotesMantissa: new BigNumber('605461000000000000000000'), + proposalActions: [], + forVotes: [ + { + proposalId: 98, + address: '0x2ce1d0ffd7e869d9df33e28552b12ddded326706', + support: 1, + votesMantissa: new BigNumber('605461000000000000000000'), + reason: '', + }, + ], + againstVotes: [], + abstainVotes: [], + proposalType: 0, + remoteProposals, + }, + { + abstainedVotesMantissa: new BigNumber('500000000000000000000000'), + againstVotesMantissa: new BigNumber('500000000000000000000000'), + createdDate: new Date('2023-09-20T07:39:35.000Z'), + description: { + version: 'v1', + title: 'VIP Comptroller Diamond proxy', + description: + 'This vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented.', + }, + endBlock: 33499859, + endDate: new Date('2023-09-20T07:54:35.000Z'), + forVotesMantissa: new BigNumber('605461000000000000000000'), + proposalId: 97, + proposerAddress: '0x2ce1d0ffd7e869d9df33e28552b12ddded326706', + startDate: new Date('2023-09-20T07:47:05.000Z'), + state: ProposalState.Active, + createdTxHash: '0xb8a70919dbf83e5c63af8efbad418b2a81ca9f4937b12f806482581abaf03b65', + totalVotesMantissa: new BigNumber('1.605461e+24'), + proposalActions: [], + forVotes: [ + { + proposalId: 97, + address: '0xc444949e0054a23c44fc45789738bdf64aed2391', + support: 1, + votesMantissa: new BigNumber('605461000000000000000000'), + reason: 'yes', + }, + ], + againstVotes: [ + { + proposalId: 97, + address: '0x60277add339d936c4ab907376afee4f7ac17d760', + support: 0, + votesMantissa: new BigNumber('500000000000000000000000'), + reason: 'no', + }, + ], + abstainVotes: [ + { + proposalId: 97, + address: '0xb98fa0292e2927018c03ad5110673b7daa1424a7', + support: 2, + votesMantissa: new BigNumber('500000000000000000000000'), + reason: 'abstain', + }, + ], + proposalType: 0, + remoteProposals, + }, + { + abstainedVotesMantissa: new BigNumber('0'), + againstVotesMantissa: new BigNumber('0'), + cancelDate: new Date('2023-09-19T15:46:26.000Z'), + createdDate: new Date('2023-09-18T11:19:41.000Z'), + description: { + version: 'v1', + title: 'VIP Comptroller Diamond proxy', + description: + 'This vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented.', + }, + endBlock: 33446667, + endDate: new Date('2023-09-18T11:34:41.000Z'), + forVotesMantissa: new BigNumber('605461000000000000000000'), + proposalId: 96, + proposerAddress: '0x2ce1d0ffd7e869d9df33e28552b12ddded326706', + queuedDate: new Date('2023-09-19T07:49:29.000Z'), + executionEtaDate: new Date('2023-09-19T07:59:29.000Z'), + startDate: new Date('2023-09-18T11:27:11.000Z'), + state: ProposalState.Canceled, + createdTxHash: '0x67c11aa7e66f92063d8e0fbfa3f528ad3266dafb3d26a976e008da930fde8209', + cancelTxHash: '0xec844bf514a6803c33ae93c168933d149ed16919a882f222a450b45f7895f86c', + queuedTxHash: '0x7f288a72f9d53e35720f6eaed2c3ad344cb1e08944a554a26004aa73cd16800c', + totalVotesMantissa: new BigNumber('605461000000000000000000'), + proposalActions: [], + forVotes: [ + { + proposalId: 96, + address: '0x2ce1d0ffd7e869d9df33e28552b12ddded326706', + support: 1, + votesMantissa: new BigNumber('605461000000000000000000'), + reason: '', + }, + ], + againstVotes: [], + abstainVotes: [], + proposalType: 0, + remoteProposals, + }, + { + abstainedVotesMantissa: new BigNumber('0'), + againstVotesMantissa: new BigNumber('0'), + createdDate: new Date('2023-09-15T10:08:20.000Z'), + description: { + version: 'v2', + title: 'test', + description: '1', + forDescription: '1', + againstDescription: '2', + abstainDescription: '3', + }, + endBlock: 33358842, + endDate: new Date('2023-09-15T10:23:20.000Z'), + forVotesMantissa: new BigNumber('605461000000000000000000'), + proposalId: 95, + proposerAddress: '0x2ce1d0ffd7e869d9df33e28552b12ddded326706', + startDate: new Date('2023-09-15T10:15:50.000Z'), + state: ProposalState.Defeated, + createdTxHash: '0xfe924152536a7f775689c664aca3754c9694b78040c2ae7a0b56f84fed602acb', + totalVotesMantissa: new BigNumber('605461000000000000000000'), + proposalActions: [], + forVotes: [ + { + proposalId: 95, + address: '0x2ce1d0ffd7e869d9df33e28552b12ddded326706', + support: 1, + votesMantissa: new BigNumber('605461000000000000000000'), + reason: '', + }, + ], + againstVotes: [], + abstainVotes: [], + proposalType: 0, + remoteProposals, + }, + { + abstainedVotesMantissa: new BigNumber('0'), + againstVotesMantissa: new BigNumber('0'), + createdDate: new Date('2023-09-14T19:25:15.000Z'), + description: { + version: 'v2', + title: '123', + description: 'Crit', + forDescription: 'Yes', + againstDescription: 'No', + abstainDescription: 'Meh', + }, + endBlock: 33340981, + endDate: new Date('2023-09-14T19:30:15.000Z'), + forVotesMantissa: new BigNumber('605461000000000000000000'), + proposalId: 94, + proposerAddress: '0x6eace20e1f89d0b24e5b295af1802dfbc730b37d', + startDate: new Date('2023-09-14T19:27:45.000Z'), + state: ProposalState.Succeeded, + createdTxHash: '0x27f1c81bfb014d08d2181af3bd9fa363b93a022e3f3c6798395e74b02f238a5f', + totalVotesMantissa: new BigNumber('605461000000000000000000'), + proposalActions: [], + forVotes: [ + { + proposalId: 94, + address: '0x2ce1d0ffd7e869d9df33e28552b12ddded326706', + support: 1, + votesMantissa: new BigNumber('605461000000000000000000'), + reason: '', + }, + ], + againstVotes: [], + abstainVotes: [], + proposalType: 0, + remoteProposals, + }, + { + abstainedVotesMantissa: new BigNumber('0'), + againstVotesMantissa: new BigNumber('0'), + createdDate: new Date('2023-09-14T15:56:35.000Z'), + description: { + version: 'v2', + title: '123', + description: '123', + forDescription: 'Ok', + againstDescription: 'No', + abstainDescription: 'Meh', + }, + endBlock: 33337008, + endDate: new Date('2023-09-14T16:11:35.000Z'), + forVotesMantissa: new BigNumber('605461000000000000000000'), + proposalId: 93, + proposerAddress: '0x6eace20e1f89d0b24e5b295af1802dfbc730b37d', + startDate: new Date('2023-09-14T16:04:05.000Z'), + state: ProposalState.Queued, + createdTxHash: '0xd016993b6b81bfbc5e6070edd88106809ebb0b7b58e67d33b526d027c1f5f076', + totalVotesMantissa: new BigNumber('605461000000000000000000'), + proposalActions: [], + forVotes: [ + { + proposalId: 93, + address: '0x2ce1d0ffd7e869d9df33e28552b12ddded326706', + support: 1, + votesMantissa: new BigNumber('605461000000000000000000'), + reason: '', + }, + ], + againstVotes: [], + abstainVotes: [], + proposalType: 0, + remoteProposals, + }, +]; diff --git a/apps/evm/src/__mocks__/models/proposalCommands.ts b/apps/evm/src/__mocks__/models/remoteProposals.ts similarity index 59% rename from apps/evm/src/__mocks__/models/proposalCommands.ts rename to apps/evm/src/__mocks__/models/remoteProposals.ts index 7acd9b6e43..9ad308f48c 100644 --- a/apps/evm/src/__mocks__/models/proposalCommands.ts +++ b/apps/evm/src/__mocks__/models/remoteProposals.ts @@ -1,17 +1,18 @@ -import { ChainId, type ProposalCommand, ProposalCommandState } from 'types'; +import { ChainId, type RemoteProposal, RemoteProposalState } from 'types'; const fakePastDate = new Date(2023, 1, 1); const fakeFutureDate = new Date(2089, 1, 1); -export const commands: ProposalCommand[] = [ +export const remoteProposals: RemoteProposal[] = [ { + proposalId: 1, + remoteProposalId: 1, chainId: ChainId.BSC_TESTNET, - state: ProposalCommandState.Executed, - bridgedAt: fakePastDate, - queuedAt: fakePastDate, - succeededAt: fakePastDate, - executedAt: fakePastDate, - actionSignatures: [ + state: RemoteProposalState.Executed, + bridgedDate: fakePastDate, + queuedDate: fakePastDate, + executedDate: fakePastDate, + proposalActions: [ { actionIndex: 0, target: '0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706', @@ -29,11 +30,13 @@ export const commands: ProposalCommand[] = [ ], }, { + proposalId: 2, + remoteProposalId: 2, chainId: ChainId.OPBNB_TESTNET, - state: ProposalCommandState.Bridged, - bridgedAt: fakePastDate, - queuedAt: fakePastDate, - actionSignatures: [ + state: RemoteProposalState.Bridged, + bridgedDate: fakePastDate, + queuedDate: fakePastDate, + proposalActions: [ { actionIndex: 0, target: '0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706', @@ -51,12 +54,14 @@ export const commands: ProposalCommand[] = [ ], }, { + proposalId: 3, + remoteProposalId: 3, chainId: ChainId.SEPOLIA, - state: ProposalCommandState.Queued, - bridgedAt: fakePastDate, - queuedAt: fakePastDate, - executableAt: fakeFutureDate, - actionSignatures: [ + state: RemoteProposalState.Queued, + bridgedDate: fakePastDate, + queuedDate: fakePastDate, + executionEtaDate: fakeFutureDate, + proposalActions: [ { actionIndex: 0, target: '0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706', @@ -74,36 +79,14 @@ export const commands: ProposalCommand[] = [ ], }, { + proposalId: 4, + remoteProposalId: 4, chainId: ChainId.SEPOLIA, - state: ProposalCommandState.Queued, - bridgedAt: fakePastDate, - queuedAt: fakePastDate, - executableAt: fakePastDate, - actionSignatures: [ - { - actionIndex: 0, - target: '0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706', - signature: 'test()', - value: '', - callData: '0x', - }, - { - actionIndex: 0, - target: '0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706', - signature: 'test()', - value: '', - callData: '0x', - }, - ], - }, - { - chainId: ChainId.OPBNB_TESTNET, - state: ProposalCommandState.Queued, - bridgedAt: fakePastDate, - queuedAt: fakePastDate, - executableAt: fakePastDate, - failedExecutionAt: fakeFutureDate, - actionSignatures: [ + state: RemoteProposalState.Queued, + bridgedDate: fakePastDate, + queuedDate: fakePastDate, + executionEtaDate: fakePastDate, + proposalActions: [ { actionIndex: 0, target: '0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706', @@ -121,13 +104,15 @@ export const commands: ProposalCommand[] = [ ], }, { + proposalId: 6, + remoteProposalId: 6, chainId: ChainId.ARBITRUM_SEPOLIA, - state: ProposalCommandState.Canceled, - bridgedAt: fakePastDate, - queuedAt: fakePastDate, - executableAt: fakePastDate, - canceledAt: fakePastDate, - actionSignatures: [ + state: RemoteProposalState.Canceled, + bridgedDate: fakePastDate, + queuedDate: fakePastDate, + executionEtaDate: fakePastDate, + canceledDate: fakePastDate, + proposalActions: [ { actionIndex: 0, target: '0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706', @@ -145,13 +130,15 @@ export const commands: ProposalCommand[] = [ ], }, { + proposalId: 7, + remoteProposalId: 7, chainId: ChainId.ARBITRUM_SEPOLIA, - state: ProposalCommandState.Executed, - bridgedAt: fakePastDate, - queuedAt: fakePastDate, - executableAt: fakePastDate, - executedAt: fakePastDate, - actionSignatures: [ + state: RemoteProposalState.Executed, + bridgedDate: fakePastDate, + queuedDate: fakePastDate, + executionEtaDate: fakePastDate, + executedDate: fakePastDate, + proposalActions: [ { actionIndex: 0, target: '0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706', diff --git a/apps/evm/src/__mocks__/subgraph/bscProposals.json b/apps/evm/src/__mocks__/subgraph/bscProposals.json new file mode 100644 index 0000000000..fcfc727c9c --- /dev/null +++ b/apps/evm/src/__mocks__/subgraph/bscProposals.json @@ -0,0 +1,1248 @@ +{ + "proposals": [ + { + "id": "436", + "proposalId": "436", + "startBlock": "44354546", + "endBlock": "44354696", + "forVotes": "0", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": null, + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"Test VIP\",\"description\":\"#### Description\\n Mint faucet on all network\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", + "passing": false, + "targets": [ + "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899" + ], + "values": ["0", "0", "0", "0"], + "signatures": [ + "allocateTo(address,uint256)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)" + ], + "calldatas": [ + "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000027da000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000" + ], + "proposer": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706" + }, + "created": { + "id": "0xcfafe0fcb0ed8ba08a454be1c05d0883287b76457cf0fae93d07f0131d565e49", + "timestamp": "1727783895", + "txHash": "0xcfafe0fcb0ed8ba08a454be1c05d0883287b76457cf0fae93d07f0131d565e49" + }, + "executed": null, + "canceled": null, + "queued": null, + "votes": [], + "remoteProposals": [ + { + "id": "0xb1270000b401", + "proposalId": "4", + "targets": ["0xf3118a17863996b9f2a073c9a66faaa664355cf8"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xb1270000", + "layerZeroChainId": 10161 + }, + "stateTransactions": null + }, + { + "id": "0xda270000b401", + "proposalId": "5", + "targets": ["0x8ac9b3801d0a8f5055428ae0bf301ca1da976855"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xda270000", + "layerZeroChainId": 10202 + }, + "stateTransactions": null + }, + { + "id": "0xf7270000b401", + "proposalId": "6", + "targets": ["0x772d68929655ce7234c8c94256526dda66ef641e"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xf7270000", + "layerZeroChainId": 10231 + }, + "stateTransactions": null + } + ] + }, + { + "id": "435", + "proposalId": "435", + "startBlock": "44349973", + "endBlock": "44350123", + "forVotes": "0", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": null, + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"Test VIP\",\"description\":\"#### Description\\n Mint faucet on all network\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", + "passing": false, + "targets": [ + "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899" + ], + "values": ["0", "0", "0", "0"], + "signatures": [ + "allocateTo(address,uint256)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)" + ], + "calldatas": [ + "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000027da000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000" + ], + "proposer": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706" + }, + "created": { + "id": "0x62639208b514e81708fcc30c7ce276c2f7f3b12ba5252102cda3604db967fbc3", + "timestamp": "1727770176", + "txHash": "0x62639208b514e81708fcc30c7ce276c2f7f3b12ba5252102cda3604db967fbc3" + }, + "executed": null, + "canceled": null, + "queued": null, + "votes": [], + "remoteProposals": [ + { + "id": "0xb1270000b301", + "proposalId": null, + "targets": ["0xf3118a17863996b9f2a073c9a66faaa664355cf8"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xb1270000", + "layerZeroChainId": 10161 + }, + "stateTransactions": null + }, + { + "id": "0xda270000b301", + "proposalId": null, + "targets": ["0x8ac9b3801d0a8f5055428ae0bf301ca1da976855"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xda270000", + "layerZeroChainId": 10202 + }, + "stateTransactions": null + }, + { + "id": "0xf7270000b301", + "proposalId": null, + "targets": ["0x772d68929655ce7234c8c94256526dda66ef641e"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xf7270000", + "layerZeroChainId": 10231 + }, + "stateTransactions": null + } + ] + }, + { + "id": "434", + "proposalId": "434", + "startBlock": "44185124", + "endBlock": "44185274", + "forVotes": "0", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": null, + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"Test VIP\",\"description\":\"#### Description\\n Mint faucet on all network\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", + "passing": false, + "targets": [ + "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899" + ], + "values": ["0", "0", "0", "0"], + "signatures": [ + "allocateTo(address,uint256)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)" + ], + "calldatas": [ + "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000002776000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000" + ], + "proposer": { + "id": "0x6eace20e1f89d0b24e5b295af1802dfbc730b37d" + }, + "created": { + "id": "0x2794dce9d7a02e9a8d699bf23d236955d8cf2115fced7befa2a5ffd38ea708c5", + "timestamp": "1727275609", + "txHash": "0x2794dce9d7a02e9a8d699bf23d236955d8cf2115fced7befa2a5ffd38ea708c5" + }, + "executed": null, + "canceled": null, + "queued": null, + "votes": [], + "remoteProposals": [ + { + "id": "0x76270000b201", + "proposalId": null, + "targets": ["0x8ac9b3801d0a8f5055428ae0bf301ca1da976855"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0x76270000", + "layerZeroChainId": 10102 + }, + "stateTransactions": null + }, + { + "id": "0xb1270000b201", + "proposalId": null, + "targets": ["0x772d68929655ce7234c8c94256526dda66ef641e"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xb1270000", + "layerZeroChainId": 10161 + }, + "stateTransactions": null + }, + { + "id": "0xf7270000b201", + "proposalId": null, + "targets": ["0xf3118a17863996b9f2a073c9a66faaa664355cf8"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xf7270000", + "layerZeroChainId": 10231 + }, + "stateTransactions": null + } + ] + }, + { + "id": "433", + "proposalId": "433", + "startBlock": "44120559", + "endBlock": "44120709", + "forVotes": "605372000000000000000000", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": "1727083465", + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"VIP to transfer XVS to destination chain\",\"description\":\"\",\"forDescription\":\"I agree that Venus Protocol should proceed with this transfer for XVS\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this transfer for XVS\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds with this transfer for XVS\"}", + "passing": true, + "targets": [ + "0x8b293600c50d6fbdc6ed4251cc75ece29880276f", + "0xb9e0e753630434d7863528cc73cb7ac638a7c8ff", + "0xb9e0e753630434d7863528cc73cb7ac638a7c8ff", + "0x0e132cd94fd70298b747d2b4d977db8d086e5fd0" + ], + "values": ["0", "0", "0", "300000000000000000"], + "signatures": [ + "withdrawTreasuryBEP20(address,uint256,address)", + "approve(address,uint256)", + "approve(address,uint256)", + "sendFrom(address,uint16,bytes32,uint256,(address,address,bytes))" + ], + "calldatas": [ + "0x000000000000000000000000b9e0e753630434d7863528cc73cb7ac638a7c8ff0000000000000000000000000000000000000000000001d234f9a33f47600000000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327", + "0x0000000000000000000000000e132cd94fd70298b747d2b4d977db8d086e5fd00000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000e132cd94fd70298b747d2b4d977db8d086e5fd00000000000000000000000000000000000000000000001d234f9a33f47600000", + "0x000000000000000000000000ce10739590001705f7ff231611ba4a48b282032700000000000000000000000000000000000000000000000000000000000027f80000000000000000000000005a1a12f47fa7007c9e23cf5e025f3f5d3ac7d7550000000000000000000000000000000000000000000001d234f9a33f4760000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000022000100000000000000000000000000000000000000000000000000000000000493e0000000000000000000000000000000000000000000000000000000000000" + ], + "proposer": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706" + }, + "created": { + "id": "0x545f1fd62d776be9ec70d3be21cca9efbc9e3aa0732f83edd43a195bbcf58f06", + "timestamp": "1727081893", + "txHash": "0x545f1fd62d776be9ec70d3be21cca9efbc9e3aa0732f83edd43a195bbcf58f06" + }, + "executed": { + "id": "0x66b889b40b51592cdd89068f16cb84802f5f6e3f88b71823f363b092d7948dbd", + "timestamp": "1727084902", + "txHash": "0x66b889b40b51592cdd89068f16cb84802f5f6e3f88b71823f363b092d7948dbd" + }, + "canceled": null, + "queued": { + "id": "0x1ccf90c821744d2c5fc5956078ab8834fa65d515e63024169378933b14d24589", + "timestamp": "1727082865", + "txHash": "0x1ccf90c821744d2c5fc5956078ab8834fa65d515e63024169378933b14d24589" + }, + "votes": [ + { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706b1010000", + "support": "FOR", + "votes": "605372000000000000000000", + "reason": null, + "voter": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "totalVotesMantissa": "605372000000000000000000" + } + } + ], + "remoteProposals": [] + }, + { + "id": "432", + "proposalId": "432", + "startBlock": "43925621", + "endBlock": "43925771", + "forVotes": "605372000000000000000000", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": "1726498583", + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"VIP-364 Enable BSC -> OP sepolia bridge\",\"description\":\"#### Summary Enable BSC -> ZKSYNC bridge\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", + "passing": true, + "targets": [ + "0xb164cb262328ca44a806ba9e3d4094931e658513", + "0xb164cb262328ca44a806ba9e3d4094931e658513", + "0xb164cb262328ca44a806ba9e3d4094931e658513", + "0xb164cb262328ca44a806ba9e3d4094931e658513", + "0xb164cb262328ca44a806ba9e3d4094931e658513", + "0xb164cb262328ca44a806ba9e3d4094931e658513" + ], + "values": ["0", "0", "0", "0", "0", "0"], + "signatures": [ + "setTrustedRemoteAddress(uint16,bytes)", + "setMinDstGas(uint16,uint16,uint256)", + "setMaxDailyLimit(uint16,uint256)", + "setMaxSingleTransactionLimit(uint16,uint256)", + "setMaxDailyReceiveLimit(uint16,uint256)", + "setMaxSingleReceiveTransactionLimit(uint16,uint256)" + ], + "calldatas": [ + "0x00000000000000000000000000000000000000000000000000000000000027f80000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001479a36dc9a43d05db4747c59c02f48ed500e47df1000000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000027f8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000493e0", + "0x00000000000000000000000000000000000000000000000000000000000027f8000000000000000000000000000000000000000000000a968163f0a57b400000", + "0x00000000000000000000000000000000000000000000000000000000000027f800000000000000000000000000000000000000000000021e19e0c9bab2400000", + "0x00000000000000000000000000000000000000000000000000000000000027f8000000000000000000000000000000000000000000000accb72d9e6b59e00000", + "0x00000000000000000000000000000000000000000000000000000000000027f8000000000000000000000000000000000000000000000228f16f861578600000" + ], + "proposer": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706" + }, + "created": { + "id": "0x4f678cd8de8fea701249b349a1b9102a5350ccd123e43e58eaa4a90e91df804a", + "timestamp": "1726497038", + "txHash": "0x4f678cd8de8fea701249b349a1b9102a5350ccd123e43e58eaa4a90e91df804a" + }, + "executed": { + "id": "0x9006192b5241d82fb2d158569c6c18832dfa78272cabcfaa05b0d447889fb95f", + "timestamp": "1726573269", + "txHash": "0x9006192b5241d82fb2d158569c6c18832dfa78272cabcfaa05b0d447889fb95f" + }, + "canceled": null, + "queued": { + "id": "0x06f257826417ddbb351d3bd2ff0f9c50a4bff757627e7ea6df140a65744a6fc9", + "timestamp": "1726497983", + "txHash": "0x06f257826417ddbb351d3bd2ff0f9c50a4bff757627e7ea6df140a65744a6fc9" + }, + "votes": [ + { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706b0010000", + "support": "FOR", + "votes": "605372000000000000000000", + "reason": null, + "voter": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "totalVotesMantissa": "605372000000000000000000" + } + } + ], + "remoteProposals": [] + }, + { + "id": "431", + "proposalId": "431", + "startBlock": "43806493", + "endBlock": "43806643", + "forVotes": "0", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": null, + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"Test VIP\",\"description\":\"#### Description\\n Mint faucet on all network\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", + "passing": false, + "targets": [ + "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899" + ], + "values": ["0", "0", "0", "0"], + "signatures": [ + "allocateTo(address,uint256)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)" + ], + "calldatas": [ + "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000002776000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000" + ], + "proposer": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706" + }, + "created": { + "id": "0xf14e6e818dceaa2b107bbd4d8ab868e7512fa16d03fabf6dc4e00d241a3b78fc", + "timestamp": "1726139648", + "txHash": "0xf14e6e818dceaa2b107bbd4d8ab868e7512fa16d03fabf6dc4e00d241a3b78fc" + }, + "executed": null, + "canceled": null, + "queued": null, + "votes": [], + "remoteProposals": [ + { + "id": "0x76270000af01", + "proposalId": null, + "targets": ["0x8ac9b3801d0a8f5055428ae0bf301ca1da976855"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0x76270000", + "layerZeroChainId": 10102 + }, + "stateTransactions": null + }, + { + "id": "0xb1270000af01", + "proposalId": null, + "targets": ["0x772d68929655ce7234c8c94256526dda66ef641e"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xb1270000", + "layerZeroChainId": 10161 + }, + "stateTransactions": null + }, + { + "id": "0xf7270000af01", + "proposalId": null, + "targets": ["0xf3118a17863996b9f2a073c9a66faaa664355cf8"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xf7270000", + "layerZeroChainId": 10231 + }, + "stateTransactions": null + } + ] + }, + { + "id": "430", + "proposalId": "430", + "startBlock": "43792731", + "endBlock": "43792881", + "forVotes": "605372000000000000000000", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": "1726100368", + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"LST ETH pool on BNB chain\",\"description\":\"https://github.com/VenusProtocol/vips/pull/373\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", + "passing": true, + "targets": [ + "0xcea29f1266e880a1482c06ed656cd08c148baa32", + "0x0af51d1504ac5b711a9eafe2fac11a51d32029ad", + "0x2842140e4ad3a92e9af30e27e290300dd785076d", + "0xcea29f1266e880a1482c06ed656cd08c148baa32", + "0x0af51d1504ac5b711a9eafe2fac11a51d32029ad", + "0x2842140e4ad3a92e9af30e27e290300dd785076d", + "0x3cd69251d04a28d887ac14cbe2e14c52f3d57823", + "0x3cd69251d04a28d887ac14cbe2e14c52f3d57823", + "0x4a73ebd3dca511cf3574768bd6184747342c23f2", + "0xc7859b809ed5a2e98659ab5427d5b69e706ae26b", + "0xc7859b809ed5a2e98659ab5427d5b69e706ae26b", + "0xc85491616fa949e048f3aac39fbf5b0703800667", + "0xc7859b809ed5a2e98659ab5427d5b69e706ae26b", + "0x16eb5ce6d186b49709dd588518cd545985096ff5", + "0x16eb5ce6d186b49709dd588518cd545985096ff5", + "0x8b293600c50d6fbdc6ed4251cc75ece29880276f", + "0x4349016259fcd8ee452f696b2a7beee31667d129", + "0xc85491616fa949e048f3aac39fbf5b0703800667", + "0x4349016259fcd8ee452f696b2a7beee31667d129", + "0x16eb5ce6d186b49709dd588518cd545985096ff5", + "0x4bd7efb423f06fa033404fbd0935a2097918084d", + "0x4bd7efb423f06fa033404fbd0935a2097918084d", + "0x8b293600c50d6fbdc6ed4251cc75ece29880276f", + "0x7df9372096c8ca2401f30b3df931beff493f1fdc", + "0xc85491616fa949e048f3aac39fbf5b0703800667", + "0x7df9372096c8ca2401f30b3df931beff493f1fdc", + "0x4bd7efb423f06fa033404fbd0935a2097918084d", + "0x46d49adf48172d2e79d813a3f4f27ab61724b01e", + "0x46d49adf48172d2e79d813a3f4f27ab61724b01e", + "0x8b293600c50d6fbdc6ed4251cc75ece29880276f", + "0x98f7a83361f7ac8765ccebab1425da6b341958a7", + "0xc85491616fa949e048f3aac39fbf5b0703800667", + "0x98f7a83361f7ac8765ccebab1425da6b341958a7", + "0x46d49adf48172d2e79d813a3f4f27ab61724b01e", + "0x32fbf7bbbd79355b86741e3181ef8c1d9bd309bb", + "0xf1fa230d25fc5d6cafe87c5a6f9e1b17bc6f194e", + "0x2ecede6989d8646c992344ff6c97c72a3f811a13", + "0x989a1993c023a45da141928921c0de8fd123b7d1", + "0xf358650a007aa12ecc8dac08cf8929be7f72a4d9", + "0x258f49254c758a0e37dab148addaea851f4b02a2" + ], + "values": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ], + "signatures": [ + "setDirectPrice(address,uint256)", + "setDirectPrice(address,uint256)", + "setValidateConfig((address,uint256,uint256))", + "setDirectPrice(address,uint256)", + "setDirectPrice(address,uint256)", + "setValidateConfig((address,uint256,uint256))", + "setTokenConfig((address,address[3],bool[3]))", + "setTokenConfig((address,address[3],bool[3]))", + "acceptOwnership()", + "acceptOwnership()", + "setPriceOracle(address)", + "addPool(string,address,uint256,uint256,uint256)", + "setPrimeToken(address)", + "setReduceReservesBlockDelta(uint256)", + "setReserveFactor(uint256)", + "withdrawTreasuryBEP20(address,uint256,address)", + "approve(address,uint256)", + "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + "approve(address,uint256)", + "setProtocolSeizeShare(uint256)", + "setReduceReservesBlockDelta(uint256)", + "setReserveFactor(uint256)", + "withdrawTreasuryBEP20(address,uint256,address)", + "approve(address,uint256)", + "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + "approve(address,uint256)", + "setProtocolSeizeShare(uint256)", + "setReduceReservesBlockDelta(uint256)", + "setReserveFactor(uint256)", + "withdrawTreasuryBEP20(address,uint256,address)", + "approve(address,uint256)", + "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + "approve(address,uint256)", + "setProtocolSeizeShare(uint256)", + "setConversionConfigs(address,address[],(uint256,uint8)[])", + "setConversionConfigs(address,address[],(uint256,uint8)[])", + "setConversionConfigs(address,address[],(uint256,uint8)[])", + "setConversionConfigs(address,address[],(uint256,uint8)[])", + "setConversionConfigs(address,address[],(uint256,uint8)[])", + "setConversionConfigs(address,address[],(uint256,uint8)[])" + ], + "calldatas": [ + "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000000000000000000000000000000f43fc2c04ee0000", + "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000000000000000000000000000000f43fc2c04ee0000", + "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000000000000000000000000000000e043da6172500000000000000000000000000000000000000000000000000000dbd2fc137a30000", + "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc0000000000000000000000000000000000000000000000000f43fc2c04ee0000", + "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc0000000000000000000000000000000000000000000000000f43fc2c04ee0000", + "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc0000000000000000000000000000000000000000000000000e043da6172500000000000000000000000000000000000000000000000000000dbd2fc137a30000", + "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d12900000000000000000000000035af302a0b4653f214240fcb2dff059fe42ec2ce000000000000000000000000b1bf3f668e0e047ab214c7373cf6b06de37c8152000000000000000000000000b1bf3f668e0e047ab214c7373cf6b06de37c8152000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc000000000000000000000000f1b65d1331dceed40da71cfc4f06d9754a3f37560000000000000000000000008c8a70695dc952ca2e8cd4038907201fabb8134e0000000000000000000000008c8a70695dc952ca2e8cd4038907201fabb8134e000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001", + "0x", + "0x", + "0x0000000000000000000000003cd69251d04a28d887ac14cbe2e14c52f3d57823", + "0x00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000c7859b809ed5a2e98659ab5427d5b69e706ae26b00000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000e27c49886e600000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000114c6971756964205374616b656420455448000000000000000000000000000000", + "0x000000000000000000000000e840f8ec2dc50e7d22e5e2991975b9f6e34b62ad", + "0x0000000000000000000000000000000000000000000000000000000000007080", + "0x00000000000000000000000000000000000000000000000003782dace9d90000", + "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d12900000000000000000000000000000000000000000000000031442230f8a30000000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327", + "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b070380066700000000000000000000000000000000000000000000000031442230f8a30000", + "0x00000000000000000000000016eb5ce6d186b49709dd588518cd545985096ff50000000000000000000000000000000000000000000000000c7d713b49da00000000000000000000000000000000000000000000000000000ce80612991d000000000000000000000000000000000000000000000000000031442230f8a300000000000000000000000000008b293600c50d6fbdc6ed4251cc75ece29880276f000000000000000000000000000000000000000000000002b5e3af16b18800000000000000000000000000000000000000000000000000004563918244f40000", + "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000000000000000000000000000002386f26fc10000", + "0x0000000000000000000000000000000000000000000000000000000000007080", + "0x00000000000000000000000000000000000000000000000003782dace9d90000", + "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc0000000000000000000000000000000000000000000000003d82eb1e09de9ad6000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327", + "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000003d82eb1e09de9ad6", + "0x0000000000000000000000004bd7efb423f06fa033404fbd0935a2097918084d0000000000000000000000000000000000000000000000000c7d713b49da00000000000000000000000000000000000000000000000000000ce80612991d00000000000000000000000000000000000000000000000000003d82eb1e09de9ad60000000000000000000000008b293600c50d6fbdc6ed4251cc75ece29880276f000000000000000000000000000000000000000000000015af1d78b58c40000000000000000000000000000000000000000000000000000ad78ebc5ac6200000", + "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000000000000000000000000000002386f26fc10000", + "0x0000000000000000000000000000000000000000000000000000000000007080", + "0x0000000000000000000000000000000000000000000000000214e8348c4f0000", + "0x00000000000000000000000098f7a83361f7ac8765ccebab1425da6b341958a70000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327", + "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000001bc16d674ec80000", + "0x00000000000000000000000046d49adf48172d2e79d813a3f4f27ab61724b01e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000008b293600c50d6fbdc6ed4251cc75ece29880276f000000000000000000000000000000000000000000000018650127cc3dc80000000000000000000000000000000000000000000000000015af1d78b58c400000", + "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000000000000000000000000000002386f26fc10000", + "0x000000000000000000000000a11c8d9dc9b66e209ef60f0c8d969d3cd988782c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "0x000000000000000000000000a11c8d9dc9b66e209ef60f0c8d969d3cd988782c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "0x00000000000000000000000016227d60f7a0e586c66b005219dfc887d13c9531000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "0x000000000000000000000000a808e341e8e723dc6ba0bb5204bafc2330d7b8e4000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "0x00000000000000000000000098f7a83361f7ac8765ccebab1425da6b341958a7000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "0x000000000000000000000000b9e0e753630434d7863528cc73cb7ac638a7c8ff000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001" + ], + "proposer": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706" + }, + "created": { + "id": "0x6bb301c7a05942e284c1276ca4ca02006818b8ab2794678c16f3a36432fbb933", + "timestamp": "1726098358", + "txHash": "0x6bb301c7a05942e284c1276ca4ca02006818b8ab2794678c16f3a36432fbb933" + }, + "executed": { + "id": "0xa3986c6801415c76451f32c279b74f3f8165ea65d03494dcec41a5370b2035ac", + "timestamp": "1726100401", + "txHash": "0xa3986c6801415c76451f32c279b74f3f8165ea65d03494dcec41a5370b2035ac" + }, + "canceled": null, + "queued": { + "id": "0x4d5db5557ed421d59458767807505b30f84f3b697d3756caee06b776657fd427", + "timestamp": "1726099768", + "txHash": "0x4d5db5557ed421d59458767807505b30f84f3b697d3756caee06b776657fd427" + }, + "votes": [ + { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706ae010000", + "support": "FOR", + "votes": "605372000000000000000000", + "reason": null, + "voter": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "totalVotesMantissa": "605372000000000000000000" + } + } + ], + "remoteProposals": [] + }, + { + "id": "429", + "proposalId": "429", + "startBlock": "43604567", + "endBlock": "43604717", + "forVotes": "605372000000000000000000", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": "1725535385", + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"VIP-357 Unlist Market\",\"description\":\"Unlist Market\",\"forDescription\":\"Execute this proposal\",\"againstDescription\":\"Do not execute this proposal\",\"abstainDescription\":\"Indifferent to execution\"}", + "passing": true, + "targets": [ + "0x94d1820b2d1c7c7452a163983dc888cec546b77d", + "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "0x94d1820b2d1c7c7452a163983dc888cec546b77d", + "0x94d1820b2d1c7c7452a163983dc888cec546b77d", + "0x94d1820b2d1c7c7452a163983dc888cec546b77d", + "0xdddd7725c073105fb2abfcbdec16708fc4c24b74" + ], + "values": ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"], + "signatures": [ + "diamondCut((address,uint8,bytes4[])[])", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "_setActionsPaused(address[],uint8[],bool)", + "unlistMarket(address)", + "unlistMarket(address)", + "upgradeTo(address)" + ], + "calldatas": [ + "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000a949ffda9b216fba9c4e5b40ef561af0fdb72300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000ba76b3fda00000000000000000000000000000000000000000000000000000000929fe9a100000000000000000000000000000000000000000000000000000000c299823800000000000000000000000000000000000000000000000000000000ede4edd000000000000000000000000000000000000000000000000000000000b0772d0b00000000000000000000000000000000000000000000000000000000abfceffc00000000000000000000000000000000000000000000000000000000007e3dd200000000000000000000000000000000000000000000000000000000c488847b00000000000000000000000000000000000000000000000000000000a78dc77500000000000000000000000000000000000000000000000000000000ddbf54fd00000000000000000000000000000000000000000000000000000000c5b4db550000000000000000000000000000000000000000000000000000000000000000000000000000000000a949ffda9b216fba9c4e5b40ef561af0fdb7230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010686dab600000000000000000000000000000000000000000000000000000000000000000000000000000000085c8d0133291348004aabffbe7cac2097af2aa1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000011ead1a8a000000000000000000000000000000000000000000000000000000000da3d454c000000000000000000000000000000000000000000000000000000005c778605000000000000000000000000000000000000000000000000000000005ec88c79000000000000000000000000000000000000000000000000000000004e79238f000000000000000000000000000000000000000000000000000000005fc7e71e0000000000000000000000000000000000000000000000000000000047ef3b3b000000000000000000000000000000000000000000000000000000004ef4c3e10000000000000000000000000000000000000000000000000000000041c728b900000000000000000000000000000000000000000000000000000000eabe7d910000000000000000000000000000000000000000000000000000000051dff9890000000000000000000000000000000000000000000000000000000024008a62000000000000000000000000000000000000000000000000000000001ededc9100000000000000000000000000000000000000000000000000000000d02f7351000000000000000000000000000000000000000000000000000000006d35bf9100000000000000000000000000000000000000000000000000000000bdcdc258000000000000000000000000000000000000000000000000000000006a56947e00000000000000000000000000000000000000000000000000000000000000000000000000000000490dfd07f592452307817c4283866035bdb3b275000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000017f519fc30000000000000000000000000000000000000000000000000000000002b5d790c00000000000000000000000000000000000000000000000000000000317b0b7700000000000000000000000000000000000000000000000000000000e4028eee000000000000000000000000000000000000000000000000000000009bf34cbb00000000000000000000000000000000000000000000000000000000522c656b0000000000000000000000000000000000000000000000000000000017db2163000000000000000000000000000000000000000000000000000000004fd42e1700000000000000000000000000000000000000000000000000000000bb85745000000000000000000000000000000000000000000000000000000000607ef6c10000000000000000000000000000000000000000000000000000000051a485e4000000000000000000000000000000000000000000000000000000005f5af1aa0000000000000000000000000000000000000000000000000000000055ee1fe1000000000000000000000000000000000000000000000000000000009460c8b5000000000000000000000000000000000000000000000000000000002a6a606500000000000000000000000000000000000000000000000000000000d24febad000000000000000000000000000000000000000000000000000000009cfdd9e6000000000000000000000000000000000000000000000000000000002ec04124000000000000000000000000000000000000000000000000000000004e0853db000000000000000000000000000000000000000000000000000000006662c7c900000000000000000000000000000000000000000000000000000000919a3736000000000000000000000000000000000000000000000000000000004ef233fc00000000000000000000000000000000000000000000000000000000fd51a3ad00000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000094d1820b2d1c7c7452a163983dc888cec546b77d0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000ce10739590001705f7ff231611ba4a48b28203270000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "0x00000000000000000000000094d1820b2d1c7c7452a163983dc888cec546b77d00000000000000000000000000000000000000000000000000000000000000600000000000000000000000003cff21b7af8390fe68799d58727d3b4c25a83cb60000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "0x00000000000000000000000094d1820b2d1c7c7452a163983dc888cec546b77d000000000000000000000000000000000000000000000000000000000000006000000000000000000000000023b893a7c45a5eb8c8c062b9f32d0d2e43ed286d0000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000ce10739590001705f7ff231611ba4a48b28203270000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000003cff21b7af8390fe68799d58727d3b4c25a83cb60000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000023b893a7c45a5eb8c8c062b9f32d0d2e43ed286d0000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000009c3015191d39cf1930f92eb7e7bcbd020bca286a000000000000000000000000f206af85bc2761c4f876d27bd474681cfb335efa0000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000008", + "0x0000000000000000000000009c3015191d39cf1930f92eb7e7bcbd020bca286a", + "0x000000000000000000000000f206af85bc2761c4f876d27bd474681cfb335efa", + "0x000000000000000000000000912c97b168286f550fd7b9588b2069319f1c88a2" + ], + "proposer": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706" + }, + "created": { + "id": "0x712e38356472fe78b8521287faf44d42c08d35264cf2dbabbdfdd377975effcb", + "timestamp": "1725533858", + "txHash": "0x712e38356472fe78b8521287faf44d42c08d35264cf2dbabbdfdd377975effcb" + }, + "executed": { + "id": "0x54c5acabde26e06c8eb95bfadc2014cc295167f3a89f0388023c56758cb7bfbd", + "timestamp": "1725535400", + "txHash": "0x54c5acabde26e06c8eb95bfadc2014cc295167f3a89f0388023c56758cb7bfbd" + }, + "canceled": null, + "queued": { + "id": "0x5ff3875e1ed65359feccc17201c6a7f932b38942eab8ee302443075bae530abc", + "timestamp": "1725534785", + "txHash": "0x5ff3875e1ed65359feccc17201c6a7f932b38942eab8ee302443075bae530abc" + }, + "votes": [ + { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706ad010000", + "support": "FOR", + "votes": "605372000000000000000000", + "reason": null, + "voter": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "totalVotesMantissa": "605372000000000000000000" + } + } + ], + "remoteProposals": [] + }, + { + "id": "428", + "proposalId": "428", + "startBlock": "43433486", + "endBlock": "43433636", + "forVotes": "0", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": null, + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"Test VIP\",\"description\":\"#### Description\\n Mint faucet on all network\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", + "passing": false, + "targets": [ + "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899" + ], + "values": ["0", "0", "0", "0"], + "signatures": [ + "allocateTo(address,uint256)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)" + ], + "calldatas": [ + "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000002776000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000" + ], + "proposer": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706" + }, + "created": { + "id": "0xa5221059657fce108338d2120708498174c473fb5727af731febd5eb760b7930", + "timestamp": "1725020593", + "txHash": "0xa5221059657fce108338d2120708498174c473fb5727af731febd5eb760b7930" + }, + "executed": null, + "canceled": null, + "queued": null, + "votes": [], + "remoteProposals": [ + { + "id": "0x76270000ac01", + "proposalId": null, + "targets": ["0x8ac9b3801d0a8f5055428ae0bf301ca1da976855"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0x76270000", + "layerZeroChainId": 10102 + }, + "stateTransactions": null + }, + { + "id": "0xb1270000ac01", + "proposalId": null, + "targets": ["0x772d68929655ce7234c8c94256526dda66ef641e"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xb1270000", + "layerZeroChainId": 10161 + }, + "stateTransactions": null + }, + { + "id": "0xf7270000ac01", + "proposalId": null, + "targets": ["0xf3118a17863996b9f2a073c9a66faaa664355cf8"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xf7270000", + "layerZeroChainId": 10231 + }, + "stateTransactions": null + } + ] + }, + { + "id": "427", + "proposalId": "427", + "startBlock": "43431852", + "endBlock": "43432002", + "forVotes": "0", + "againstVotes": "0", + "abstainVotes": "0", + "executionEta": null, + "type": "NORMAL", + "description": "{\"version\":\"v2\",\"title\":\"Test VIP\",\"description\":\"#### Description\\n Mint faucet on all network\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", + "passing": false, + "targets": [ + "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "0xcfd34aeb46b1cb4779c945854d405e91d27a1899" + ], + "values": ["0", "0", "0", "0"], + "signatures": [ + "allocateTo(address,uint256)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)", + "execute(uint16,bytes,bytes,address)" + ], + "calldatas": [ + "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000002776000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000" + ], + "proposer": { + "id": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706" + }, + "created": { + "id": "0x4f354d1e9d4ea6b90c61a093ad701b47e2182fb9aac5ff737bfd2c5c34e372ed", + "timestamp": "1725015691", + "txHash": "0x4f354d1e9d4ea6b90c61a093ad701b47e2182fb9aac5ff737bfd2c5c34e372ed" + }, + "executed": null, + "canceled": null, + "queued": null, + "votes": [], + "remoteProposals": [ + { + "id": "0x76270000ab01", + "proposalId": null, + "targets": ["0x8ac9b3801d0a8f5055428ae0bf301ca1da976855"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0x76270000", + "layerZeroChainId": 10102 + }, + "stateTransactions": null + }, + { + "id": "0xb1270000ab01", + "proposalId": null, + "targets": ["0x772d68929655ce7234c8c94256526dda66ef641e"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xb1270000", + "layerZeroChainId": 10161 + }, + "stateTransactions": null + }, + { + "id": "0xf7270000ab01", + "proposalId": null, + "targets": ["0xf3118a17863996b9f2a073c9a66faaa664355cf8"], + "values": ["0"], + "signatures": ["faucet(uint256)"], + "calldatas": ["0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"], + "trustedRemote": { + "id": "0xf7270000", + "layerZeroChainId": 10231 + }, + "stateTransactions": null + } + ] + } + ], + "total": [ + { + "id": "1" + }, + { + "id": "10" + }, + { + "id": "100" + }, + { + "id": "101" + }, + { + "id": "102" + }, + { + "id": "103" + }, + { + "id": "104" + }, + { + "id": "105" + }, + { + "id": "106" + }, + { + "id": "107" + }, + { + "id": "108" + }, + { + "id": "109" + }, + { + "id": "11" + }, + { + "id": "110" + }, + { + "id": "111" + }, + { + "id": "112" + }, + { + "id": "113" + }, + { + "id": "114" + }, + { + "id": "115" + }, + { + "id": "116" + }, + { + "id": "117" + }, + { + "id": "118" + }, + { + "id": "119" + }, + { + "id": "12" + }, + { + "id": "120" + }, + { + "id": "121" + }, + { + "id": "122" + }, + { + "id": "123" + }, + { + "id": "124" + }, + { + "id": "125" + }, + { + "id": "126" + }, + { + "id": "127" + }, + { + "id": "128" + }, + { + "id": "129" + }, + { + "id": "13" + }, + { + "id": "130" + }, + { + "id": "131" + }, + { + "id": "132" + }, + { + "id": "133" + }, + { + "id": "134" + }, + { + "id": "135" + }, + { + "id": "136" + }, + { + "id": "137" + }, + { + "id": "138" + }, + { + "id": "139" + }, + { + "id": "14" + }, + { + "id": "140" + }, + { + "id": "141" + }, + { + "id": "142" + }, + { + "id": "143" + }, + { + "id": "144" + }, + { + "id": "145" + }, + { + "id": "146" + }, + { + "id": "147" + }, + { + "id": "148" + }, + { + "id": "149" + }, + { + "id": "15" + }, + { + "id": "150" + }, + { + "id": "151" + }, + { + "id": "152" + }, + { + "id": "153" + }, + { + "id": "154" + }, + { + "id": "155" + }, + { + "id": "156" + }, + { + "id": "157" + }, + { + "id": "158" + }, + { + "id": "159" + }, + { + "id": "16" + }, + { + "id": "160" + }, + { + "id": "161" + }, + { + "id": "162" + }, + { + "id": "163" + }, + { + "id": "164" + }, + { + "id": "165" + }, + { + "id": "166" + }, + { + "id": "167" + }, + { + "id": "168" + }, + { + "id": "169" + }, + { + "id": "17" + }, + { + "id": "170" + }, + { + "id": "171" + }, + { + "id": "172" + }, + { + "id": "173" + }, + { + "id": "174" + }, + { + "id": "175" + }, + { + "id": "176" + }, + { + "id": "177" + }, + { + "id": "178" + }, + { + "id": "179" + }, + { + "id": "18" + }, + { + "id": "180" + }, + { + "id": "181" + }, + { + "id": "182" + }, + { + "id": "183" + }, + { + "id": "184" + }, + { + "id": "185" + }, + { + "id": "186" + }, + { + "id": "187" + }, + { + "id": "188" + }, + { + "id": "189" + } + ] +} diff --git a/apps/evm/src/__mocks__/subgraph/nonBscProposals.json b/apps/evm/src/__mocks__/subgraph/nonBscProposals.json new file mode 100644 index 0000000000..fd92501319 --- /dev/null +++ b/apps/evm/src/__mocks__/subgraph/nonBscProposals.json @@ -0,0 +1,122 @@ +{ + "proposals": [ + { + "id": "4", + "proposalId": "4", + "targets": [ + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e" + ], + "values": ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"], + "signatures": [ + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)" + ], + "calldatas": [ + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000197365745265636569766556657273696f6e2875696e7431362900000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000197365745265636569766556657273696f6e2875696e7431362900000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000207365744d61784461696c79526563656976654c696d69742875696e7432353629", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000207365744d61784461696c79526563656976654c696d69742875696e7432353629", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000077061757365282900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000077061757365282900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e0000000000000000000000000000000000000000000000000000000000000026736574436f6e6669672875696e7431362c75696e7431362c75696e743235362c6279746573290000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc000000000000000000000000000000000000000000000000000000000000000026736574436f6e6669672875696e7431362c75696e7431362c75696e743235362c6279746573290000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e000000000000000000000000000000000000000000000000000000000000001761646454696d656c6f636b7328616464726573735b5d29000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc00000000000000000000000000000000000000000000000000000000000000001761646454696d656c6f636b7328616464726573735b5d29000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e000000000000000000000000000000000000000000000000000000000000002772657472794d6573736167652875696e7431362c62797465732c75696e7436342c62797465732900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc00000000000000000000000000000000000000000000000000000000000000002772657472794d6573736167652875696e7431362c62797465732c75696e7436342c62797465732900000000000000000000000000000000000000000000000000" + ], + "executionEta": "1719935819", + "queued": { + "id": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "timestamp": "1719763019", + "txHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f" + }, + "canceled": null, + "executed": { + "id": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "timestamp": "1720520363", + "txHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164" + } + }, + { + "id": "5", + "proposalId": "5", + "targets": [ + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e" + ], + "values": ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"], + "signatures": [ + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)" + ], + "calldatas": [ + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000197365745265636569766556657273696f6e2875696e7431362900000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000197365745265636569766556657273696f6e2875696e7431362900000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000207365744d61784461696c79526563656976654c696d69742875696e7432353629", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000207365744d61784461696c79526563656976654c696d69742875696e7432353629", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000077061757365282900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000077061757365282900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e0000000000000000000000000000000000000000000000000000000000000026736574436f6e6669672875696e7431362c75696e7431362c75696e743235362c6279746573290000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc000000000000000000000000000000000000000000000000000000000000000026736574436f6e6669672875696e7431362c75696e7431362c75696e743235362c6279746573290000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e000000000000000000000000000000000000000000000000000000000000001761646454696d656c6f636b7328616464726573735b5d29000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc00000000000000000000000000000000000000000000000000000000000000001761646454696d656c6f636b7328616464726573735b5d29000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e000000000000000000000000000000000000000000000000000000000000002772657472794d6573736167652875696e7431362c62797465732c75696e7436342c62797465732900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc00000000000000000000000000000000000000000000000000000000000000002772657472794d6573736167652875696e7431362c62797465732c75696e7436342c62797465732900000000000000000000000000000000000000000000000000" + ], + "executionEta": "1719935819", + "queued": { + "id": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "timestamp": "1719763019", + "txHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f" + }, + "canceled": null, + "executed": { + "id": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "timestamp": "1720520363", + "txHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164" + } + } + ] +} diff --git a/apps/evm/src/__mocks__/subgraph/proposalPreviews.json b/apps/evm/src/__mocks__/subgraph/proposalPreviews.json deleted file mode 100644 index 0debef2227..0000000000 --- a/apps/evm/src/__mocks__/subgraph/proposalPreviews.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "proposals": [ - { - "id": "387", - "type": "NORMAL", - "startBlock": "38562925", - "endBlock": "38563075", - "description": "{\"version\":\"v2\",\"title\":\"VIP-Gateway Update VToken and comptroller implementation in IL and Core Pool and introduces the NativeTokenGateway contract\",\"description\":\"\\n This VIP does the following:\\n 1. Updates the implementation of all VTokens and Comptroller market facet in Core Pool\\n 2. Updates the implementation of VTokens and Comptrollers in IL\\n 3. Accepts the ownership of the NativeTokenGateway contract\\n 4. Gives call permissions to Timelocks for seizeVenus function\\n 5. Sets XVS and vXVS address in unitroller\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", - "executionEta": "1710401648", - "forVotes": "605462000000000000000000", - "againstVotes": "205462000000000000000000", - "abstainVotes": "105462000000000000000000", - "passing": true, - "queued": { - "id": "0xed91af360f4a049702ec62c470f67b14abd375cd2ed38313e35c2de3d9cbb464", - "timestamp": "1710401048" - }, - "canceled": null, - "executed": { - "id": "0xc86a942be218b162f0b8d628559628edd4038ba8887adb72179b9953a4e605f2", - "timestamp": "1710401912" - }, - "votes": [ - { - "id": "0x3d759121234cd36F8124C21aFe1c6852d2bEd848-387", - "support": "FOR" - } - ] - }, - { - "id": "386", - "type": "NORMAL", - "startBlock": "38339824", - "endBlock": "38339974", - "description": "{\"version\":\"v2\",\"title\":\"VIP-Gateway Update VToken and comptroller implementation in IL and Core Pool and introduces the NativeTokenGateway contract\",\"description\":\"\\n This VIP does the following:\\n 1. Updates the implementation of all VTokens and Comptroller market facet in Core Pool\\n 2. Sets the AccessControlManager, ProtocolShareReserve and ReduceReservesBlockDelta in vTRX, vUST and vLUNA\\n 3. Updates the implementation of VTokens and Comptrollers in IL\\n 4. Accepts the ownership of the NativeTokenGateway contract\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", - "executionEta": "1709732032", - "forVotes": "605462000000000000000000", - "againstVotes": "0", - "abstainVotes": "0", - "passing": true, - "queued": { - "id": "0xbd3caa046785f30bbb9c971e2c94e59f243bad0ccd343275339841f2ceb20c1f", - "timestamp": "1709731432" - }, - "canceled": null, - "executed": { - "id": "0x8ac46df38865327edf072672e5610a5ea0cc8c28f031105a011212d0b94a3a59", - "timestamp": "1709732308" - }, - "votes": [ - { - "id": "0x3d759121234cd36F8124C21aFe1c6852d2bEd848-386", - "support": "FOR" - } - ] - }, - { - "id": "385", - "type": "NORMAL", - "startBlock": "38133159", - "endBlock": "38133309", - "description": "{\"version\":\"v2\",\"title\":\"VIP-Converter2 upgrades the implementation of token converters\",\"description\":\"\\n This VIP upgrades the implementation of RiskFundConverter and SingleTokenConverter.\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", - "executionEta": "1709111182", - "forVotes": "605462000000000000000000", - "againstVotes": "0", - "abstainVotes": "0", - "passing": true, - "queued": { - "id": "0x54a79961780d606be0b437a127e99996b24b2f7f4cc381b8b3e42f9d5b8b44bc", - "timestamp": "1709110582" - }, - "canceled": null, - "executed": { - "id": "0x1cec43ba48f05a3daf10eb60db1e6ded1d980aef37513ffc5f38694a0d1f0959", - "timestamp": "1709111701" - }, - "votes": [ - { - "id": "0x3d759121234cd36F8124C21aFe1c6852d2bEd848-385", - "support": "FOR" - } - ] - }, - { - "id": "384", - "type": "NORMAL", - "startBlock": "38132843", - "endBlock": "38132993", - "description": "{\"version\":\"v2\",\"title\":\"VIP-Converter2 upgrades the implementation of token converters\",\"description\":\"\\n This VIP upgrades the implementation of RiskFundConverter and SingleTokenConverter.\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", - "executionEta": null, - "forVotes": "0", - "againstVotes": "0", - "abstainVotes": "0", - "passing": false, - "queued": null, - "canceled": null, - "executed": null, - "votes": [] - }, - { - "id": "383", - "type": "NORMAL", - "startBlock": "37973958", - "endBlock": "37974108", - "description": "{\"version\":\"v2\",\"title\":\"VIP-260 WBETH (Core Pool) - increase borrow cap to 4,000\",\"description\":\"#### Description\\nThe borrow cap for WBETH on Venus Core Pool is currently at 100% utilization.\\n\\nThere is currently a single user borrowing 1.06k WBETH, amounting to 53% of the total borrows of the asset. The user is currently borrowing $8.19M (in WBETH and USDT) against his $13.2M BTCB collateral, bringing his health score to 1.29.\\n\\nUtilizing our supply and borrow cap methodology, Chaos Labs recommends doubling the borrow cap, setting it at 4K WBETH.\\n\\n#### References\\n* [VIP Simulation](https://github.com/VenusProtocol/vips/pull/214)\\n \",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", - "executionEta": "1708633543", - "forVotes": "1205465794983200000000000", - "againstVotes": "0", - "abstainVotes": "0", - "passing": true, - "queued": { - "id": "0x22f905ba476dc08d31f892b52a6093b4e7510910955fd028d9e8824e23b61e48", - "timestamp": "1708632943" - }, - "canceled": null, - "executed": { - "id": "0xba1bda0b3f651800e1eedcca2948d8876484925f8a4cb68827c38c5661870336", - "timestamp": "1708633723" - }, - "votes": [ - { - "id": "0x3d759121234cd36F8124C21aFe1c6852d2bEd848-383", - "support": "FOR" - } - ] - }, - { - "id": "382", - "type": "NORMAL", - "startBlock": "37967851", - "endBlock": "37968001", - "description": "{\"version\":\"v2\",\"title\":\"VIP-260 Configure VAI Price\",\"description\":\"Configure VAI Price\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds with this proposal\"}", - "executionEta": "1708615224", - "forVotes": "605462000000000000000000", - "againstVotes": "0", - "abstainVotes": "0", - "passing": true, - "queued": { - "id": "0xb9e4739e4c108fb67b14d319b288bdea541320ec123908c63388ab879725db8e", - "timestamp": "1708614624" - }, - "canceled": null, - "executed": { - "id": "0x4a99d9ef66b088b58975119b78494b790f3e9c82ac7723fa503c56dd4da7d7a4", - "timestamp": "1708615362" - }, - "votes": [ - { - "id": "0x3d759121234cd36F8124C21aFe1c6852d2bEd848-382", - "support": "FOR" - } - ] - }, - { - "id": "381", - "type": "FAST_TRACK", - "startBlock": "37940962", - "endBlock": "37941062", - "description": "{\"version\":\"v2\",\"title\":\"VIP-260 WBETH (Core Pool) - increase borrow cap to 4,000\",\"description\":\"\\nThe borrow cap for WBETH on Venus Core Pool is currently at 100% utilization.\\n\\nThere is currently a single user borrowing 1.06k WBETH, amounting to 53% of the total borrows of the asset. The user is currently borrowing $8.19M (in WBETH and USDT) against his $13.2M BTCB collateral, bringing his health score to 1.29.\\n\\nUtilizing our supply and borrow cap methodology, Chaos Labs recommends doubling the borrow cap, setting it at 4K WBETH.\\n\\n#### References\\n* [VIP Simulation](https://github.com/VenusProtocol/vips/pull/180)\\n \",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", - "executionEta": "1708534089", - "forVotes": "700103849974598612445922", - "againstVotes": "0", - "abstainVotes": "0", - "passing": true, - "queued": { - "id": "0xf0c7cd8d4a4c5f3cc0ba6b77a254a8dc04dee1d0c2931cc6839627f53ae9e558", - "timestamp": "1708533789" - }, - "canceled": null, - "executed": null, - "votes": [] - }, - { - "id": "380", - "type": "FAST_TRACK", - "startBlock": "37940542", - "endBlock": "37940642", - "description": "{\"version\":\"v2\",\"title\":\"VIP-260 WBETH (Core Pool) - increase borrow cap to 4,000\",\"description\":\"\\nThe borrow cap for WBETH on Venus Core Pool is currently at 100% utilization.\\n\\nThere is currently a single user borrowing 1.06k WBETH, amounting to 53% of the total borrows of the asset. The user is currently borrowing $8.19M (in WBETH and USDT) against his $13.2M BTCB collateral, bringing his health score to 1.29.\\n\\nUtilizing our supply and borrow cap methodology, Chaos Labs recommends doubling the borrow cap, setting it at 4K WBETH.\\n\\n#### References\\n* [VIP Simulation](https://github.com/VenusProtocol/vips/pull/180)\\n \",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", - "executionEta": null, - "forVotes": "300000000000000000000000", - "againstVotes": "0", - "abstainVotes": "0", - "passing": true, - "queued": null, - "canceled": null, - "executed": null, - "votes": [] - }, - { - "id": "379", - "type": "NORMAL", - "startBlock": "37909739", - "endBlock": "37909889", - "description": "{\"version\":\"v2\",\"title\":\"VIP-Converter upgrades the implementation of token converter and sets the PSR address in liquidator contract.\",\"description\":\"\\n 1. This VIP upgrades the implementation of RiskFundConverter, SingleTokenConverter.\\n 2. This VIP sets the address of the PSR in the Liquidator contract.\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", - "executionEta": "1708441100", - "forVotes": "605462000000000000000000", - "againstVotes": "0", - "abstainVotes": "0", - "passing": true, - "queued": { - "id": "0x98ba69ae37530e8fecfe56d020cd8e71ef79299c85b03b165436023e3b1667de", - "timestamp": "1708440500" - }, - "canceled": null, - "executed": { - "id": "0x0f8aa400d7de5c91d63214a84f97022083361be001a129802cd1ad82738313a2", - "timestamp": "1708455618" - }, - "votes": [ - { - "id": "0x3d759121234cd36F8124C21aFe1c6852d2bEd848-379", - "support": "FOR" - } - ] - }, - { - "id": "378", - "type": "NORMAL", - "startBlock": "37909296", - "endBlock": "37909446", - "description": "{\"version\":\"v2\",\"title\":\"VIP-Converter upgrades the implementation of token converter\",\"description\":\"\\n This VIP upgrades the implementation of RiskFundConverter and SingleTokenConverter\",\"forDescription\":\"I agree that Venus Protocol should proceed with this proposal\",\"againstDescription\":\"I do not think that Venus Protocol should proceed with this proposal\",\"abstainDescription\":\"I am indifferent to whether Venus Protocol proceeds or not\"}", - "executionEta": null, - "forVotes": "0", - "againstVotes": "0", - "abstainVotes": "0", - "passing": false, - "queued": null, - "canceled": null, - "executed": null, - "votes": [] - } - ], - "total": [ - { - "id": "387" - } - ] -} diff --git a/apps/evm/src/clients/api/__mocks__/index.ts b/apps/evm/src/clients/api/__mocks__/index.ts index 07371a232c..7a026130ab 100644 --- a/apps/evm/src/clients/api/__mocks__/index.ts +++ b/apps/evm/src/clients/api/__mocks__/index.ts @@ -7,14 +7,13 @@ import fakeContractTransaction from '__mocks__/models/contractTransaction'; import { markets } from '__mocks__/models/markets'; import { poolData } from '__mocks__/models/pools'; import { primeEstimationData } from '__mocks__/models/primeEstimation'; -import proposals from '__mocks__/models/proposals'; import vTokens from '__mocks__/models/vTokens'; import { vaults } from '__mocks__/models/vaults'; import voters from '__mocks__/models/voters'; import FunctionKey from 'constants/functionKey'; -import { proposalPreviews } from '__mocks__/models/proposalPreviews'; +import { proposals } from '__mocks__/models/proposals'; import type { Token } from 'types'; import type { GetBalanceOfInput } from '../queries/getBalanceOf'; import type { GetTokenBalancesInput } from '../queries/getTokenBalances'; @@ -316,13 +315,14 @@ export const useGetCurrentVotes = vi.fn(() => }), ); -export const getProposalPreviews = vi.fn(async () => ({ - proposalPreviews, +export const getProposals = vi.fn(async () => ({ + proposals, + total: 100, })); -export const useGetProposalPreviews = vi.fn(() => +export const useGetProposals = vi.fn(() => useQuery({ - queryKey: [FunctionKey.GET_PROPOSAL_PREVIEWS], - queryFn: getProposalPreviews, + queryKey: [FunctionKey.GET_PROPOSALS], + queryFn: getProposals, }), ); @@ -733,28 +733,31 @@ export const useCreateProposal = (options?: MutationObserverOptions) => }); export const cancelProposal = vi.fn(async () => fakeContractTransaction); -export const useCancelProposal = (options?: MutationObserverOptions) => +export const useCancelProposal = vi.fn((options?: MutationObserverOptions) => useMutation({ mutationKey: [FunctionKey.CANCEL_PROPOSAL], mutationFn: cancelProposal, ...options, - }); + }), +); export const executeProposal = vi.fn(async () => fakeContractTransaction); -export const useExecuteProposal = (options?: MutationObserverOptions) => +export const useExecuteProposal = vi.fn((options?: MutationObserverOptions) => useMutation({ mutationKey: [FunctionKey.EXECUTE_PROPOSAL], mutationFn: executeProposal, ...options, - }); + }), +); export const queueProposal = vi.fn(async () => fakeContractTransaction); -export const useQueueProposal = (options?: MutationObserverOptions) => +export const useQueueProposal = vi.fn((options?: MutationObserverOptions) => useMutation({ mutationKey: [FunctionKey.QUEUE_PROPOSAL], mutationFn: queueProposal, ...options, - }); + }), +); export const stakeInXvsVault = vi.fn(); export const useStakeInXvsVault = (_variables: never, options?: MutationObserverOptions) => diff --git a/apps/evm/src/clients/api/index.ts b/apps/evm/src/clients/api/index.ts index af737e9efd..ccb4b339f9 100644 --- a/apps/evm/src/clients/api/index.ts +++ b/apps/evm/src/clients/api/index.ts @@ -255,12 +255,11 @@ export { default as useGetXvsVaultLockedDeposits } from './queries/getXvsVaultLo export { default as useGetVaults } from './queries/useGetVaults'; -export * from './queries/getProposalPreviews'; -export * from './queries/getProposalPreviews/useGetProposalPreviews'; +export * from './queries/getProposals'; +export * from './queries/getProposals/useGetProposals'; -export { default as getProposal } from './queries/getProposal'; export * from './queries/getProposal'; -export { default as useGetProposal } from './queries/getProposal/useGetProposal'; +export * from './queries/getProposal/useGetProposal'; export { default as getVoteReceipt } from './queries/getVoteReceipt'; export * from './queries/getVoteReceipt'; diff --git a/apps/evm/src/clients/api/mutations/cancelProposal/useCancelProposal.ts b/apps/evm/src/clients/api/mutations/cancelProposal/useCancelProposal.ts index 8581c52ee4..4a1da38ed6 100644 --- a/apps/evm/src/clients/api/mutations/cancelProposal/useCancelProposal.ts +++ b/apps/evm/src/clients/api/mutations/cancelProposal/useCancelProposal.ts @@ -23,7 +23,7 @@ const useCancelProposal = (options?: Partial) => { ), onConfirmed: ({ input }) => { queryClient.invalidateQueries({ - queryKey: [FunctionKey.GET_PROPOSAL_PREVIEWS], + queryKey: [FunctionKey.GET_PROPOSALS], }); queryClient.invalidateQueries({ queryKey: [ diff --git a/apps/evm/src/clients/api/mutations/createProposal/useCreateProposal.ts b/apps/evm/src/clients/api/mutations/createProposal/useCreateProposal.ts index eedd160bd8..df701c6682 100644 --- a/apps/evm/src/clients/api/mutations/createProposal/useCreateProposal.ts +++ b/apps/evm/src/clients/api/mutations/createProposal/useCreateProposal.ts @@ -22,7 +22,7 @@ const useCreateProposal = (options?: Partial) => { ), onConfirmed: async () => { queryClient.invalidateQueries({ - queryKey: [FunctionKey.GET_PROPOSAL_PREVIEWS], + queryKey: [FunctionKey.GET_PROPOSALS], }); }, options, diff --git a/apps/evm/src/clients/api/mutations/executeProposal/index.spec.ts b/apps/evm/src/clients/api/mutations/executeProposal/index.spec.ts index de69fa6eff..a19c5fdf41 100644 --- a/apps/evm/src/clients/api/mutations/executeProposal/index.spec.ts +++ b/apps/evm/src/clients/api/mutations/executeProposal/index.spec.ts @@ -6,16 +6,16 @@ import executeProposal from '.'; describe('executeProposal', () => { test('returns contract transaction when request succeeds', async () => { - const executeProposalMock = vi.fn(async () => fakeContractTransaction); + const executeMock = vi.fn(async () => fakeContractTransaction); const fakeContract = { - execute: executeProposalMock, + execute: executeMock, } as unknown as GovernorBravoDelegate; const fakeProposalId = 3816; const response = executeProposal({ - governorBravoDelegateContract: fakeContract, + contract: fakeContract, proposalId: fakeProposalId, }); diff --git a/apps/evm/src/clients/api/mutations/executeProposal/index.ts b/apps/evm/src/clients/api/mutations/executeProposal/index.ts index bd4d266322..8dc7388a97 100644 --- a/apps/evm/src/clients/api/mutations/executeProposal/index.ts +++ b/apps/evm/src/clients/api/mutations/executeProposal/index.ts @@ -1,18 +1,21 @@ -import type { GovernorBravoDelegate } from 'libs/contracts'; +import type { GovernorBravoDelegate, OmnichainGovernanceExecutor } from 'libs/contracts'; import type { ContractTxData } from 'types'; export interface ExecuteProposalInput { - governorBravoDelegateContract: GovernorBravoDelegate; + contract: GovernorBravoDelegate | OmnichainGovernanceExecutor; proposalId: number; } -export type ExecuteProposalOutput = ContractTxData; +export type ExecuteProposalOutput = ContractTxData< + GovernorBravoDelegate | OmnichainGovernanceExecutor, + 'execute' +>; const executeProposal = ({ - governorBravoDelegateContract, + contract, proposalId, }: ExecuteProposalInput): ExecuteProposalOutput => ({ - contract: governorBravoDelegateContract, + contract, methodName: 'execute', args: [proposalId], }); diff --git a/apps/evm/src/clients/api/mutations/executeProposal/useExecuteProposal.ts b/apps/evm/src/clients/api/mutations/executeProposal/useExecuteProposal.ts index 9aecfa4d90..115b8a72a7 100644 --- a/apps/evm/src/clients/api/mutations/executeProposal/useExecuteProposal.ts +++ b/apps/evm/src/clients/api/mutations/executeProposal/useExecuteProposal.ts @@ -1,10 +1,19 @@ import { type ExecuteProposalInput, executeProposal, queryClient } from 'clients/api'; import FunctionKey from 'constants/functionKey'; import { type UseSendTransactionOptions, useSendTransaction } from 'hooks/useSendTransaction'; -import { useGetGovernorBravoDelegateContract } from 'libs/contracts'; +import { + getOmnichainGovernanceExecutorContract, + useGetGovernorBravoDelegateContract, +} from 'libs/contracts'; +import { VError } from 'libs/errors'; +import { governanceChain, useSigner } from 'libs/wallet'; +import type { ChainId } from 'types'; import { callOrThrow } from 'utilities'; -type TrimmedExecuteProposalInput = Omit; +type TrimmedExecuteProposalInput = Omit; +type Input = TrimmedExecuteProposalInput & { + chainId: ChainId; +}; type Options = UseSendTransactionOptions; const useExecuteProposal = (options?: Partial) => { @@ -12,19 +21,35 @@ const useExecuteProposal = (options?: Partial) => { passSigner: true, }); + const { signer } = useSigner(); + return useSendTransaction({ fnKey: [FunctionKey.EXECUTE_PROPOSAL], - fn: (input: TrimmedExecuteProposalInput) => - callOrThrow({ governorBravoDelegateContract }, params => + fn: (input: Input) => { + if (!signer) { + throw new VError({ type: 'unexpected', code: 'somethingWentWrong' }); + } + + const contract = + input.chainId === governanceChain.id + ? governorBravoDelegateContract + : getOmnichainGovernanceExecutorContract({ + signerOrProvider: signer, + chainId: input.chainId, + }); + + return callOrThrow({ contract }, params => executeProposal({ ...input, ...params, }), - ), + ); + }, onConfirmed: async ({ input }) => { queryClient.invalidateQueries({ - queryKey: [FunctionKey.GET_PROPOSAL_PREVIEWS], + queryKey: [FunctionKey.GET_PROPOSALS], }); + queryClient.invalidateQueries({ queryKey: [ FunctionKey.GET_PROPOSAL, diff --git a/apps/evm/src/clients/api/mutations/queueProposal/useQueueProposal.ts b/apps/evm/src/clients/api/mutations/queueProposal/useQueueProposal.ts index 026fba43d9..13df494089 100644 --- a/apps/evm/src/clients/api/mutations/queueProposal/useQueueProposal.ts +++ b/apps/evm/src/clients/api/mutations/queueProposal/useQueueProposal.ts @@ -23,7 +23,7 @@ const useQueueProposal = (options?: Partial) => { ), onConfirmed: ({ input }) => { queryClient.invalidateQueries({ - queryKey: [FunctionKey.GET_PROPOSAL_PREVIEWS], + queryKey: [FunctionKey.GET_PROPOSALS], }); queryClient.invalidateQueries({ queryKey: [ diff --git a/apps/evm/src/clients/api/mutations/vote/useCastVote.ts b/apps/evm/src/clients/api/mutations/vote/useCastVote.ts index 2746823e3e..ee25021742 100644 --- a/apps/evm/src/clients/api/mutations/vote/useCastVote.ts +++ b/apps/evm/src/clients/api/mutations/vote/useCastVote.ts @@ -28,6 +28,7 @@ const useCastVote = (options?: Partial) => { ), onConfirmed: async ({ input }) => { const { proposalId, voteType } = input; + const accountAddress = await governorBravoDelegateContract?.signer.getAddress(); captureAnalyticEvent('Vote cast', { proposalId, @@ -45,8 +46,27 @@ const useCastVote = (options?: Partial) => { ], }); - // Invalidate query to fetch proposal list - queryClient.invalidateQueries({ queryKey: [FunctionKey.GET_PROPOSAL_PREVIEWS] }); + // Invalidate queries to fetch user vote + queryClient.invalidateQueries({ + queryKey: [ + FunctionKey.GET_VOTE_RECEIPT, + { + proposalId, + accountAddress, + }, + ], + }); + + // Invalidate queries to fetch proposal + queryClient.invalidateQueries({ queryKey: [FunctionKey.GET_PROPOSALS] }); + queryClient.invalidateQueries({ + queryKey: [ + FunctionKey.GET_PROPOSAL, + { + id: input.proposalId, + }, + ], + }); }, options, }); diff --git a/apps/evm/src/clients/api/mutations/vote/useCastVoteWithReason.ts b/apps/evm/src/clients/api/mutations/vote/useCastVoteWithReason.ts index f1fd49a141..5949ef27f2 100644 --- a/apps/evm/src/clients/api/mutations/vote/useCastVoteWithReason.ts +++ b/apps/evm/src/clients/api/mutations/vote/useCastVoteWithReason.ts @@ -48,8 +48,16 @@ const useCastVoteWithReason = (options?: Partial) => { ], }); - // Invalidate query to fetch proposal list - queryClient.invalidateQueries({ queryKey: [FunctionKey.GET_PROPOSAL_PREVIEWS] }); + // Invalidate queries to fetch proposal + queryClient.invalidateQueries({ queryKey: [FunctionKey.GET_PROPOSALS] }); + queryClient.invalidateQueries({ + queryKey: [ + FunctionKey.GET_PROPOSAL, + { + id: input.proposalId, + }, + ], + }); }, options, }); diff --git a/apps/evm/src/clients/api/queries/getProposal/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/api/queries/getProposal/__tests__/__snapshots__/index.spec.ts.snap index b003ac7b81..2f31c8342c 100644 --- a/apps/evm/src/clients/api/queries/getProposal/__tests__/__snapshots__/index.spec.ts.snap +++ b/apps/evm/src/clients/api/queries/getProposal/__tests__/__snapshots__/index.spec.ts.snap @@ -1,49 +1,146 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`api/queries/getProposal > returns proposal 1`] = ` +exports[`getProposal > returns proposal in the correct format 1`] = ` { - "abstainVotes": [], - "abstainedVotesMantissa": "0", - "againstVotes": [], - "againstVotesMantissa": "0", - "cancelDate": undefined, - "cancelTxHash": undefined, - "createdDate": 2023-09-20T07:39:35.000Z, - "createdTxHash": "0xb8a70919dbf83e5c63af8efbad418b2a81ca9f4937b12f806482581abaf03b65", - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds with the Comptroller upgradation or not", - "againstDescription": "I do not think that Venus Protocol should proceed with the Comptroller contract upgradation", - "description": "This vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented.", - "forDescription": "I agree that Venus Protocol should proceed with the upgrading the Comptroller contract with diamond proxy", - "title": "VIP Comptroller Diamond proxy", - "version": "v1", - }, - "endBlock": 33499859, - "endDate": 2023-09-20T07:54:35.000Z, - "etaDate": undefined, - "executedDate": undefined, - "executedTxHash": undefined, - "forVotes": [ - { - "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "blockNumber": 33335869, - "blockTimestamp": 1970-01-20T14:45:04.478Z, - "proposalId": 98, - "reason": "", - "support": 1, - "votesMantissa": "6.05461e+23", + "proposal": { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-10-01T11:58:15.000Z, + "createdTxHash": "0xcfafe0fcb0ed8ba08a454be1c05d0883287b76457cf0fae93d07f0131d565e49", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "#### Description + Mint faucet on all network", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "Test VIP", + "version": "v2", }, - ], - "forVotesMantissa": "6.05461e+23", - "proposalActions": [], - "proposalId": 98, - "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", - "queuedDate": undefined, - "queuedTxHash": undefined, - "startDate": 2023-09-20T07:47:05.000Z, - "state": 3, - "totalVotesMantissa": "6.05461e+23", - "userVoteSupport": undefined, + "endBlock": 44354696, + "endDate": 2028-06-01T09:48:50.000Z, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 1970-01-01T00:00:00.000Z, + "expiredDate": undefined, + "forVotes": [], + "forVotesMantissa": "0", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "allocateTo(address,uint256)", + "target": "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027da000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + ], + "proposalId": 436, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposals": [ + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0xf3118a17863996b9f2a073c9a66faaa664355cf8", + "value": "0", + }, + ], + "proposalId": 436, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 5611, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x8ac9b3801d0a8f5055428ae0bf301ca1da976855", + "value": "0", + }, + ], + "proposalId": 436, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 421614, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x772d68929655ce7234c8c94256526dda66ef641e", + "value": "0", + }, + ], + "proposalId": 436, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + ], + "startDate": 2028-06-01T09:41:20.000Z, + "state": 0, + "totalVotesMantissa": "0", + "userVoteSupport": undefined, + }, } `; diff --git a/apps/evm/src/clients/api/queries/getProposal/__tests__/index.spec.ts b/apps/evm/src/clients/api/queries/getProposal/__tests__/index.spec.ts index faea7d20ef..eecaf563ed 100644 --- a/apps/evm/src/clients/api/queries/getProposal/__tests__/index.spec.ts +++ b/apps/evm/src/clients/api/queries/getProposal/__tests__/index.spec.ts @@ -1,30 +1,38 @@ +import BigNumber from 'bignumber.js'; +import { getBscProposal } from 'clients/subgraph'; +import { ChainId } from 'types'; import type Vi from 'vitest'; +import { type GetProposalInput, getProposal } from '..'; + +const fakeParams: GetProposalInput = { + proposalId: 1, + chainId: ChainId.BSC_TESTNET, + currentBlockNumber: 1, + proposalMinQuorumVotesMantissa: new BigNumber(10), +}; + +describe('getProposal', () => { + beforeEach(() => { + vi.useFakeTimers().setSystemTime(new Date(1710401645000)); + }); -import proposalResponse from '__mocks__/api/proposals.json'; - -import { restService } from 'utilities'; - -import getProposal from '..'; - -vi.mock('utilities/restService'); - -describe('api/queries/getProposal', () => { - test('returns proposal', async () => { - (restService as Vi.Mock).mockImplementationOnce(async () => ({ - status: 200, - data: proposalResponse.result[0], + it('throws an error if proposal was not found', async () => { + (getBscProposal as Vi.Mock).mockImplementation(() => ({ + proposal: undefined, })); - const response = await getProposal({ - proposalId: 1, - accountAddress: undefined, - }); + try { + await getProposal(fakeParams); + + throw new Error('getProposal should have thrown an error but did not'); + } catch (error) { + expect(error).toMatchInlineSnapshot('[Error: proposalNotFound]'); + } + }); - expect(restService).toBeCalledWith({ - endpoint: '/governance/proposals/1', - method: 'GET', - }); + it('returns proposal in the correct format', async () => { + const res = await getProposal(fakeParams); - expect(response).toMatchSnapshot(); + expect(res).toMatchSnapshot(); }); }); diff --git a/apps/evm/src/clients/api/queries/getProposal/index.ts b/apps/evm/src/clients/api/queries/getProposal/index.ts index ba642e8db6..38037c5193 100644 --- a/apps/evm/src/clients/api/queries/getProposal/index.ts +++ b/apps/evm/src/clients/api/queries/getProposal/index.ts @@ -1,35 +1,62 @@ +import type BigNumber from 'bignumber.js'; +import { + type GetBscProposalInput as GetBscGqlProposalInput, + enrichRemoteProposals, + formatToProposal, + getBscProposal, +} from 'clients/subgraph'; import { VError } from 'libs/errors'; -import { formatToProposal, restService } from 'utilities'; - -import type { GetProposalInput, GetProposalOutput, ProposalApiResponse } from './types'; - -export * from './types'; +import type { ChainId, Proposal } from 'types'; + +export interface GetProposalInput { + proposalId: number; + chainId: ChainId; + currentBlockNumber: number; + proposalMinQuorumVotesMantissa: BigNumber; + accountAddress?: string; +} + +export type GetProposalOutput = { + proposal?: Proposal; +}; -const getProposal = async ({ +export const getProposal = async ({ proposalId, - accountAddress = '', + chainId, + currentBlockNumber, + proposalMinQuorumVotesMantissa, + accountAddress, }: GetProposalInput): Promise => { - const response = await restService({ - endpoint: `/governance/proposals/${proposalId}`, - method: 'GET', + const variables: GetBscGqlProposalInput['variables'] = { + id: proposalId.toString(), + }; + + const response = await getBscProposal({ + chainId, + variables, }); - const payload = response.data; + const gqlProposal = response?.proposal; - // @todo Add specific api error handling - if (payload && 'error' in payload) { + if (!gqlProposal) { throw new VError({ - type: 'unexpected', - code: 'somethingWentWrong', - data: { message: payload.error }, + type: 'proposal', + code: 'proposalNotFound', }); } - if (!payload) { - throw new VError({ type: 'unexpected', code: 'somethingWentWrong' }); - } + // Fetch remote proposals + const gqlRemoteProposalsMapping = await enrichRemoteProposals({ + gqlRemoteProposals: gqlProposal.remoteProposals, + }); - return formatToProposal({ ...payload, accountAddress }); -}; + const proposal = formatToProposal({ + gqlProposal, + gqlRemoteProposalsMapping, + proposalMinQuorumVotesMantissa, + currentBlockNumber, + accountAddress, + }); -export default getProposal; + return { proposal }; +}; diff --git a/apps/evm/src/clients/api/queries/getProposal/types.ts b/apps/evm/src/clients/api/queries/getProposal/types.ts deleted file mode 100644 index 471e2bf914..0000000000 --- a/apps/evm/src/clients/api/queries/getProposal/types.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { Proposal, ProposalState, ProposalType, VoteSupport } from 'types'; - -export interface GetProposalInput { - proposalId: number | string; - accountAddress: string | undefined; -} - -export interface ProposalActionApiResponse { - actionIndex: number; - calldata: string; - signature: string; - target: string; - value: string | null; -} - -type VoterApiResponse = { - proposalId: number; - address: string; - blockNumber: number; - blockTimestamp: number; - reason: string | undefined; - votesMantissa: string; - support: VoteSupport; -}; - -export interface ProposalApiResponse { - abstainedVotesMantissa: string; - againstVotesMantissa: string; - cancelBlock: number | null; - cancelTimestamp: number | null; - cancelTxHash: string | null; - createdBlock: number | null; - createdTimestamp: number | null; - createdTxHash: string | null; - description: string; - endBlock: number; - endTimestamp: number; - eta: number | null; - executedBlock: number | null; - executedTimestamp: number | null; - executedTxHash: string | null; - forVotesMantissa: string; - governorName: string; - proposer: string; - queuedBlock: number | null; - queuedTimestamp: number | null; - queuedTxHash: string | null; - startBlock: number; - startTimestamp: number; - state: ProposalState; - proposalType: ProposalType; - proposalId: number; - proposalActions: ProposalActionApiResponse[] | undefined; - votes: VoterApiResponse[] | undefined; -} - -export type GetProposalOutput = Proposal; diff --git a/apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/__tests__/__snapshots__/index.spec.ts.snap new file mode 100644 index 0000000000..80d3ce9b22 --- /dev/null +++ b/apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/__tests__/__snapshots__/index.spec.ts.snap @@ -0,0 +1,192 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`useGetCachedProposal > returns proposal from cache when it exists 1`] = ` +{ + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "createdDate": 2023-09-20T07:39:35.000Z, + "createdTxHash": "0xb8a70919dbf83e5c63af8efbad418b2a81ca9f4937b12f806482581abaf03b65", + "description": { + "description": "This vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented.", + "title": "VIP Comptroller Diamond proxy", + "version": "v1", + }, + "endBlock": 33499859, + "endDate": 2023-09-20T07:54:35.000Z, + "executedDate": 2023-09-21T07:54:35.000Z, + "executionEtaDate": 2023-09-21T06:54:35.000Z, + "forVotes": [ + { + "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposalId": 98, + "reason": "", + "support": 1, + "votesMantissa": "6.05461e+23", + }, + ], + "forVotesMantissa": "6.05461e+23", + "proposalActions": [], + "proposalId": 98, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": 2023-09-20T09:54:35.000Z, + "remoteProposals": [ + { + "bridgedDate": 2023-02-01T00:00:00.000Z, + "chainId": 97, + "executedDate": 2023-02-01T00:00:00.000Z, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + ], + "proposalId": 1, + "queuedDate": 2023-02-01T00:00:00.000Z, + "remoteProposalId": 1, + "state": 5, + }, + { + "bridgedDate": 2023-02-01T00:00:00.000Z, + "chainId": 5611, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + ], + "proposalId": 2, + "queuedDate": 2023-02-01T00:00:00.000Z, + "remoteProposalId": 2, + "state": 1, + }, + { + "bridgedDate": 2023-02-01T00:00:00.000Z, + "chainId": 11155111, + "executionEtaDate": 2089-02-01T00:00:00.000Z, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + ], + "proposalId": 3, + "queuedDate": 2023-02-01T00:00:00.000Z, + "remoteProposalId": 3, + "state": 2, + }, + { + "bridgedDate": 2023-02-01T00:00:00.000Z, + "chainId": 11155111, + "executionEtaDate": 2023-02-01T00:00:00.000Z, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + ], + "proposalId": 4, + "queuedDate": 2023-02-01T00:00:00.000Z, + "remoteProposalId": 4, + "state": 2, + }, + { + "bridgedDate": 2023-02-01T00:00:00.000Z, + "canceledDate": 2023-02-01T00:00:00.000Z, + "chainId": 421614, + "executionEtaDate": 2023-02-01T00:00:00.000Z, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + ], + "proposalId": 6, + "queuedDate": 2023-02-01T00:00:00.000Z, + "remoteProposalId": 6, + "state": 3, + }, + { + "bridgedDate": 2023-02-01T00:00:00.000Z, + "chainId": 421614, + "executedDate": 2023-02-01T00:00:00.000Z, + "executionEtaDate": 2023-02-01T00:00:00.000Z, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + { + "actionIndex": 0, + "callData": "0x", + "signature": "test()", + "target": "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", + "value": "", + }, + ], + "proposalId": 7, + "queuedDate": 2023-02-01T00:00:00.000Z, + "remoteProposalId": 7, + "state": 5, + }, + ], + "startDate": 2023-09-20T07:47:05.000Z, + "state": 7, + "totalVotesMantissa": "6.05461e+23", +} +`; diff --git a/apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/__tests__/index.spec.ts b/apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/__tests__/index.spec.ts new file mode 100644 index 0000000000..cde3fc574b --- /dev/null +++ b/apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/__tests__/index.spec.ts @@ -0,0 +1,49 @@ +import { QueryClient } from '@tanstack/react-query'; +import { proposals as fakeProposals } from '__mocks__/models/proposals'; +import FunctionKey from 'constants/functionKey'; +import { renderHook } from 'testUtils/render'; +import { useGetCachedProposal } from '..'; + +describe('useGetCachedProposal', () => { + it('returns proposal from cache when it exists', async () => { + const fakeQueryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + gcTime: 0, + }, + }, + }); + + fakeQueryClient.getQueriesData = () => [ + [ + [FunctionKey.GET_PROPOSALS], + { + proposals: fakeProposals, + } as any, + ], + ]; + + const { result } = renderHook( + () => + useGetCachedProposal({ + proposalId: fakeProposals[0].proposalId, + }), + { + queryClient: fakeQueryClient, + }, + ); + + expect(result.current).toMatchSnapshot(); + }); + + it('returns undefined if proposal does not exist in cache', async () => { + const { result } = renderHook(() => + useGetCachedProposal({ + proposalId: 0, + }), + ); + + expect(result.current).toBe(undefined); + }); +}); diff --git a/apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/index.ts b/apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/index.ts new file mode 100644 index 0000000000..9bac7ef8ce --- /dev/null +++ b/apps/evm/src/clients/api/queries/getProposal/useGetCachedProposal/index.ts @@ -0,0 +1,24 @@ +import { useQueryClient } from '@tanstack/react-query'; + +import FunctionKey from 'constants/functionKey'; +import type { Proposal } from 'types'; +import type { GetProposalsOutput } from '../../getProposals'; + +export const useGetCachedProposal = ({ proposalId }: { proposalId: number }) => { + const queryClient = useQueryClient(); + const proposalQueryResults = queryClient.getQueriesData({ + queryKey: [FunctionKey.GET_PROPOSALS], + }); + + let cachedProposal: Proposal | undefined; + + proposalQueryResults.forEach(([_queryKey, data]) => + (data?.proposals || []).forEach(proposal => { + if (+proposal.proposalId === proposalId) { + cachedProposal = proposal; + } + }), + ); + + return cachedProposal; +}; diff --git a/apps/evm/src/clients/api/queries/getProposal/useGetProposal.ts b/apps/evm/src/clients/api/queries/getProposal/useGetProposal.ts index eb1cb8237f..3310b8c892 100644 --- a/apps/evm/src/clients/api/queries/getProposal/useGetProposal.ts +++ b/apps/evm/src/clients/api/queries/getProposal/useGetProposal.ts @@ -1,31 +1,86 @@ import { type QueryObserverOptions, useQuery } from '@tanstack/react-query'; -import getProposal from 'clients/api/queries/getProposal'; -import type { GetProposalInput, GetProposalOutput } from 'clients/api/queries/getProposal/types'; +import { + type GetProposalInput, + type GetProposalOutput, + getProposal, +} from 'clients/api/queries/getProposal'; import { CHAIN_METADATA } from 'constants/chainMetadata'; -import { DEFAULT_REFETCH_INTERVAL_MS } from 'constants/defaultRefetchInterval'; import FunctionKey from 'constants/functionKey'; import { governanceChain } from 'libs/wallet'; +import { callOrThrow } from 'utilities'; +import useGetBlockNumber from '../getBlockNumber/useGetBlockNumber'; +import { useGetProposalMinQuorumVotes } from '../getProposalMinQuorumVotes/useGetProposalMinQuorumVotes'; +import { useGetCachedProposal } from './useGetCachedProposal'; -export type UseGetProposalQueryKey = [FunctionKey.GET_PROPOSAL, GetProposalInput]; +type TrimmedGetProposalInput = Omit< + GetProposalInput, + 'currentBlockNumber' | 'proposalMinQuorumVotesMantissa' | 'blockTimeMs' | 'chainId' +>; type Options = QueryObserverOptions< GetProposalOutput, Error, GetProposalOutput, GetProposalOutput, - UseGetProposalQueryKey + [ + FunctionKey.GET_PROPOSAL, + Omit, + ] >; -const useGetProposal = (params: GetProposalInput, options?: Partial) => { - const { blockTimeMs } = CHAIN_METADATA[governanceChain.id]; +const { blockTimeMs: BSC_BLOCK_TIME_MS } = CHAIN_METADATA[governanceChain.id]; + +export const useGetProposal = (input: TrimmedGetProposalInput, options?: Partial) => { + const { data: getProposalMinQuorumVotesData } = useGetProposalMinQuorumVotes(); + const proposalMinQuorumVotesMantissa = + getProposalMinQuorumVotesData?.proposalMinQuorumVotesMantissa; + + const { data: getBlockNumberData } = useGetBlockNumber( + { + chainId: governanceChain.id, + }, + { + refetchInterval: BSC_BLOCK_TIME_MS, + }, + ); + const currentBlockNumber = getBlockNumberData?.blockNumber; + + // Initialize proposal using cache if available + const cachedProposal = useGetCachedProposal({ + proposalId: +input.proposalId, + }); return useQuery({ - queryKey: [FunctionKey.GET_PROPOSAL, params], - queryFn: () => getProposal(params), - refetchInterval: blockTimeMs || DEFAULT_REFETCH_INTERVAL_MS, + queryKey: [ + FunctionKey.GET_PROPOSAL, + { + ...input, + chainId: governanceChain.id, + }, + ], + queryFn: () => + callOrThrow( + { + currentBlockNumber, + proposalMinQuorumVotesMantissa, + }, + params => + getProposal({ + ...input, + ...params, + chainId: governanceChain.id, + }), + ), + refetchInterval: BSC_BLOCK_TIME_MS, + initialData: { + proposal: cachedProposal, + }, + refetchOnMount: false, ...options, + enabled: + typeof currentBlockNumber === 'number' && + !!proposalMinQuorumVotesMantissa && + (options?.enabled === undefined || options?.enabled), }); }; - -export default useGetProposal; diff --git a/apps/evm/src/clients/api/queries/getProposalPreviews/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/api/queries/getProposalPreviews/__tests__/__snapshots__/index.spec.ts.snap deleted file mode 100644 index 8ebddfd94a..0000000000 --- a/apps/evm/src/clients/api/queries/getProposalPreviews/__tests__/__snapshots__/index.spec.ts.snap +++ /dev/null @@ -1,424 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`getProposalPreviews > returns proposal previews in the correct format 1`] = ` -{ - "proposalPreviews": [ - { - "abstainedVotesMantissa": "1.05462e+23", - "againstVotesMantissa": "2.05462e+23", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": " - This VIP does the following: - 1. Updates the implementation of all VTokens and Comptroller market facet in Core Pool - 2. Updates the implementation of VTokens and Comptrollers in IL - 3. Accepts the ownership of the NativeTokenGateway contract - 4. Gives call permissions to Timelocks for seizeVenus function - 5. Sets XVS and vXVS address in unitroller", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-Gateway Update VToken and comptroller implementation in IL and Core Pool and introduces the NativeTokenGateway contract", - "version": "v2", - }, - "endDate": 2027-11-13T07:27:47.000Z, - "etaDate": 2024-03-14T07:34:08.000Z, - "executedDate": 2024-03-14T07:38:32.000Z, - "forVotesMantissa": "6.05462e+23", - "proposalId": 387, - "proposalType": 0, - "queuedDate": 2024-03-14T07:24:08.000Z, - "state": 0, - "userVoteSupport": 1, - }, - { - "abstainedVotesMantissa": "0", - "againstVotesMantissa": "0", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": " - This VIP does the following: - 1. Updates the implementation of all VTokens and Comptroller market facet in Core Pool - 2. Sets the AccessControlManager, ProtocolShareReserve and ReduceReservesBlockDelta in vTRX, vUST and vLUNA - 3. Updates the implementation of VTokens and Comptrollers in IL - 4. Accepts the ownership of the NativeTokenGateway contract", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-Gateway Update VToken and comptroller implementation in IL and Core Pool and introduces the NativeTokenGateway contract", - "version": "v2", - }, - "endDate": 2027-11-05T13:32:44.000Z, - "etaDate": 2024-03-06T13:33:52.000Z, - "executedDate": 2024-03-06T13:38:28.000Z, - "forVotesMantissa": "6.05462e+23", - "proposalId": 386, - "proposalType": 0, - "queuedDate": 2024-03-06T13:23:52.000Z, - "state": 0, - "userVoteSupport": 1, - }, - { - "abstainedVotesMantissa": "0", - "againstVotesMantissa": "0", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": " - This VIP upgrades the implementation of RiskFundConverter and SingleTokenConverter.", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-Converter2 upgrades the implementation of token converters", - "version": "v2", - }, - "endDate": 2027-10-29T09:19:29.000Z, - "etaDate": 2024-02-28T09:06:22.000Z, - "executedDate": 2024-02-28T09:15:01.000Z, - "forVotesMantissa": "6.05462e+23", - "proposalId": 385, - "proposalType": 0, - "queuedDate": 2024-02-28T08:56:22.000Z, - "state": 0, - "userVoteSupport": 1, - }, - { - "abstainedVotesMantissa": "0", - "againstVotesMantissa": "0", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": " - This VIP upgrades the implementation of RiskFundConverter and SingleTokenConverter.", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-Converter2 upgrades the implementation of token converters", - "version": "v2", - }, - "endDate": 2027-10-29T09:03:41.000Z, - "etaDate": undefined, - "executedDate": undefined, - "forVotesMantissa": "0", - "proposalId": 384, - "proposalType": 0, - "queuedDate": undefined, - "state": 0, - "userVoteSupport": undefined, - }, - { - "abstainedVotesMantissa": "0", - "againstVotesMantissa": "0", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": "#### Description -The borrow cap for WBETH on Venus Core Pool is currently at 100% utilization. - -There is currently a single user borrowing 1.06k WBETH, amounting to 53% of the total borrows of the asset. The user is currently borrowing $8.19M (in WBETH and USDT) against his $13.2M BTCB collateral, bringing his health score to 1.29. - -Utilizing our supply and borrow cap methodology, Chaos Labs recommends doubling the borrow cap, setting it at 4K WBETH. - -#### References -* [VIP Simulation](https://github.com/VenusProtocol/vips/pull/214) - ", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-260 WBETH (Core Pool) - increase borrow cap to 4,000", - "version": "v2", - }, - "endDate": 2027-10-23T20:39:26.000Z, - "etaDate": 2024-02-22T20:25:43.000Z, - "executedDate": 2024-02-22T20:28:43.000Z, - "forVotesMantissa": "1.2054657949832e+24", - "proposalId": 383, - "proposalType": 0, - "queuedDate": 2024-02-22T20:15:43.000Z, - "state": 0, - "userVoteSupport": 1, - }, - { - "abstainedVotesMantissa": "0", - "againstVotesMantissa": "0", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds with this proposal", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": "Configure VAI Price", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-260 Configure VAI Price", - "version": "v2", - }, - "endDate": 2027-10-23T15:34:05.000Z, - "etaDate": 2024-02-22T15:20:24.000Z, - "executedDate": 2024-02-22T15:22:42.000Z, - "forVotesMantissa": "6.05462e+23", - "proposalId": 382, - "proposalType": 0, - "queuedDate": 2024-02-22T15:10:24.000Z, - "state": 0, - "userVoteSupport": 1, - }, - { - "abstainedVotesMantissa": "0", - "againstVotesMantissa": "0", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": " -The borrow cap for WBETH on Venus Core Pool is currently at 100% utilization. - -There is currently a single user borrowing 1.06k WBETH, amounting to 53% of the total borrows of the asset. The user is currently borrowing $8.19M (in WBETH and USDT) against his $13.2M BTCB collateral, bringing his health score to 1.29. - -Utilizing our supply and borrow cap methodology, Chaos Labs recommends doubling the borrow cap, setting it at 4K WBETH. - -#### References -* [VIP Simulation](https://github.com/VenusProtocol/vips/pull/180) - ", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-260 WBETH (Core Pool) - increase borrow cap to 4,000", - "version": "v2", - }, - "endDate": 2027-10-22T17:07:08.000Z, - "etaDate": 2024-02-21T16:48:09.000Z, - "executedDate": undefined, - "forVotesMantissa": "7.00103849974598612445922e+23", - "proposalId": 381, - "proposalType": 1, - "queuedDate": 2024-02-21T16:43:09.000Z, - "state": 0, - "userVoteSupport": undefined, - }, - { - "abstainedVotesMantissa": "0", - "againstVotesMantissa": "0", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": " -The borrow cap for WBETH on Venus Core Pool is currently at 100% utilization. - -There is currently a single user borrowing 1.06k WBETH, amounting to 53% of the total borrows of the asset. The user is currently borrowing $8.19M (in WBETH and USDT) against his $13.2M BTCB collateral, bringing his health score to 1.29. - -Utilizing our supply and borrow cap methodology, Chaos Labs recommends doubling the borrow cap, setting it at 4K WBETH. - -#### References -* [VIP Simulation](https://github.com/VenusProtocol/vips/pull/180) - ", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-260 WBETH (Core Pool) - increase borrow cap to 4,000", - "version": "v2", - }, - "endDate": 2027-10-22T16:46:08.000Z, - "etaDate": undefined, - "executedDate": undefined, - "forVotesMantissa": "3e+23", - "proposalId": 380, - "proposalType": 1, - "queuedDate": undefined, - "state": 0, - "userVoteSupport": undefined, - }, - { - "abstainedVotesMantissa": "0", - "againstVotesMantissa": "0", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": " - 1. This VIP upgrades the implementation of RiskFundConverter, SingleTokenConverter. - 2. This VIP sets the address of the PSR in the Liquidator contract.", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-Converter upgrades the implementation of token converter and sets the PSR address in liquidator contract.", - "version": "v2", - }, - "endDate": 2027-10-21T15:08:29.000Z, - "etaDate": 2024-02-20T14:58:20.000Z, - "executedDate": 2024-02-20T19:00:18.000Z, - "forVotesMantissa": "6.05462e+23", - "proposalId": 379, - "proposalType": 0, - "queuedDate": 2024-02-20T14:48:20.000Z, - "state": 0, - "userVoteSupport": 1, - }, - { - "abstainedVotesMantissa": "0", - "againstVotesMantissa": "0", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": " - This VIP upgrades the implementation of RiskFundConverter and SingleTokenConverter", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-Converter upgrades the implementation of token converter", - "version": "v2", - }, - "endDate": 2027-10-21T14:46:20.000Z, - "etaDate": undefined, - "executedDate": undefined, - "forVotesMantissa": "0", - "proposalId": 378, - "proposalType": 0, - "queuedDate": undefined, - "state": 0, - "userVoteSupport": undefined, - }, - ], - "total": 1, -} -`; - -exports[`getProposalPreviews > sets "where" parameter correctly based on passed "proposalState" parameter 1`] = ` -{ - "chainId": 97, - "variables": { - "accountAddress": "0x3d759121234cd36f8124c21afe1c6852d2bed848", - "limit": 10, - "skip": 0, - "where": { - "startBlock_gt": 1, - }, - }, -} -`; - -exports[`getProposalPreviews > sets "where" parameter correctly based on passed "proposalState" parameter 2`] = ` -{ - "chainId": 97, - "variables": { - "accountAddress": "0x3d759121234cd36f8124c21afe1c6852d2bed848", - "limit": 10, - "skip": 0, - "where": { - "endBlock_gt": 1, - }, - }, -} -`; - -exports[`getProposalPreviews > sets "where" parameter correctly based on passed "proposalState" parameter 3`] = ` -{ - "chainId": 97, - "variables": { - "accountAddress": "0x3d759121234cd36f8124c21afe1c6852d2bed848", - "limit": 10, - "skip": 0, - "where": { - "canceled_not": null, - }, - }, -} -`; - -exports[`getProposalPreviews > sets "where" parameter correctly based on passed "proposalState" parameter 4`] = ` -{ - "chainId": 97, - "variables": { - "accountAddress": "0x3d759121234cd36f8124c21afe1c6852d2bed848", - "limit": 10, - "skip": 0, - "where": { - "or": [ - { - "canceled": null, - "endBlock_lt": 1, - "passing": false, - }, - { - "or": [ - { - "canceled": null, - "endBlock_lt": 1, - "forVotes_lt": "10", - }, - ], - }, - ], - }, - }, -} -`; - -exports[`getProposalPreviews > sets "where" parameter correctly based on passed "proposalState" parameter 5`] = ` -{ - "chainId": 97, - "variables": { - "accountAddress": "0x3d759121234cd36f8124c21afe1c6852d2bed848", - "limit": 10, - "skip": 0, - "where": { - "canceled": null, - "endBlock_lt": 1, - "executed": null, - "forVotes_gte": "10", - "passing": true, - "queued": null, - }, - }, -} -`; - -exports[`getProposalPreviews > sets "where" parameter correctly based on passed "proposalState" parameter 6`] = ` -{ - "chainId": 97, - "variables": { - "accountAddress": "0x3d759121234cd36f8124c21afe1c6852d2bed848", - "limit": 10, - "skip": 0, - "where": { - "canceled": null, - "executed": null, - "executionEta_gte": "1709192045", - "queued_not": null, - }, - }, -} -`; - -exports[`getProposalPreviews > sets "where" parameter correctly based on passed "proposalState" parameter 7`] = ` -{ - "chainId": 97, - "variables": { - "accountAddress": "0x3d759121234cd36f8124c21afe1c6852d2bed848", - "limit": 10, - "skip": 0, - "where": { - "canceled": null, - "executed": null, - "executionEta_lt": "1709192045", - "queued_not": null, - }, - }, -} -`; - -exports[`getProposalPreviews > sets "where" parameter correctly based on passed "proposalState" parameter 8`] = ` -{ - "chainId": 97, - "variables": { - "accountAddress": "0x3d759121234cd36f8124c21afe1c6852d2bed848", - "limit": 10, - "skip": 0, - "where": { - "executed_not": null, - }, - }, -} -`; - -exports[`getProposalPreviews > sets "where" parameter correctly based on passed "search" parameter 1`] = ` -{ - "chainId": 97, - "variables": { - "accountAddress": "0x3d759121234cd36f8124c21afe1c6852d2bed848", - "limit": 10, - "skip": 0, - "where": { - "description_contains_nocase": "fake search", - }, - }, -} -`; diff --git a/apps/evm/src/clients/api/queries/getProposals/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/api/queries/getProposals/__tests__/__snapshots__/index.spec.ts.snap new file mode 100644 index 0000000000..4c75ef4aa4 --- /dev/null +++ b/apps/evm/src/clients/api/queries/getProposals/__tests__/__snapshots__/index.spec.ts.snap @@ -0,0 +1,1603 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`getProposals > returns proposals in the correct format 1`] = ` +{ + "proposals": [ + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-10-01T11:58:15.000Z, + "createdTxHash": "0xcfafe0fcb0ed8ba08a454be1c05d0883287b76457cf0fae93d07f0131d565e49", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "#### Description + Mint faucet on all network", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "Test VIP", + "version": "v2", + }, + "endBlock": 44354696, + "endDate": 2028-06-01T09:48:50.000Z, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 1970-01-01T00:00:00.000Z, + "expiredDate": undefined, + "forVotes": [], + "forVotesMantissa": "0", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "allocateTo(address,uint256)", + "target": "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027da000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + ], + "proposalId": 436, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposals": [ + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0xf3118a17863996b9f2a073c9a66faaa664355cf8", + "value": "0", + }, + ], + "proposalId": 436, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 5611, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x8ac9b3801d0a8f5055428ae0bf301ca1da976855", + "value": "0", + }, + ], + "proposalId": 436, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 421614, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x772d68929655ce7234c8c94256526dda66ef641e", + "value": "0", + }, + ], + "proposalId": 436, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + ], + "startDate": 2028-06-01T09:41:20.000Z, + "state": 0, + "totalVotesMantissa": "0", + "userVoteSupport": undefined, + }, + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-10-01T08:09:36.000Z, + "createdTxHash": "0x62639208b514e81708fcc30c7ce276c2f7f3b12ba5252102cda3604db967fbc3", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "#### Description + Mint faucet on all network", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "Test VIP", + "version": "v2", + }, + "endBlock": 44350123, + "endDate": 2028-06-01T06:00:11.000Z, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 1970-01-01T00:00:00.000Z, + "expiredDate": undefined, + "forVotes": [], + "forVotesMantissa": "0", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "allocateTo(address,uint256)", + "target": "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027da000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + ], + "proposalId": 435, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposals": [ + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0xf3118a17863996b9f2a073c9a66faaa664355cf8", + "value": "0", + }, + ], + "proposalId": 435, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 5611, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x8ac9b3801d0a8f5055428ae0bf301ca1da976855", + "value": "0", + }, + ], + "proposalId": 435, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 421614, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x772d68929655ce7234c8c94256526dda66ef641e", + "value": "0", + }, + ], + "proposalId": 435, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + ], + "startDate": 2028-06-01T05:52:41.000Z, + "state": 0, + "totalVotesMantissa": "0", + "userVoteSupport": undefined, + }, + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-09-25T14:46:49.000Z, + "createdTxHash": "0x2794dce9d7a02e9a8d699bf23d236955d8cf2115fced7befa2a5ffd38ea708c5", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "#### Description + Mint faucet on all network", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "Test VIP", + "version": "v2", + }, + "endBlock": 44185274, + "endDate": 2028-05-26T12:37:44.000Z, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 1970-01-01T00:00:00.000Z, + "expiredDate": undefined, + "forVotes": [], + "forVotesMantissa": "0", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "allocateTo(address,uint256)", + "target": "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x0000000000000000000000000000000000000000000000000000000000002776000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + ], + "proposalId": 434, + "proposalType": 0, + "proposerAddress": "0x6eace20e1f89d0b24e5b295af1802dfbc730b37d", + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposals": [ + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 97, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x8ac9b3801d0a8f5055428ae0bf301ca1da976855", + "value": "0", + }, + ], + "proposalId": 434, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x772d68929655ce7234c8c94256526dda66ef641e", + "value": "0", + }, + ], + "proposalId": 434, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 421614, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0xf3118a17863996b9f2a073c9a66faaa664355cf8", + "value": "0", + }, + ], + "proposalId": 434, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + ], + "startDate": 2028-05-26T12:30:14.000Z, + "state": 0, + "totalVotesMantissa": "0", + "userVoteSupport": undefined, + }, + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-09-23T08:58:13.000Z, + "createdTxHash": "0x545f1fd62d776be9ec70d3be21cca9efbc9e3aa0732f83edd43a195bbcf58f06", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds with this transfer for XVS", + "againstDescription": "I do not think that Venus Protocol should proceed with this transfer for XVS", + "description": "", + "forDescription": "I agree that Venus Protocol should proceed with this transfer for XVS", + "title": "VIP to transfer XVS to destination chain", + "version": "v2", + }, + "endBlock": 44120709, + "endDate": 2028-05-24T06:49:29.000Z, + "executedDate": 2024-09-23T09:48:22.000Z, + "executedTxHash": "0x66b889b40b51592cdd89068f16cb84802f5f6e3f88b71823f363b092d7948dbd", + "executionEtaDate": 2024-09-23T09:24:25.000Z, + "expiredDate": undefined, + "forVotes": [ + { + "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposalId": "433", + "reason": undefined, + "support": 1, + "votesMantissa": "6.05372e+23", + }, + ], + "forVotesMantissa": "6.05372e+23", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x000000000000000000000000b9e0e753630434d7863528cc73cb7ac638a7c8ff0000000000000000000000000000000000000000000001d234f9a33f47600000000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327", + "signature": "withdrawTreasuryBEP20(address,uint256,address)", + "target": "0x8b293600c50d6fbdc6ed4251cc75ece29880276f", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x0000000000000000000000000e132cd94fd70298b747d2b4d977db8d086e5fd00000000000000000000000000000000000000000000000000000000000000000", + "signature": "approve(address,uint256)", + "target": "0xb9e0e753630434d7863528cc73cb7ac638a7c8ff", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x0000000000000000000000000e132cd94fd70298b747d2b4d977db8d086e5fd00000000000000000000000000000000000000000000001d234f9a33f47600000", + "signature": "approve(address,uint256)", + "target": "0xb9e0e753630434d7863528cc73cb7ac638a7c8ff", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x000000000000000000000000ce10739590001705f7ff231611ba4a48b282032700000000000000000000000000000000000000000000000000000000000027f80000000000000000000000005a1a12f47fa7007c9e23cf5e025f3f5d3ac7d7550000000000000000000000000000000000000000000001d234f9a33f4760000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000022000100000000000000000000000000000000000000000000000000000000000493e0000000000000000000000000000000000000000000000000000000000000", + "signature": "sendFrom(address,uint16,bytes32,uint256,(address,address,bytes))", + "target": "0x0e132cd94fd70298b747d2b4d977db8d086e5fd0", + "value": "300000000000000000", + }, + ], + "proposalId": 433, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": 2024-09-23T09:14:25.000Z, + "queuedTxHash": "0x1ccf90c821744d2c5fc5956078ab8834fa65d515e63024169378933b14d24589", + "remoteProposals": [], + "startDate": 2028-05-24T06:41:59.000Z, + "state": 0, + "totalVotesMantissa": "6.05372e+23", + "userVoteSupport": undefined, + }, + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-09-16T14:30:38.000Z, + "createdTxHash": "0x4f678cd8de8fea701249b349a1b9102a5350ccd123e43e58eaa4a90e91df804a", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "#### Summary Enable BSC -> ZKSYNC bridge", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "VIP-364 Enable BSC -> OP sepolia bridge", + "version": "v2", + }, + "endBlock": 43925771, + "endDate": 2028-05-17T12:22:35.000Z, + "executedDate": 2024-09-17T11:41:09.000Z, + "executedTxHash": "0x9006192b5241d82fb2d158569c6c18832dfa78272cabcfaa05b0d447889fb95f", + "executionEtaDate": 2024-09-16T14:56:23.000Z, + "expiredDate": undefined, + "forVotes": [ + { + "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposalId": "432", + "reason": undefined, + "support": 1, + "votesMantissa": "6.05372e+23", + }, + ], + "forVotesMantissa": "6.05372e+23", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f80000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001479a36dc9a43d05db4747c59c02f48ed500e47df1000000000000000000000000", + "signature": "setTrustedRemoteAddress(uint16,bytes)", + "target": "0xb164cb262328ca44a806ba9e3d4094931e658513", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000493e0", + "signature": "setMinDstGas(uint16,uint16,uint256)", + "target": "0xb164cb262328ca44a806ba9e3d4094931e658513", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f8000000000000000000000000000000000000000000000a968163f0a57b400000", + "signature": "setMaxDailyLimit(uint16,uint256)", + "target": "0xb164cb262328ca44a806ba9e3d4094931e658513", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f800000000000000000000000000000000000000000000021e19e0c9bab2400000", + "signature": "setMaxSingleTransactionLimit(uint16,uint256)", + "target": "0xb164cb262328ca44a806ba9e3d4094931e658513", + "value": "0", + }, + { + "actionIndex": 4, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f8000000000000000000000000000000000000000000000accb72d9e6b59e00000", + "signature": "setMaxDailyReceiveLimit(uint16,uint256)", + "target": "0xb164cb262328ca44a806ba9e3d4094931e658513", + "value": "0", + }, + { + "actionIndex": 5, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f8000000000000000000000000000000000000000000000228f16f861578600000", + "signature": "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + "target": "0xb164cb262328ca44a806ba9e3d4094931e658513", + "value": "0", + }, + ], + "proposalId": 432, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": 2024-09-16T14:46:23.000Z, + "queuedTxHash": "0x06f257826417ddbb351d3bd2ff0f9c50a4bff757627e7ea6df140a65744a6fc9", + "remoteProposals": [], + "startDate": 2028-05-17T12:15:05.000Z, + "state": 0, + "totalVotesMantissa": "6.05372e+23", + "userVoteSupport": undefined, + }, + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-09-12T11:14:08.000Z, + "createdTxHash": "0xf14e6e818dceaa2b107bbd4d8ab868e7512fa16d03fabf6dc4e00d241a3b78fc", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "#### Description + Mint faucet on all network", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "Test VIP", + "version": "v2", + }, + "endBlock": 43806643, + "endDate": 2028-05-13T09:06:11.000Z, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 1970-01-01T00:00:00.000Z, + "expiredDate": undefined, + "forVotes": [], + "forVotesMantissa": "0", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "allocateTo(address,uint256)", + "target": "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x0000000000000000000000000000000000000000000000000000000000002776000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + ], + "proposalId": 431, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposals": [ + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 97, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x8ac9b3801d0a8f5055428ae0bf301ca1da976855", + "value": "0", + }, + ], + "proposalId": 431, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x772d68929655ce7234c8c94256526dda66ef641e", + "value": "0", + }, + ], + "proposalId": 431, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 421614, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0xf3118a17863996b9f2a073c9a66faaa664355cf8", + "value": "0", + }, + ], + "proposalId": 431, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + ], + "startDate": 2028-05-13T08:58:41.000Z, + "state": 0, + "totalVotesMantissa": "0", + "userVoteSupport": undefined, + }, + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-09-11T23:45:58.000Z, + "createdTxHash": "0x6bb301c7a05942e284c1276ca4ca02006818b8ab2794678c16f3a36432fbb933", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "https://github.com/VenusProtocol/vips/pull/373", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "LST ETH pool on BNB chain", + "version": "v2", + }, + "endBlock": 43792881, + "endDate": 2028-05-12T21:38:05.000Z, + "executedDate": 2024-09-12T00:20:01.000Z, + "executedTxHash": "0xa3986c6801415c76451f32c279b74f3f8165ea65d03494dcec41a5370b2035ac", + "executionEtaDate": 2024-09-12T00:19:28.000Z, + "expiredDate": undefined, + "forVotes": [ + { + "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposalId": "430", + "reason": undefined, + "support": 1, + "votesMantissa": "6.05372e+23", + }, + ], + "forVotesMantissa": "6.05372e+23", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000000000000000000000000000000f43fc2c04ee0000", + "signature": "setDirectPrice(address,uint256)", + "target": "0xcea29f1266e880a1482c06ed656cd08c148baa32", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000000000000000000000000000000f43fc2c04ee0000", + "signature": "setDirectPrice(address,uint256)", + "target": "0x0af51d1504ac5b711a9eafe2fac11a51d32029ad", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000000000000000000000000000000e043da6172500000000000000000000000000000000000000000000000000000dbd2fc137a30000", + "signature": "setValidateConfig((address,uint256,uint256))", + "target": "0x2842140e4ad3a92e9af30e27e290300dd785076d", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc0000000000000000000000000000000000000000000000000f43fc2c04ee0000", + "signature": "setDirectPrice(address,uint256)", + "target": "0xcea29f1266e880a1482c06ed656cd08c148baa32", + "value": "0", + }, + { + "actionIndex": 4, + "callData": "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc0000000000000000000000000000000000000000000000000f43fc2c04ee0000", + "signature": "setDirectPrice(address,uint256)", + "target": "0x0af51d1504ac5b711a9eafe2fac11a51d32029ad", + "value": "0", + }, + { + "actionIndex": 5, + "callData": "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc0000000000000000000000000000000000000000000000000e043da6172500000000000000000000000000000000000000000000000000000dbd2fc137a30000", + "signature": "setValidateConfig((address,uint256,uint256))", + "target": "0x2842140e4ad3a92e9af30e27e290300dd785076d", + "value": "0", + }, + { + "actionIndex": 6, + "callData": "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d12900000000000000000000000035af302a0b4653f214240fcb2dff059fe42ec2ce000000000000000000000000b1bf3f668e0e047ab214c7373cf6b06de37c8152000000000000000000000000b1bf3f668e0e047ab214c7373cf6b06de37c8152000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001", + "signature": "setTokenConfig((address,address[3],bool[3]))", + "target": "0x3cd69251d04a28d887ac14cbe2e14c52f3d57823", + "value": "0", + }, + { + "actionIndex": 7, + "callData": "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc000000000000000000000000f1b65d1331dceed40da71cfc4f06d9754a3f37560000000000000000000000008c8a70695dc952ca2e8cd4038907201fabb8134e0000000000000000000000008c8a70695dc952ca2e8cd4038907201fabb8134e000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001", + "signature": "setTokenConfig((address,address[3],bool[3]))", + "target": "0x3cd69251d04a28d887ac14cbe2e14c52f3d57823", + "value": "0", + }, + { + "actionIndex": 8, + "callData": "0x", + "signature": "acceptOwnership()", + "target": "0x4a73ebd3dca511cf3574768bd6184747342c23f2", + "value": "0", + }, + { + "actionIndex": 9, + "callData": "0x", + "signature": "acceptOwnership()", + "target": "0xc7859b809ed5a2e98659ab5427d5b69e706ae26b", + "value": "0", + }, + { + "actionIndex": 10, + "callData": "0x0000000000000000000000003cd69251d04a28d887ac14cbe2e14c52f3d57823", + "signature": "setPriceOracle(address)", + "target": "0xc7859b809ed5a2e98659ab5427d5b69e706ae26b", + "value": "0", + }, + { + "actionIndex": 11, + "callData": "0x00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000c7859b809ed5a2e98659ab5427d5b69e706ae26b00000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000e27c49886e600000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000114c6971756964205374616b656420455448000000000000000000000000000000", + "signature": "addPool(string,address,uint256,uint256,uint256)", + "target": "0xc85491616fa949e048f3aac39fbf5b0703800667", + "value": "0", + }, + { + "actionIndex": 12, + "callData": "0x000000000000000000000000e840f8ec2dc50e7d22e5e2991975b9f6e34b62ad", + "signature": "setPrimeToken(address)", + "target": "0xc7859b809ed5a2e98659ab5427d5b69e706ae26b", + "value": "0", + }, + { + "actionIndex": 13, + "callData": "0x0000000000000000000000000000000000000000000000000000000000007080", + "signature": "setReduceReservesBlockDelta(uint256)", + "target": "0x16eb5ce6d186b49709dd588518cd545985096ff5", + "value": "0", + }, + { + "actionIndex": 14, + "callData": "0x00000000000000000000000000000000000000000000000003782dace9d90000", + "signature": "setReserveFactor(uint256)", + "target": "0x16eb5ce6d186b49709dd588518cd545985096ff5", + "value": "0", + }, + { + "actionIndex": 15, + "callData": "0x0000000000000000000000004349016259fcd8ee452f696b2a7beee31667d12900000000000000000000000000000000000000000000000031442230f8a30000000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327", + "signature": "withdrawTreasuryBEP20(address,uint256,address)", + "target": "0x8b293600c50d6fbdc6ed4251cc75ece29880276f", + "value": "0", + }, + { + "actionIndex": 16, + "callData": "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b070380066700000000000000000000000000000000000000000000000031442230f8a30000", + "signature": "approve(address,uint256)", + "target": "0x4349016259fcd8ee452f696b2a7beee31667d129", + "value": "0", + }, + { + "actionIndex": 17, + "callData": "0x00000000000000000000000016eb5ce6d186b49709dd588518cd545985096ff50000000000000000000000000000000000000000000000000c7d713b49da00000000000000000000000000000000000000000000000000000ce80612991d000000000000000000000000000000000000000000000000000031442230f8a300000000000000000000000000008b293600c50d6fbdc6ed4251cc75ece29880276f000000000000000000000000000000000000000000000002b5e3af16b18800000000000000000000000000000000000000000000000000004563918244f40000", + "signature": "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + "target": "0xc85491616fa949e048f3aac39fbf5b0703800667", + "value": "0", + }, + { + "actionIndex": 18, + "callData": "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000000000000000000000", + "signature": "approve(address,uint256)", + "target": "0x4349016259fcd8ee452f696b2a7beee31667d129", + "value": "0", + }, + { + "actionIndex": 19, + "callData": "0x000000000000000000000000000000000000000000000000002386f26fc10000", + "signature": "setProtocolSeizeShare(uint256)", + "target": "0x16eb5ce6d186b49709dd588518cd545985096ff5", + "value": "0", + }, + { + "actionIndex": 20, + "callData": "0x0000000000000000000000000000000000000000000000000000000000007080", + "signature": "setReduceReservesBlockDelta(uint256)", + "target": "0x4bd7efb423f06fa033404fbd0935a2097918084d", + "value": "0", + }, + { + "actionIndex": 21, + "callData": "0x00000000000000000000000000000000000000000000000003782dace9d90000", + "signature": "setReserveFactor(uint256)", + "target": "0x4bd7efb423f06fa033404fbd0935a2097918084d", + "value": "0", + }, + { + "actionIndex": 22, + "callData": "0x0000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc0000000000000000000000000000000000000000000000003d82eb1e09de9ad6000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327", + "signature": "withdrawTreasuryBEP20(address,uint256,address)", + "target": "0x8b293600c50d6fbdc6ed4251cc75ece29880276f", + "value": "0", + }, + { + "actionIndex": 23, + "callData": "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000003d82eb1e09de9ad6", + "signature": "approve(address,uint256)", + "target": "0x7df9372096c8ca2401f30b3df931beff493f1fdc", + "value": "0", + }, + { + "actionIndex": 24, + "callData": "0x0000000000000000000000004bd7efb423f06fa033404fbd0935a2097918084d0000000000000000000000000000000000000000000000000c7d713b49da00000000000000000000000000000000000000000000000000000ce80612991d00000000000000000000000000000000000000000000000000003d82eb1e09de9ad60000000000000000000000008b293600c50d6fbdc6ed4251cc75ece29880276f000000000000000000000000000000000000000000000015af1d78b58c40000000000000000000000000000000000000000000000000000ad78ebc5ac6200000", + "signature": "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + "target": "0xc85491616fa949e048f3aac39fbf5b0703800667", + "value": "0", + }, + { + "actionIndex": 25, + "callData": "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000000000000000000000", + "signature": "approve(address,uint256)", + "target": "0x7df9372096c8ca2401f30b3df931beff493f1fdc", + "value": "0", + }, + { + "actionIndex": 26, + "callData": "0x000000000000000000000000000000000000000000000000002386f26fc10000", + "signature": "setProtocolSeizeShare(uint256)", + "target": "0x4bd7efb423f06fa033404fbd0935a2097918084d", + "value": "0", + }, + { + "actionIndex": 27, + "callData": "0x0000000000000000000000000000000000000000000000000000000000007080", + "signature": "setReduceReservesBlockDelta(uint256)", + "target": "0x46d49adf48172d2e79d813a3f4f27ab61724b01e", + "value": "0", + }, + { + "actionIndex": 28, + "callData": "0x0000000000000000000000000000000000000000000000000214e8348c4f0000", + "signature": "setReserveFactor(uint256)", + "target": "0x46d49adf48172d2e79d813a3f4f27ab61724b01e", + "value": "0", + }, + { + "actionIndex": 29, + "callData": "0x00000000000000000000000098f7a83361f7ac8765ccebab1425da6b341958a70000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000ce10739590001705f7ff231611ba4a48b2820327", + "signature": "withdrawTreasuryBEP20(address,uint256,address)", + "target": "0x8b293600c50d6fbdc6ed4251cc75ece29880276f", + "value": "0", + }, + { + "actionIndex": 30, + "callData": "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000001bc16d674ec80000", + "signature": "approve(address,uint256)", + "target": "0x98f7a83361f7ac8765ccebab1425da6b341958a7", + "value": "0", + }, + { + "actionIndex": 31, + "callData": "0x00000000000000000000000046d49adf48172d2e79d813a3f4f27ab61724b01e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000008b293600c50d6fbdc6ed4251cc75ece29880276f000000000000000000000000000000000000000000000018650127cc3dc80000000000000000000000000000000000000000000000000015af1d78b58c400000", + "signature": "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + "target": "0xc85491616fa949e048f3aac39fbf5b0703800667", + "value": "0", + }, + { + "actionIndex": 32, + "callData": "0x000000000000000000000000c85491616fa949e048f3aac39fbf5b07038006670000000000000000000000000000000000000000000000000000000000000000", + "signature": "approve(address,uint256)", + "target": "0x98f7a83361f7ac8765ccebab1425da6b341958a7", + "value": "0", + }, + { + "actionIndex": 33, + "callData": "0x000000000000000000000000000000000000000000000000002386f26fc10000", + "signature": "setProtocolSeizeShare(uint256)", + "target": "0x46d49adf48172d2e79d813a3f4f27ab61724b01e", + "value": "0", + }, + { + "actionIndex": 34, + "callData": "0x000000000000000000000000a11c8d9dc9b66e209ef60f0c8d969d3cd988782c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "signature": "setConversionConfigs(address,address[],(uint256,uint8)[])", + "target": "0x32fbf7bbbd79355b86741e3181ef8c1d9bd309bb", + "value": "0", + }, + { + "actionIndex": 35, + "callData": "0x000000000000000000000000a11c8d9dc9b66e209ef60f0c8d969d3cd988782c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "signature": "setConversionConfigs(address,address[],(uint256,uint8)[])", + "target": "0xf1fa230d25fc5d6cafe87c5a6f9e1b17bc6f194e", + "value": "0", + }, + { + "actionIndex": 36, + "callData": "0x00000000000000000000000016227d60f7a0e586c66b005219dfc887d13c9531000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "signature": "setConversionConfigs(address,address[],(uint256,uint8)[])", + "target": "0x2ecede6989d8646c992344ff6c97c72a3f811a13", + "value": "0", + }, + { + "actionIndex": 37, + "callData": "0x000000000000000000000000a808e341e8e723dc6ba0bb5204bafc2330d7b8e4000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "signature": "setConversionConfigs(address,address[],(uint256,uint8)[])", + "target": "0x989a1993c023a45da141928921c0de8fd123b7d1", + "value": "0", + }, + { + "actionIndex": 38, + "callData": "0x00000000000000000000000098f7a83361f7ac8765ccebab1425da6b341958a7000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "signature": "setConversionConfigs(address,address[],(uint256,uint8)[])", + "target": "0xf358650a007aa12ecc8dac08cf8929be7f72a4d9", + "value": "0", + }, + { + "actionIndex": 39, + "callData": "0x000000000000000000000000b9e0e753630434d7863528cc73cb7ac638a7c8ff000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004349016259fcd8ee452f696b2a7beee31667d1290000000000000000000000007df9372096c8ca2401f30b3df931beff493f1fdc00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "signature": "setConversionConfigs(address,address[],(uint256,uint8)[])", + "target": "0x258f49254c758a0e37dab148addaea851f4b02a2", + "value": "0", + }, + ], + "proposalId": 430, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": 2024-09-12T00:09:28.000Z, + "queuedTxHash": "0x4d5db5557ed421d59458767807505b30f84f3b697d3756caee06b776657fd427", + "remoteProposals": [], + "startDate": 2028-05-12T21:30:35.000Z, + "state": 0, + "totalVotesMantissa": "6.05372e+23", + "userVoteSupport": undefined, + }, + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-09-05T10:57:38.000Z, + "createdTxHash": "0x712e38356472fe78b8521287faf44d42c08d35264cf2dbabbdfdd377975effcb", + "description": { + "abstainDescription": "Indifferent to execution", + "againstDescription": "Do not execute this proposal", + "description": "Unlist Market", + "forDescription": "Execute this proposal", + "title": "VIP-357 Unlist Market", + "version": "v2", + }, + "endBlock": 43604717, + "endDate": 2028-05-06T08:49:53.000Z, + "executedDate": 2024-09-05T11:23:20.000Z, + "executedTxHash": "0x54c5acabde26e06c8eb95bfadc2014cc295167f3a89f0388023c56758cb7bfbd", + "executionEtaDate": 2024-09-05T11:23:05.000Z, + "expiredDate": undefined, + "forVotes": [ + { + "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposalId": "429", + "reason": undefined, + "support": 1, + "votesMantissa": "6.05372e+23", + }, + ], + "forVotesMantissa": "6.05372e+23", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000a949ffda9b216fba9c4e5b40ef561af0fdb72300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000ba76b3fda00000000000000000000000000000000000000000000000000000000929fe9a100000000000000000000000000000000000000000000000000000000c299823800000000000000000000000000000000000000000000000000000000ede4edd000000000000000000000000000000000000000000000000000000000b0772d0b00000000000000000000000000000000000000000000000000000000abfceffc00000000000000000000000000000000000000000000000000000000007e3dd200000000000000000000000000000000000000000000000000000000c488847b00000000000000000000000000000000000000000000000000000000a78dc77500000000000000000000000000000000000000000000000000000000ddbf54fd00000000000000000000000000000000000000000000000000000000c5b4db550000000000000000000000000000000000000000000000000000000000000000000000000000000000a949ffda9b216fba9c4e5b40ef561af0fdb7230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010686dab600000000000000000000000000000000000000000000000000000000000000000000000000000000085c8d0133291348004aabffbe7cac2097af2aa1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000011ead1a8a000000000000000000000000000000000000000000000000000000000da3d454c000000000000000000000000000000000000000000000000000000005c778605000000000000000000000000000000000000000000000000000000005ec88c79000000000000000000000000000000000000000000000000000000004e79238f000000000000000000000000000000000000000000000000000000005fc7e71e0000000000000000000000000000000000000000000000000000000047ef3b3b000000000000000000000000000000000000000000000000000000004ef4c3e10000000000000000000000000000000000000000000000000000000041c728b900000000000000000000000000000000000000000000000000000000eabe7d910000000000000000000000000000000000000000000000000000000051dff9890000000000000000000000000000000000000000000000000000000024008a62000000000000000000000000000000000000000000000000000000001ededc9100000000000000000000000000000000000000000000000000000000d02f7351000000000000000000000000000000000000000000000000000000006d35bf9100000000000000000000000000000000000000000000000000000000bdcdc258000000000000000000000000000000000000000000000000000000006a56947e00000000000000000000000000000000000000000000000000000000000000000000000000000000490dfd07f592452307817c4283866035bdb3b275000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000017f519fc30000000000000000000000000000000000000000000000000000000002b5d790c00000000000000000000000000000000000000000000000000000000317b0b7700000000000000000000000000000000000000000000000000000000e4028eee000000000000000000000000000000000000000000000000000000009bf34cbb00000000000000000000000000000000000000000000000000000000522c656b0000000000000000000000000000000000000000000000000000000017db2163000000000000000000000000000000000000000000000000000000004fd42e1700000000000000000000000000000000000000000000000000000000bb85745000000000000000000000000000000000000000000000000000000000607ef6c10000000000000000000000000000000000000000000000000000000051a485e4000000000000000000000000000000000000000000000000000000005f5af1aa0000000000000000000000000000000000000000000000000000000055ee1fe1000000000000000000000000000000000000000000000000000000009460c8b5000000000000000000000000000000000000000000000000000000002a6a606500000000000000000000000000000000000000000000000000000000d24febad000000000000000000000000000000000000000000000000000000009cfdd9e6000000000000000000000000000000000000000000000000000000002ec04124000000000000000000000000000000000000000000000000000000004e0853db000000000000000000000000000000000000000000000000000000006662c7c900000000000000000000000000000000000000000000000000000000919a3736000000000000000000000000000000000000000000000000000000004ef233fc00000000000000000000000000000000000000000000000000000000fd51a3ad00000000000000000000000000000000000000000000000000000000", + "signature": "diamondCut((address,uint8,bytes4[])[])", + "target": "0x94d1820b2d1c7c7452a163983dc888cec546b77d", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000094d1820b2d1c7c7452a163983dc888cec546b77d0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000ce10739590001705f7ff231611ba4a48b28203270000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "signature": "giveCallPermission(address,string,address)", + "target": "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000094d1820b2d1c7c7452a163983dc888cec546b77d00000000000000000000000000000000000000000000000000000000000000600000000000000000000000003cff21b7af8390fe68799d58727d3b4c25a83cb60000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "signature": "giveCallPermission(address,string,address)", + "target": "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x00000000000000000000000094d1820b2d1c7c7452a163983dc888cec546b77d000000000000000000000000000000000000000000000000000000000000006000000000000000000000000023b893a7c45a5eb8c8c062b9f32d0d2e43ed286d0000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "signature": "giveCallPermission(address,string,address)", + "target": "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "value": "0", + }, + { + "actionIndex": 4, + "callData": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000ce10739590001705f7ff231611ba4a48b28203270000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "signature": "giveCallPermission(address,string,address)", + "target": "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "value": "0", + }, + { + "actionIndex": 5, + "callData": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000003cff21b7af8390fe68799d58727d3b4c25a83cb60000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "signature": "giveCallPermission(address,string,address)", + "target": "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "value": "0", + }, + { + "actionIndex": 6, + "callData": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000023b893a7c45a5eb8c8c062b9f32d0d2e43ed286d0000000000000000000000000000000000000000000000000000000000000015756e6c6973744d61726b65742861646472657373290000000000000000000000", + "signature": "giveCallPermission(address,string,address)", + "target": "0x45f8a08f534f34a97187626e05d4b6648eeaa9aa", + "value": "0", + }, + { + "actionIndex": 7, + "callData": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000009c3015191d39cf1930f92eb7e7bcbd020bca286a000000000000000000000000f206af85bc2761c4f876d27bd474681cfb335efa0000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000008", + "signature": "_setActionsPaused(address[],uint8[],bool)", + "target": "0x94d1820b2d1c7c7452a163983dc888cec546b77d", + "value": "0", + }, + { + "actionIndex": 8, + "callData": "0x0000000000000000000000009c3015191d39cf1930f92eb7e7bcbd020bca286a", + "signature": "unlistMarket(address)", + "target": "0x94d1820b2d1c7c7452a163983dc888cec546b77d", + "value": "0", + }, + { + "actionIndex": 9, + "callData": "0x000000000000000000000000f206af85bc2761c4f876d27bd474681cfb335efa", + "signature": "unlistMarket(address)", + "target": "0x94d1820b2d1c7c7452a163983dc888cec546b77d", + "value": "0", + }, + { + "actionIndex": 10, + "callData": "0x000000000000000000000000912c97b168286f550fd7b9588b2069319f1c88a2", + "signature": "upgradeTo(address)", + "target": "0xdddd7725c073105fb2abfcbdec16708fc4c24b74", + "value": "0", + }, + ], + "proposalId": 429, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": 2024-09-05T11:13:05.000Z, + "queuedTxHash": "0x5ff3875e1ed65359feccc17201c6a7f932b38942eab8ee302443075bae530abc", + "remoteProposals": [], + "startDate": 2028-05-06T08:42:23.000Z, + "state": 0, + "totalVotesMantissa": "6.05372e+23", + "userVoteSupport": undefined, + }, + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-08-30T12:23:13.000Z, + "createdTxHash": "0xa5221059657fce108338d2120708498174c473fb5727af731febd5eb760b7930", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "#### Description + Mint faucet on all network", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "Test VIP", + "version": "v2", + }, + "endBlock": 43433636, + "endDate": 2028-04-30T10:15:50.000Z, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 1970-01-01T00:00:00.000Z, + "expiredDate": undefined, + "forVotes": [], + "forVotesMantissa": "0", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "allocateTo(address,uint256)", + "target": "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x0000000000000000000000000000000000000000000000000000000000002776000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + ], + "proposalId": 428, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposals": [ + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 97, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x8ac9b3801d0a8f5055428ae0bf301ca1da976855", + "value": "0", + }, + ], + "proposalId": 428, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x772d68929655ce7234c8c94256526dda66ef641e", + "value": "0", + }, + ], + "proposalId": 428, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 421614, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0xf3118a17863996b9f2a073c9a66faaa664355cf8", + "value": "0", + }, + ], + "proposalId": 428, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + ], + "startDate": 2028-04-30T10:08:20.000Z, + "state": 0, + "totalVotesMantissa": "0", + "userVoteSupport": undefined, + }, + { + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-08-30T11:01:31.000Z, + "createdTxHash": "0x4f354d1e9d4ea6b90c61a093ad701b47e2182fb9aac5ff737bfd2c5c34e372ed", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "#### Description + Mint faucet on all network", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "Test VIP", + "version": "v2", + }, + "endBlock": 43432002, + "endDate": 2028-04-30T08:54:08.000Z, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 1970-01-01T00:00:00.000Z, + "expiredDate": undefined, + "forVotes": [], + "forVotesMantissa": "0", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "allocateTo(address,uint256)", + "target": "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x0000000000000000000000000000000000000000000000000000000000002776000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + ], + "proposalId": 427, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposals": [ + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 97, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x8ac9b3801d0a8f5055428ae0bf301ca1da976855", + "value": "0", + }, + ], + "proposalId": 427, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x772d68929655ce7234c8c94256526dda66ef641e", + "value": "0", + }, + ], + "proposalId": 427, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 421614, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0xf3118a17863996b9f2a073c9a66faaa664355cf8", + "value": "0", + }, + ], + "proposalId": 427, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + ], + "startDate": 2028-04-30T08:46:38.000Z, + "state": 0, + "totalVotesMantissa": "0", + "userVoteSupport": undefined, + }, + ], + "total": 100, +} +`; + +exports[`getProposals > sets "where" parameter correctly based on passed "proposalState" parameter 1`] = ` +{ + "chainId": 97, + "variables": { + "limit": 10, + "skip": 0, + "where": { + "startBlock_gt": 1, + }, + }, +} +`; + +exports[`getProposals > sets "where" parameter correctly based on passed "proposalState" parameter 2`] = ` +{ + "chainId": 97, + "variables": { + "limit": 10, + "skip": 0, + "where": { + "endBlock_gt": 1, + }, + }, +} +`; + +exports[`getProposals > sets "where" parameter correctly based on passed "proposalState" parameter 3`] = ` +{ + "chainId": 97, + "variables": { + "limit": 10, + "skip": 0, + "where": { + "canceled_not": null, + }, + }, +} +`; + +exports[`getProposals > sets "where" parameter correctly based on passed "proposalState" parameter 4`] = ` +{ + "chainId": 97, + "variables": { + "limit": 10, + "skip": 0, + "where": { + "or": [ + { + "canceled": null, + "endBlock_lt": 1, + "passing": false, + }, + { + "or": [ + { + "canceled": null, + "endBlock_lt": 1, + "forVotes_lt": "10", + }, + ], + }, + ], + }, + }, +} +`; + +exports[`getProposals > sets "where" parameter correctly based on passed "proposalState" parameter 5`] = ` +{ + "chainId": 97, + "variables": { + "limit": 10, + "skip": 0, + "where": { + "canceled": null, + "endBlock_lt": 1, + "executed": null, + "forVotes_gte": "10", + "passing": true, + "queued": null, + }, + }, +} +`; + +exports[`getProposals > sets "where" parameter correctly based on passed "proposalState" parameter 6`] = ` +{ + "chainId": 97, + "variables": { + "limit": 10, + "skip": 0, + "where": { + "canceled": null, + "executed": null, + "executionEta_gte": "1709192045", + "queued_not": null, + }, + }, +} +`; + +exports[`getProposals > sets "where" parameter correctly based on passed "proposalState" parameter 7`] = ` +{ + "chainId": 97, + "variables": { + "limit": 10, + "skip": 0, + "where": { + "canceled": null, + "executed": null, + "executionEta_lt": "1709192045", + "queued_not": null, + }, + }, +} +`; + +exports[`getProposals > sets "where" parameter correctly based on passed "proposalState" parameter 8`] = ` +{ + "chainId": 97, + "variables": { + "limit": 10, + "skip": 0, + "where": { + "executed_not": null, + }, + }, +} +`; + +exports[`getProposals > sets "where" parameter correctly based on passed "search" parameter 1`] = ` +{ + "chainId": 97, + "variables": { + "limit": 10, + "skip": 0, + "where": { + "description_contains_nocase": "fake search", + }, + }, +} +`; diff --git a/apps/evm/src/clients/api/queries/getProposalPreviews/__tests__/index.spec.ts b/apps/evm/src/clients/api/queries/getProposals/__tests__/index.spec.ts similarity index 60% rename from apps/evm/src/clients/api/queries/getProposalPreviews/__tests__/index.spec.ts rename to apps/evm/src/clients/api/queries/getProposals/__tests__/index.spec.ts index ea6f33cc48..e17d7a18e0 100644 --- a/apps/evm/src/clients/api/queries/getProposalPreviews/__tests__/index.spec.ts +++ b/apps/evm/src/clients/api/queries/getProposals/__tests__/index.spec.ts @@ -1,26 +1,24 @@ import fakeAccountAddress from '__mocks__/models/address'; import BigNumber from 'bignumber.js'; -import { getProposalPreviews as getGqlProposalPreviews } from 'clients/subgraph'; +import { getBscProposals } from 'clients/subgraph'; import { ChainId, ProposalState } from 'types'; import type Vi from 'vitest'; -import { type GetProposalPreviewsInput, getProposalPreviews } from '..'; +import { type GetProposalsInput, getProposals } from '..'; -const fakeParams: GetProposalPreviewsInput = { +const fakeParams: GetProposalsInput = { chainId: ChainId.BSC_TESTNET, currentBlockNumber: 1, proposalMinQuorumVotesMantissa: new BigNumber(10), - proposalExecutionGracePeriodMs: 1209600000, - blockTimeMs: 3000, accountAddress: fakeAccountAddress, }; -describe('getProposalPreviews', () => { +describe('getProposals', () => { beforeEach(() => { vi.useFakeTimers().setSystemTime(new Date(1710401645000)); }); - it('returns proposal previews in the correct format', async () => { - const res = await getProposalPreviews(fakeParams); + it('returns proposals in the correct format', async () => { + const res = await getProposals(fakeParams); expect(res).toMatchSnapshot(); }); @@ -33,21 +31,21 @@ describe('getProposalPreviews', () => { for (let i = 0; i < proposalStates.length; i++) { const proposalState = proposalStates[i]; - await getProposalPreviews({ + await getProposals({ ...fakeParams, proposalState, }); - expect((getGqlProposalPreviews as Vi.Mock).mock.calls[i][0]).toMatchSnapshot(); + expect((getBscProposals as Vi.Mock).mock.calls[i][0]).toMatchSnapshot(); } }); it('sets "where" parameter correctly based on passed "search" parameter', async () => { - await getProposalPreviews({ + await getProposals({ ...fakeParams, search: 'fake search', }); - expect((getGqlProposalPreviews as Vi.Mock).mock.calls[0][0]).toMatchSnapshot(); + expect((getBscProposals as Vi.Mock).mock.calls[0][0]).toMatchSnapshot(); }); }); diff --git a/apps/evm/src/clients/api/queries/getProposalPreviews/index.ts b/apps/evm/src/clients/api/queries/getProposals/index.ts similarity index 61% rename from apps/evm/src/clients/api/queries/getProposalPreviews/index.ts rename to apps/evm/src/clients/api/queries/getProposals/index.ts index eed80b8b32..960baaf266 100644 --- a/apps/evm/src/clients/api/queries/getProposalPreviews/index.ts +++ b/apps/evm/src/clients/api/queries/getProposals/index.ts @@ -1,18 +1,18 @@ import type BigNumber from 'bignumber.js'; import { - type GetProposalPreviewsInput as GetGqlProposalPreviewsInput, - type Proposal_Filter, - formatToProposalPreview, - getProposalPreviews as getGqlProposalPreviews, + type GetBscProposalsInput as GetBscGqlProposalsInput, + enrichRemoteProposals, + formatToProposal, + getBscProposals, } from 'clients/subgraph'; -import { type ChainId, type ProposalPreview, ProposalState } from 'types'; +import type { Proposal_Filter, RemoteProposal } from 'clients/subgraph/gql/generated/governanceBsc'; +import { PROPOSAL_EXECUTION_GRACE_PERIOD_MS } from 'constants/chainMetadata'; +import { type ChainId, type Proposal, ProposalState } from 'types'; -export interface GetProposalPreviewsInput { +export interface GetProposalsInput { chainId: ChainId; currentBlockNumber: number; proposalMinQuorumVotesMantissa: BigNumber; - blockTimeMs: number; - proposalExecutionGracePeriodMs?: number; accountAddress?: string; proposalState?: ProposalState; search?: string; @@ -20,28 +20,26 @@ export interface GetProposalPreviewsInput { limit?: number; } -export interface GetProposalPreviewsOutput { - proposalPreviews: ProposalPreview[]; +export interface GetProposalsOutput { + proposals: Proposal[]; total: number; } -export const getProposalPreviews = async ({ +export const getProposals = async ({ chainId, currentBlockNumber, proposalMinQuorumVotesMantissa, - proposalExecutionGracePeriodMs, - blockTimeMs, page = 0, limit = 10, proposalState, search, - accountAddress = '', -}: GetProposalPreviewsInput): Promise => { + accountAddress, +}: GetProposalsInput): Promise => { // Handle filtering by proposal state let where: Proposal_Filter | undefined; const proposalExpiredTimestampSeconds = Math.floor( - (new Date().getTime() - (proposalExecutionGracePeriodMs ?? 0)) / 1000, + (new Date().getTime() - PROPOSAL_EXECUTION_GRACE_PERIOD_MS) / 1000, ); switch (proposalState) { @@ -109,39 +107,45 @@ export const getProposalPreviews = async ({ }; } - const getGqlProposals = async () => { - const variables: GetGqlProposalPreviewsInput['variables'] = { - skip: page * limit, - limit, - accountAddress: accountAddress?.toLocaleLowerCase(), - where, - }; + const variables: GetBscGqlProposalsInput['variables'] = { + skip: page * limit, + limit, + where, + }; - const response = await getGqlProposalPreviews({ - chainId, - variables, - }); + const response = await getBscProposals({ + chainId, + variables, + }); - return { - gqlProposals: response?.proposals || [], - total: response?.total.length ?? 0, - }; - }; + const gqlProposals = response?.proposals || []; + const total = response?.total.length ?? 0; + + // Fetch remote proposals + const rawGqlRemoteProposals: RemoteProposal[] = []; + + gqlProposals.forEach(gqlProposal => + gqlProposal.remoteProposals.forEach(gqlRemoteProposal => + rawGqlRemoteProposals.push(gqlRemoteProposal as RemoteProposal), + ), + ); - const { gqlProposals, total } = await getGqlProposals(); + const gqlRemoteProposalsMapping = await enrichRemoteProposals({ + gqlRemoteProposals: rawGqlRemoteProposals, + }); - const proposalPreviews = (gqlProposals || []).map(gqlProposal => - formatToProposalPreview({ + const proposals = (gqlProposals || []).map(gqlProposal => + formatToProposal({ gqlProposal, + gqlRemoteProposalsMapping, proposalMinQuorumVotesMantissa, - proposalExecutionGracePeriodMs, currentBlockNumber, - blockTimeMs, + accountAddress, }), ); return { - proposalPreviews, + proposals, total, }; }; diff --git a/apps/evm/src/clients/api/queries/getProposalPreviews/useGetProposalPreviews.ts b/apps/evm/src/clients/api/queries/getProposals/useGetProposals.ts similarity index 59% rename from apps/evm/src/clients/api/queries/getProposalPreviews/useGetProposalPreviews.ts rename to apps/evm/src/clients/api/queries/getProposals/useGetProposals.ts index e1ab7cb015..f51c2982fd 100644 --- a/apps/evm/src/clients/api/queries/getProposalPreviews/useGetProposalPreviews.ts +++ b/apps/evm/src/clients/api/queries/getProposals/useGetProposals.ts @@ -3,51 +3,55 @@ import { type QueryObserverOptions, useQuery } from '@tanstack/react-query'; import useGetBlockNumber from 'clients/api/queries/getBlockNumber/useGetBlockNumber'; import { useGetProposalMinQuorumVotes } from 'clients/api/queries/getProposalMinQuorumVotes/useGetProposalMinQuorumVotes'; import { - type GetProposalPreviewsInput, - type GetProposalPreviewsOutput, - getProposalPreviews, -} from 'clients/api/queries/getProposalPreviews'; + type GetProposalsInput, + type GetProposalsOutput, + getProposals, +} from 'clients/api/queries/getProposals'; import { CHAIN_METADATA } from 'constants/chainMetadata'; -import { DEFAULT_REFETCH_INTERVAL_MS } from 'constants/defaultRefetchInterval'; import FunctionKey from 'constants/functionKey'; import { governanceChain } from 'libs/wallet'; import { callOrThrow } from 'utilities'; -type TrimmedGetProposalPreviewsInput = Omit< - GetProposalPreviewsInput, - 'chainId' | 'proposalMinQuorumVotesMantissa' | 'currentBlockNumber' | 'blockTimeMs' +type TrimmedGetProposalsInput = Omit< + GetProposalsInput, + 'currentBlockNumber' | 'proposalMinQuorumVotesMantissa' | 'blockTimeMs' | 'chainId' >; type Options = QueryObserverOptions< - GetProposalPreviewsOutput, + GetProposalsOutput, Error, - GetProposalPreviewsOutput, - GetProposalPreviewsOutput, + GetProposalsOutput, + GetProposalsOutput, [ - FunctionKey.GET_PROPOSAL_PREVIEWS, + FunctionKey.GET_PROPOSALS, Omit< - GetProposalPreviewsInput, + GetProposalsInput, 'currentBlockNumber' | 'proposalMinQuorumVotesMantissa' | 'blockTimeMs' >, ] >; -export const useGetProposalPreviews = ( - input: TrimmedGetProposalPreviewsInput = {}, +const { blockTimeMs: BSC_BLOCK_TIME_MS } = CHAIN_METADATA[governanceChain.id]; + +export const useGetProposals = ( + input: TrimmedGetProposalsInput = {}, options?: Partial, ) => { const { data: getProposalMinQuorumVotesData } = useGetProposalMinQuorumVotes(); const proposalMinQuorumVotesMantissa = getProposalMinQuorumVotesData?.proposalMinQuorumVotesMantissa; - const { data: getBlockNumberData } = useGetBlockNumber({ - chainId: governanceChain.id, - }); + const { data: getBlockNumberData } = useGetBlockNumber( + { + chainId: governanceChain.id, + }, + { + refetchInterval: BSC_BLOCK_TIME_MS, + }, + ); const currentBlockNumber = getBlockNumberData?.blockNumber; - const { blockTimeMs, proposalExecutionGracePeriodMs } = CHAIN_METADATA[governanceChain.id]; - - const sanitizedInput: TrimmedGetProposalPreviewsInput = { + const sanitizedInput: TrimmedGetProposalsInput = { ...input, page: input.page ?? 0, limit: input.limit ?? 10, @@ -55,38 +59,34 @@ export const useGetProposalPreviews = ( return useQuery({ queryKey: [ - FunctionKey.GET_PROPOSAL_PREVIEWS, + FunctionKey.GET_PROPOSALS, { ...sanitizedInput, // We will check that the current block number exists through the enabled parameter chainId: governanceChain.id, }, ], - queryFn: () => { - return callOrThrow( + queryFn: () => + callOrThrow( { currentBlockNumber, proposalMinQuorumVotesMantissa, - blockTimeMs, }, params => - getProposalPreviews({ + getProposals({ ...sanitizedInput, ...params, chainId: governanceChain.id, - proposalExecutionGracePeriodMs, }), - ); - }, + ), placeholderData: a => a ?? { limit: sanitizedInput.limit, page: sanitizedInput.page, total: 0, - proposalPreviews: [], + proposals: [], }, - refetchInterval: - sanitizedInput.page === 0 ? (blockTimeMs || DEFAULT_REFETCH_INTERVAL_MS) * 5 : undefined, + refetchInterval: sanitizedInput.page === 0 ? BSC_BLOCK_TIME_MS! * 5 : undefined, ...options, enabled: typeof currentBlockNumber === 'number' && diff --git a/apps/evm/src/clients/api/queries/getVoterHistory/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/api/queries/getVoterHistory/__snapshots__/index.spec.ts.snap index 08a6e36f89..846f0664c0 100644 --- a/apps/evm/src/clients/api/queries/getVoterHistory/__snapshots__/index.spec.ts.snap +++ b/apps/evm/src/clients/api/queries/getVoterHistory/__snapshots__/index.spec.ts.snap @@ -37,9 +37,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 33336002, "endDate": 2023-09-14T15:21:17.000Z, - "etaDate": 2023-09-14T15:32:50.000Z, "executedDate": 2023-09-14T15:39:44.000Z, "executedTxHash": "0xac2d0b0876517e098d16aa4546b66a0f92391fb025a76fb25e8f3989e8be1dd1", + "executionEtaDate": 2023-09-14T15:32:50.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -58,10 +58,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 290, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-09-14T15:22:50.000Z, "queuedTxHash": "0x1d8c233bd9f7074f9355fc91e092a6f2ed80e6ddde10a5eec1ba25eadff21651", "reason": "", + "remoteProposals": [], "startDate": 2023-09-14T15:13:47.000Z, "state": 7, "support": 1, @@ -88,9 +89,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 33279845, "endDate": 2023-09-12T16:33:23.000Z, - "etaDate": 2023-09-12T16:46:41.000Z, "executedDate": 2023-09-12T16:47:38.000Z, "executedTxHash": "0x5b4f35529ccabfedeac5db1eea9385ab63a804c14f68c5e99a47ba96b6281f76", + "executionEtaDate": 2023-09-12T16:46:41.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -109,10 +110,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 288, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-09-12T16:36:41.000Z, "queuedTxHash": "0x32ac482bf430b49cb15e5f7860a4d75aeb23a171977034d52ade034e8c9d9bd3", "reason": "", + "remoteProposals": [], "startDate": 2023-09-12T16:25:53.000Z, "state": 7, "support": 1, @@ -139,9 +141,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 33279456, "endDate": 2023-09-12T16:13:56.000Z, - "etaDate": 2023-09-12T16:25:26.000Z, "executedDate": 2023-09-12T16:28:35.000Z, "executedTxHash": "0xc15918d42abe6dba39b1872784671e72769135bc32811012f4712e45ceacc0bf", + "executionEtaDate": 2023-09-12T16:25:26.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -160,10 +162,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 287, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-09-12T16:15:26.000Z, "queuedTxHash": "0x32b68a97e6a7431ec1b8c5834d27e1bf40ad5b0f1b7014d5ce7fb067b278bd87", "reason": "", + "remoteProposals": [], "startDate": 2023-09-12T16:06:26.000Z, "state": 7, "support": 1, @@ -190,9 +193,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 33243153, "endDate": 2023-09-11T09:58:47.000Z, - "etaDate": 2023-09-11T10:28:11.000Z, "executedDate": 2023-09-11T10:34:59.000Z, "executedTxHash": "0x95014a018718ec888a696259d470715799249071c39e8b1d8c76da407e2de72a", + "executionEtaDate": 2023-09-11T10:28:11.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -211,10 +214,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 284, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-09-11T10:18:11.000Z, "queuedTxHash": "0x4a4f3d03765ed3c1d27e9338ca57702224771a8590852a8dbf3ef590ee880271", "reason": "", + "remoteProposals": [], "startDate": 2023-09-11T09:51:17.000Z, "state": 7, "support": 1, @@ -243,9 +247,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 32926185, "endDate": 2023-08-31T09:50:13.000Z, - "etaDate": 2023-08-31T10:52:34.000Z, "executedDate": 2023-08-31T10:55:01.000Z, "executedTxHash": "0x684ed7132eae0ef40ac3fa13f5e66e05ce4b80cb2bc42806f423b35a4357bbfa", + "executionEtaDate": 2023-08-31T10:52:34.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -264,10 +268,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 281, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-08-31T10:42:34.000Z, "queuedTxHash": "0xd01b12dda1c8fb28c37515341aac4e72e559b50e5c707d9c3e18690be558ef9f", "reason": "", + "remoteProposals": [], "startDate": 2023-08-31T09:42:43.000Z, "state": 8, "support": 1, @@ -294,9 +299,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 32870813, "endDate": 2023-08-29T11:41:37.000Z, - "etaDate": 2023-08-29T11:52:16.000Z, "executedDate": 2023-08-29T11:54:52.000Z, "executedTxHash": "0xb06be6ed9813e4e4c675702bd74bb0f75c897c25365d9eea3387520c9ff39257", + "executionEtaDate": 2023-08-29T11:52:16.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -315,10 +320,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 280, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-08-29T11:42:16.000Z, "queuedTxHash": "0xb5e75d6211a9fdd794316b6369dd0052e9dfc3280dca6dbb0857ccf866cafc6e", "reason": "", + "remoteProposals": [], "startDate": 2023-08-29T11:34:07.000Z, "state": 8, "support": 1, @@ -367,9 +373,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 33336002, "endDate": 2023-09-14T15:21:17.000Z, - "etaDate": 2023-09-14T15:32:50.000Z, "executedDate": 2023-09-14T15:39:44.000Z, "executedTxHash": "0xac2d0b0876517e098d16aa4546b66a0f92391fb025a76fb25e8f3989e8be1dd1", + "executionEtaDate": 2023-09-14T15:32:50.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -388,10 +394,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 290, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-09-14T15:22:50.000Z, "queuedTxHash": "0x1d8c233bd9f7074f9355fc91e092a6f2ed80e6ddde10a5eec1ba25eadff21651", "reason": "", + "remoteProposals": [], "startDate": 2023-09-14T15:13:47.000Z, "state": 7, "support": 1, @@ -418,9 +425,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 33279845, "endDate": 2023-09-12T16:33:23.000Z, - "etaDate": 2023-09-12T16:46:41.000Z, "executedDate": 2023-09-12T16:47:38.000Z, "executedTxHash": "0x5b4f35529ccabfedeac5db1eea9385ab63a804c14f68c5e99a47ba96b6281f76", + "executionEtaDate": 2023-09-12T16:46:41.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -439,10 +446,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 288, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-09-12T16:36:41.000Z, "queuedTxHash": "0x32ac482bf430b49cb15e5f7860a4d75aeb23a171977034d52ade034e8c9d9bd3", "reason": "", + "remoteProposals": [], "startDate": 2023-09-12T16:25:53.000Z, "state": 7, "support": 1, @@ -469,9 +477,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 33279456, "endDate": 2023-09-12T16:13:56.000Z, - "etaDate": 2023-09-12T16:25:26.000Z, "executedDate": 2023-09-12T16:28:35.000Z, "executedTxHash": "0xc15918d42abe6dba39b1872784671e72769135bc32811012f4712e45ceacc0bf", + "executionEtaDate": 2023-09-12T16:25:26.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -490,10 +498,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 287, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-09-12T16:15:26.000Z, "queuedTxHash": "0x32b68a97e6a7431ec1b8c5834d27e1bf40ad5b0f1b7014d5ce7fb067b278bd87", "reason": "", + "remoteProposals": [], "startDate": 2023-09-12T16:06:26.000Z, "state": 7, "support": 1, @@ -520,9 +529,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 33243153, "endDate": 2023-09-11T09:58:47.000Z, - "etaDate": 2023-09-11T10:28:11.000Z, "executedDate": 2023-09-11T10:34:59.000Z, "executedTxHash": "0x95014a018718ec888a696259d470715799249071c39e8b1d8c76da407e2de72a", + "executionEtaDate": 2023-09-11T10:28:11.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -541,10 +550,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 284, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-09-11T10:18:11.000Z, "queuedTxHash": "0x4a4f3d03765ed3c1d27e9338ca57702224771a8590852a8dbf3ef590ee880271", "reason": "", + "remoteProposals": [], "startDate": 2023-09-11T09:51:17.000Z, "state": 7, "support": 1, @@ -573,9 +583,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 32926185, "endDate": 2023-08-31T09:50:13.000Z, - "etaDate": 2023-08-31T10:52:34.000Z, "executedDate": 2023-08-31T10:55:01.000Z, "executedTxHash": "0x684ed7132eae0ef40ac3fa13f5e66e05ce4b80cb2bc42806f423b35a4357bbfa", + "executionEtaDate": 2023-08-31T10:52:34.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -594,10 +604,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 281, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-08-31T10:42:34.000Z, "queuedTxHash": "0xd01b12dda1c8fb28c37515341aac4e72e559b50e5c707d9c3e18690be558ef9f", "reason": "", + "remoteProposals": [], "startDate": 2023-08-31T09:42:43.000Z, "state": 8, "support": 1, @@ -624,9 +635,9 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g }, "endBlock": 32870813, "endDate": 2023-08-29T11:41:37.000Z, - "etaDate": 2023-08-29T11:52:16.000Z, "executedDate": 2023-08-29T11:54:52.000Z, "executedTxHash": "0xb06be6ed9813e4e4c675702bd74bb0f75c897c25365d9eea3387520c9ff39257", + "executionEtaDate": 2023-08-29T11:52:16.000Z, "forVotes": [ { "address": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", @@ -645,10 +656,11 @@ Simulation of the VIP: [https://github.com/VenusProtocol/vips/pull/70](https://g "proposalActions": [], "proposalId": 280, "proposalType": 0, - "proposer": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", "queuedDate": 2023-08-29T11:42:16.000Z, "queuedTxHash": "0xb5e75d6211a9fdd794316b6369dd0052e9dfc3280dca6dbb0857ccf866cafc6e", "reason": "", + "remoteProposals": [], "startDate": 2023-08-29T11:34:07.000Z, "state": 8, "support": 1, diff --git a/apps/evm/src/utilities/formatToProposal.ts b/apps/evm/src/clients/api/queries/getVoterHistory/formatToProposal.ts similarity index 88% rename from apps/evm/src/utilities/formatToProposal.ts rename to apps/evm/src/clients/api/queries/getVoterHistory/formatToProposal.ts index 41f6f65e7a..1ec16eb359 100644 --- a/apps/evm/src/utilities/formatToProposal.ts +++ b/apps/evm/src/clients/api/queries/getVoterHistory/formatToProposal.ts @@ -1,6 +1,6 @@ import BigNumber from 'bignumber.js'; -import type { ProposalApiResponse } from 'clients/api'; +import type { ProposalApiResponse } from 'clients/api/queries/getVoterHistory/types'; import { type AbstainVoter, type AgainstVoter, @@ -9,12 +9,9 @@ import { ProposalType, VoteSupport, } from 'types'; +import { areAddressesEqual, convertToDate, formatToProposalDescription } from 'utilities'; -import areAddressesEqual from './areAddressesEqual'; -import { convertToDate } from './convertToDate'; -import { formatToProposalDescription } from './formatToProposalDescription'; - -const formatToProposal = ({ +export const formatToProposal = ({ cancelTimestamp, createdTimestamp, description, @@ -98,9 +95,9 @@ const formatToProposal = ({ : undefined, forVotesMantissa: forVotesValue, proposalId, - proposer, + proposerAddress: proposer, queuedDate: queuedTimestamp ? convertToDate({ timestampSeconds: queuedTimestamp }) : undefined, - etaDate: eta ? convertToDate({ timestampSeconds: eta }) : undefined, + executionEtaDate: eta ? convertToDate({ timestampSeconds: eta }) : undefined, startDate: convertToDate({ timestampSeconds: startTimestamp }), state, createdTxHash: createdTxHash ?? undefined, @@ -114,9 +111,8 @@ const formatToProposal = ({ abstainVotes, proposalType: proposalType ?? ProposalType.NORMAL, userVoteSupport, + remoteProposals: [], // This data isn't used in the UI but requires an extra call to be fetch, so we don't fetch it }; return proposal; }; - -export default formatToProposal; diff --git a/apps/evm/src/clients/api/queries/getVoterHistory/formatVoterHistoryResponse.ts b/apps/evm/src/clients/api/queries/getVoterHistory/formatVoterHistoryResponse.ts index ce8f3f2f18..dd80359a76 100644 --- a/apps/evm/src/clients/api/queries/getVoterHistory/formatVoterHistoryResponse.ts +++ b/apps/evm/src/clients/api/queries/getVoterHistory/formatVoterHistoryResponse.ts @@ -1,7 +1,7 @@ import BigNumber from 'bignumber.js'; import type { VoterHistory } from 'types'; -import { formatToProposal } from 'utilities'; +import { formatToProposal } from './formatToProposal'; import type { GetVoterHistoryResponse } from './types'; diff --git a/apps/evm/src/clients/api/queries/getVoterHistory/types.ts b/apps/evm/src/clients/api/queries/getVoterHistory/types.ts index 49098c0433..dc281aea5c 100644 --- a/apps/evm/src/clients/api/queries/getVoterHistory/types.ts +++ b/apps/evm/src/clients/api/queries/getVoterHistory/types.ts @@ -1,6 +1,53 @@ -import type { VoteSupport } from 'types'; +import type { ProposalState, ProposalType, VoteSupport } from 'types'; -import type { ProposalApiResponse } from '../getProposal/types'; +export interface ProposalActionApiResponse { + actionIndex: number; + calldata: string; + signature: string; + target: string; + value: string | null; +} + +type VoterApiResponse = { + proposalId: number; + address: string; + blockNumber: number; + blockTimestamp: number; + reason: string | undefined; + votesMantissa: string; + support: VoteSupport; +}; + +export interface ProposalApiResponse { + abstainedVotesMantissa: string; + againstVotesMantissa: string; + cancelBlock: number | null; + cancelTimestamp: number | null; + cancelTxHash: string | null; + createdBlock: number | null; + createdTimestamp: number | null; + createdTxHash: string | null; + description: string; + endBlock: number; + endTimestamp: number; + eta: number | null; + executedBlock: number | null; + executedTimestamp: number | null; + executedTxHash: string | null; + forVotesMantissa: string; + governorName: string; + proposer: string; + queuedBlock: number | null; + queuedTimestamp: number | null; + queuedTxHash: string | null; + startBlock: number; + startTimestamp: number; + state: ProposalState; + proposalType: ProposalType; + proposalId: number; + proposalActions: ProposalActionApiResponse[] | undefined; + votes: VoterApiResponse[] | undefined; +} export type GetVoterHistoryResponse = { limit: number; diff --git a/apps/evm/src/clients/api/queries/getVoters/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/api/queries/getVoters/__snapshots__/index.spec.ts.snap index 3fa7dbd584..27ac4fa55a 100644 --- a/apps/evm/src/clients/api/queries/getVoters/__snapshots__/index.spec.ts.snap +++ b/apps/evm/src/clients/api/queries/getVoters/__snapshots__/index.spec.ts.snap @@ -5,56 +5,49 @@ exports[`api/queries/getVoters > returns votes 1`] = ` "result": [ { "address": "0x60277add339d936c4ab907376afee4f7ac17d760", - "blockNumber": 18266280, - "blockTimestamp": 2022-05-31T00:22:57.000Z, + "proposalId": 64, "reason": undefined, "support": 0, "votesMantissa": "6.222586268e+23", }, { "address": "0xc444949e0054a23c44fc45789738bdf64aed2391", - "blockNumber": 18260633, - "blockTimestamp": 2022-05-30T19:40:00.000Z, + "proposalId": 64, "reason": "Finally more income for the protocol and XVS holders! ;)", "support": 1, "votesMantissa": "2.4543029897767607315925e+22", }, { "address": "0xb98fa0292e2927018c03ad5110673b7daa1424a7", - "blockNumber": 18278834, - "blockTimestamp": 2022-05-31T10:54:07.000Z, + "proposalId": 64, "reason": "This is the best feature for XVS Holders", "support": 1, "votesMantissa": "1.55214637e+22", }, { "address": "0x73da76e9283a259c687713b6670c5ba5866bb338", - "blockNumber": 18275805, - "blockTimestamp": 2022-05-31T08:22:18.000Z, + "proposalId": 64, "reason": "We keep building through the downturns and on the next BTC Bull Run we will Shine.", "support": 1, "votesMantissa": "9.2862418e+21", }, { "address": "0xb6e0928537289164cb0d11969cf7b9fcd2c9982a", - "blockNumber": 18264409, - "blockTimestamp": 2022-05-30T22:49:09.000Z, + "proposalId": 64, "reason": "Should share revenue with token holder.", "support": 1, "votesMantissa": "9.2543427e+21", }, { "address": "0xc6b0fe3bf997453806d8d94ca6828e793e42df8f", - "blockNumber": 18272516, - "blockTimestamp": 2022-05-31T05:36:13.000Z, + "proposalId": 64, "reason": "ok", "support": 1, "votesMantissa": "5.6811531e+21", }, { "address": "0xa205358b29bb5466c8d0ad25f84d2aa118e967e5", - "blockNumber": 18269295, - "blockTimestamp": 2022-05-31T02:54:21.000Z, + "proposalId": 64, "reason": "Income for xvs vault", "support": 1, "votesMantissa": "1.6639618e+21", diff --git a/apps/evm/src/clients/api/queries/getVoters/formatToVoters.ts b/apps/evm/src/clients/api/queries/getVoters/formatToVoters.ts index ab74ccb284..0d10e3025b 100644 --- a/apps/evm/src/clients/api/queries/getVoters/formatToVoters.ts +++ b/apps/evm/src/clients/api/queries/getVoters/formatToVoters.ts @@ -5,16 +5,13 @@ import type { VotersDetails } from 'types'; import type { GetVotersApiResponse } from './types'; const formatToVoter = ({ payload }: { payload: GetVotersApiResponse }): VotersDetails => ({ - result: payload.result.map( - ({ address, reason, votesMantissa, blockNumber, blockTimestamp, support }) => ({ - address, - votesMantissa: new BigNumber(votesMantissa), - reason: reason ?? undefined, - support, - blockNumber, - blockTimestamp: new Date(blockTimestamp * 1000), - }), - ), + result: payload.result.map(({ address, reason, votesMantissa, support, proposalId }) => ({ + proposalId, + address, + votesMantissa: new BigNumber(votesMantissa), + reason: reason ?? undefined, + support, + })), }); export default formatToVoter; diff --git a/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/index.spec.ts b/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/index.spec.ts index 154d733a42..f1b57fbf00 100644 --- a/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/index.spec.ts +++ b/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/index.spec.ts @@ -3,7 +3,7 @@ import { BigNumber as BN } from 'ethers'; import fakeAddress from '__mocks__/models/address'; -import type { XvsTokenMultichain } from 'libs/contracts'; +import type { XvsTokenOmnichain } from 'libs/contracts'; import getXvsBridgeMintStatus from '.'; @@ -15,11 +15,11 @@ describe('getXvsBridgeMintStatus', () => { const fakeContract = { minterToCap: minterToCapMock, minterToMintedAmount: minterToMintedAmountMock, - } as unknown as XvsTokenMultichain; + } as unknown as XvsTokenOmnichain; const response = await getXvsBridgeMintStatus({ chainXvsProxyOftDestContractAddress: fakeAddress, - xvsTokenMultichainContract: fakeContract, + xvsTokenOmnichainContract: fakeContract, }); expect(minterToCapMock).toHaveBeenCalledTimes(1); diff --git a/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/index.ts b/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/index.ts index 453f6fa3ee..45d4934b7f 100644 --- a/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/index.ts +++ b/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/index.ts @@ -1,10 +1,10 @@ import BigNumber from 'bignumber.js'; -import type { XvsTokenMultichain } from 'libs/contracts'; +import type { XvsTokenOmnichain } from 'libs/contracts'; export interface GetXvsMintStatusInput { chainXvsProxyOftDestContractAddress: string; - xvsTokenMultichainContract: XvsTokenMultichain; + xvsTokenOmnichainContract: XvsTokenOmnichain; } export interface GetXvsMintStatusOutput { @@ -14,11 +14,11 @@ export interface GetXvsMintStatusOutput { const getXvsBridgeMintStatus = async ({ chainXvsProxyOftDestContractAddress, - xvsTokenMultichainContract, + xvsTokenOmnichainContract, }: GetXvsMintStatusInput): Promise => { const [minterToCap, bridgeAmountMinted] = await Promise.all([ - xvsTokenMultichainContract.minterToCap(chainXvsProxyOftDestContractAddress), - xvsTokenMultichainContract.minterToMintedAmount(chainXvsProxyOftDestContractAddress), + xvsTokenOmnichainContract.minterToCap(chainXvsProxyOftDestContractAddress), + xvsTokenOmnichainContract.minterToMintedAmount(chainXvsProxyOftDestContractAddress), ]); return { minterToCapMantissa: new BigNumber(minterToCap.toString()), diff --git a/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/useGetXvsBridgeMintStatus.ts b/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/useGetXvsBridgeMintStatus.ts index 4224c20e9e..7e16c80d8c 100644 --- a/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/useGetXvsBridgeMintStatus.ts +++ b/apps/evm/src/clients/api/queries/getXvsBridgeMintStatus/useGetXvsBridgeMintStatus.ts @@ -2,7 +2,7 @@ import { type QueryObserverOptions, useQuery } from '@tanstack/react-query'; import { type GetXvsMintStatusOutput, getXvsBridgeMintStatus } from 'clients/api'; import FunctionKey from 'constants/functionKey'; -import { getXVSProxyOFTDestContractAddress, getXvsTokenMultichainContract } from 'libs/contracts'; +import { getXVSProxyOFTDestContractAddress, getXvsTokenOmnichainContract } from 'libs/contracts'; import { useProvider } from 'libs/wallet'; import { ChainId } from 'types'; import { callOrThrow, generatePseudoRandomRefetchInterval } from 'utilities'; @@ -31,7 +31,7 @@ const useGetXvsBridgeMintStatus = ( options?: Partial, ) => { const { provider } = useProvider({ chainId: destinationChainId }); - const xvsTokenMultichainContract = getXvsTokenMultichainContract({ + const xvsTokenOmnichainContract = getXvsTokenOmnichainContract({ chainId: destinationChainId, signerOrProvider: provider, }); @@ -48,7 +48,7 @@ const useGetXvsBridgeMintStatus = ( ], queryFn: () => - callOrThrow({ xvsTokenMultichainContract, chainXvsProxyOftDestContractAddress }, params => + callOrThrow({ xvsTokenOmnichainContract, chainXvsProxyOftDestContractAddress }, params => getXvsBridgeMintStatus({ ...params }), ), diff --git a/apps/evm/src/clients/subgraph/__mocks__/index.ts b/apps/evm/src/clients/subgraph/__mocks__/index.ts index 55d8bc9df0..005ff98beb 100644 --- a/apps/evm/src/clients/subgraph/__mocks__/index.ts +++ b/apps/evm/src/clients/subgraph/__mocks__/index.ts @@ -1,9 +1,16 @@ -import proposalPreviewsResponse from '__mocks__/subgraph/proposalPreviews.json'; +import bscProposalsResponse from '__mocks__/subgraph/bscProposals.json'; +import nonBscProposalsResponse from '__mocks__/subgraph/nonBscProposals.json'; -export * from '../gql'; export * from '../queries/isolatedPools/getIsolatedPoolParticipantsCount'; -export * from '../queries/governance/getProposalPreviews'; -export * from '../utilities/formatToProposalPreview'; +export * from '../queries/governanceBsc/getBscProposals'; +export * from '../utilities/formatToProposal'; +export * from '../utilities/enrichRemoteProposals'; + +export const getBscProposals = vi.fn(async () => bscProposalsResponse); +export const getBscProposal = vi.fn(async () => ({ + proposal: bscProposalsResponse.proposals[0], +})); + +export const getNonBscProposals = vi.fn(async () => nonBscProposalsResponse); -export const getProposalPreviews = vi.fn(async () => proposalPreviewsResponse); export const getIsolatedPoolParticipantsCount = vi.fn(); diff --git a/apps/evm/src/clients/subgraph/gql/index.ts b/apps/evm/src/clients/subgraph/gql/index.ts deleted file mode 100644 index 61be95ff81..0000000000 --- a/apps/evm/src/clients/subgraph/gql/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './generated/isolatedPools'; -// @ts-expect-error Because we are generating types for multiple GraphQL projects, the common types -// are created multiple times resulting in warnings from Typescript -export * from './generated/governance'; diff --git a/apps/evm/src/clients/subgraph/index.ts b/apps/evm/src/clients/subgraph/index.ts index 529c6fac03..8a99d195c1 100644 --- a/apps/evm/src/clients/subgraph/index.ts +++ b/apps/evm/src/clients/subgraph/index.ts @@ -1,4 +1,6 @@ export * from './queries/isolatedPools/getIsolatedPoolParticipantsCount'; -export * from './queries/governance/getProposalPreviews'; -export * from './utilities/formatToProposalPreview'; -export * from './gql'; +export * from './queries/governanceBsc/getBscProposals'; +export * from './queries/governanceBsc/getBscProposal'; +export * from './queries/governanceNonBsc/getNonBscProposals'; +export * from './utilities/formatToProposal'; +export * from './utilities/enrichRemoteProposals'; diff --git a/apps/evm/src/clients/subgraph/queries/governance/getProposalPreviews/getProposalPreviews.graphql b/apps/evm/src/clients/subgraph/queries/governance/getProposalPreviews/getProposalPreviews.graphql deleted file mode 100644 index 9990a817a7..0000000000 --- a/apps/evm/src/clients/subgraph/queries/governance/getProposalPreviews/getProposalPreviews.graphql +++ /dev/null @@ -1,38 +0,0 @@ -query ProposalPreviews($limit: Int = 10, $skip: Int = 0, $accountAddress: String, $where: Proposal_filter) { - proposals(first: $limit, skip: $skip, where: $where, orderBy: startBlock, orderDirection: desc) { - id - type - startBlock - endBlock - description - executionEta - forVotes - againstVotes - abstainVotes - passing - - queued { - id - timestamp - } - - canceled { - id - timestamp - } - - executed { - id - timestamp - } - - votes(where: { voter: $accountAddress }) { - id - support - } - } - - total: proposals(first: 1000, where: $where) { - id - } -} diff --git a/apps/evm/src/clients/subgraph/queries/governance/getProposalPreviews/index.ts b/apps/evm/src/clients/subgraph/queries/governance/getProposalPreviews/index.ts deleted file mode 100644 index f25762bd7a..0000000000 --- a/apps/evm/src/clients/subgraph/queries/governance/getProposalPreviews/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { request } from 'graphql-request'; - -import { ProposalPreviewsDocument, type ProposalPreviewsQueryVariables } from 'clients/subgraph'; -import config from 'config'; -import type { ChainId } from 'types'; - -export interface GetProposalPreviewsInput { - chainId: ChainId; - variables: ProposalPreviewsQueryVariables; -} - -export const getProposalPreviews = ({ chainId, variables }: GetProposalPreviewsInput) => - config.governanceSubgraphUrls[chainId] - ? request({ - url: config.governanceSubgraphUrls[chainId], - variables, - document: ProposalPreviewsDocument, - }) - : undefined; diff --git a/apps/evm/src/clients/subgraph/queries/governanceBsc/fragments/bscProposal.graphql b/apps/evm/src/clients/subgraph/queries/governanceBsc/fragments/bscProposal.graphql new file mode 100644 index 0000000000..2a128b5fa3 --- /dev/null +++ b/apps/evm/src/clients/subgraph/queries/governanceBsc/fragments/bscProposal.graphql @@ -0,0 +1,92 @@ +fragment BscProposal on Proposal { + id + proposalId + startBlock + endBlock + forVotes + againstVotes + abstainVotes + executionEta + type + description + passing + targets + values + signatures + calldatas + + proposer { + id + } + + created { + id + timestamp + txHash + } + + executed { + id + timestamp + txHash + } + + canceled { + id + timestamp + txHash + } + + queued { + id + timestamp + txHash + } + + votes { + id + support + votes + reason + + voter { + id + totalVotesMantissa + } + } + + remoteProposals { + id + proposalId + + targets + values + signatures + calldatas + + trustedRemote { + id + layerZeroChainId + } + + stateTransactions { + stored { + id + timestamp + txHash + } + + executed { + id + timestamp + txHash + } + + withdrawn { + id + timestamp + txHash + } + } + } +} diff --git a/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposal/getBscProposal.graphql b/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposal/getBscProposal.graphql new file mode 100644 index 0000000000..5010c96c83 --- /dev/null +++ b/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposal/getBscProposal.graphql @@ -0,0 +1,5 @@ +query Proposal($id: ID!) { + proposal(id: $id) { + ...BscProposal + } +} diff --git a/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposal/index.ts b/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposal/index.ts new file mode 100644 index 0000000000..7f0b5b84b3 --- /dev/null +++ b/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposal/index.ts @@ -0,0 +1,22 @@ +import { request } from 'graphql-request'; + +import { + ProposalDocument, + type ProposalQueryVariables, +} from 'clients/subgraph/gql/generated/governanceBsc'; +import config from 'config'; +import type { ChainId } from 'types'; + +export interface GetBscProposalInput { + chainId: ChainId; + variables: ProposalQueryVariables; +} + +export const getBscProposal = ({ chainId, variables }: GetBscProposalInput) => + config.governanceSubgraphUrls[chainId] + ? request({ + url: config.governanceSubgraphUrls[chainId], + variables, + document: ProposalDocument, + }) + : undefined; diff --git a/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposals/getBscProposals.graphql b/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposals/getBscProposals.graphql new file mode 100644 index 0000000000..7bab4ad462 --- /dev/null +++ b/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposals/getBscProposals.graphql @@ -0,0 +1,9 @@ +query Proposals($limit: Int = 10, $skip: Int = 0, $where: Proposal_filter) { + proposals(first: $limit, skip: $skip, where: $where, orderBy: startBlock, orderDirection: desc) { + ...BscProposal + } + + total: proposals(where: $where) { + id + } +} diff --git a/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposals/index.ts b/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposals/index.ts new file mode 100644 index 0000000000..b9d8ba0b1f --- /dev/null +++ b/apps/evm/src/clients/subgraph/queries/governanceBsc/getBscProposals/index.ts @@ -0,0 +1,22 @@ +import { request } from 'graphql-request'; + +import { + ProposalsDocument, + type ProposalsQueryVariables, +} from 'clients/subgraph/gql/generated/governanceBsc'; +import config from 'config'; +import type { ChainId } from 'types'; + +export interface GetBscProposalsInput { + chainId: ChainId; + variables: ProposalsQueryVariables; +} + +export const getBscProposals = ({ chainId, variables }: GetBscProposalsInput) => + config.governanceSubgraphUrls[chainId] + ? request({ + url: config.governanceSubgraphUrls[chainId], + variables, + document: ProposalsDocument, + }) + : undefined; diff --git a/apps/evm/src/clients/subgraph/queries/governanceNonBsc/fragments/nonBscProposal.graphql b/apps/evm/src/clients/subgraph/queries/governanceNonBsc/fragments/nonBscProposal.graphql new file mode 100644 index 0000000000..ef7f971b17 --- /dev/null +++ b/apps/evm/src/clients/subgraph/queries/governanceNonBsc/fragments/nonBscProposal.graphql @@ -0,0 +1,23 @@ +fragment NonBscProposal on Proposal { + id + proposalId + executionEta + + queued { + id + timestamp + txHash + } + + canceled { + id + timestamp + txHash + } + + executed { + id + timestamp + txHash + } +} diff --git a/apps/evm/src/clients/subgraph/queries/governanceNonBsc/getNonBscProposals/getNonBscProposals.graphql b/apps/evm/src/clients/subgraph/queries/governanceNonBsc/getNonBscProposals/getNonBscProposals.graphql new file mode 100644 index 0000000000..0271b8cdb4 --- /dev/null +++ b/apps/evm/src/clients/subgraph/queries/governanceNonBsc/getNonBscProposals/getNonBscProposals.graphql @@ -0,0 +1,5 @@ +query Proposals($where: Proposal_filter) { + proposals(where: $where) { + ...NonBscProposal + } +} diff --git a/apps/evm/src/clients/subgraph/queries/governanceNonBsc/getNonBscProposals/index.ts b/apps/evm/src/clients/subgraph/queries/governanceNonBsc/getNonBscProposals/index.ts new file mode 100644 index 0000000000..a5387758f0 --- /dev/null +++ b/apps/evm/src/clients/subgraph/queries/governanceNonBsc/getNonBscProposals/index.ts @@ -0,0 +1,22 @@ +import { request } from 'graphql-request'; + +import { + ProposalsDocument, + type ProposalsQueryVariables, +} from 'clients/subgraph/gql/generated/governanceNonBsc'; +import config from 'config'; +import type { ChainId } from 'types'; + +export interface GetNonBscProposalsInput { + chainId: ChainId; + variables: ProposalsQueryVariables; +} + +export const getNonBscProposals = ({ chainId, variables }: GetNonBscProposalsInput) => + config.governanceSubgraphUrls[chainId] + ? request({ + url: config.governanceSubgraphUrls[chainId], + variables, + document: ProposalsDocument, + }) + : undefined; diff --git a/apps/evm/src/clients/subgraph/queries/isolatedPools/getIsolatedPoolParticipantsCount/index.ts b/apps/evm/src/clients/subgraph/queries/isolatedPools/getIsolatedPoolParticipantsCount/index.ts index e6d97fb972..2513caf2bb 100644 --- a/apps/evm/src/clients/subgraph/queries/isolatedPools/getIsolatedPoolParticipantsCount/index.ts +++ b/apps/evm/src/clients/subgraph/queries/isolatedPools/getIsolatedPoolParticipantsCount/index.ts @@ -1,6 +1,6 @@ import { request } from 'graphql-request'; -import { IsolatedPoolParticipantsCountDocument } from 'clients/subgraph'; +import { IsolatedPoolParticipantsCountDocument } from 'clients/subgraph/gql/generated/isolatedPools'; import config from 'config'; import type { ChainId } from 'types'; diff --git a/apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/__tests__/__snapshots__/index.spec.ts.snap new file mode 100644 index 0000000000..713208a359 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/__tests__/__snapshots__/index.spec.ts.snap @@ -0,0 +1,150 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`enrichRemoteProposals > returns remote proposals in the correct format 1`] = ` +{ + "4": { + "calldatas": [ + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000197365745265636569766556657273696f6e2875696e7431362900000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000197365745265636569766556657273696f6e2875696e7431362900000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000207365744d61784461696c79526563656976654c696d69742875696e7432353629", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000207365744d61784461696c79526563656976654c696d69742875696e7432353629", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000077061757365282900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000077061757365282900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e0000000000000000000000000000000000000000000000000000000000000026736574436f6e6669672875696e7431362c75696e7431362c75696e743235362c6279746573290000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc000000000000000000000000000000000000000000000000000000000000000026736574436f6e6669672875696e7431362c75696e7431362c75696e743235362c6279746573290000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e000000000000000000000000000000000000000000000000000000000000001761646454696d656c6f636b7328616464726573735b5d29000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc00000000000000000000000000000000000000000000000000000000000000001761646454696d656c6f636b7328616464726573735b5d29000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e000000000000000000000000000000000000000000000000000000000000002772657472794d6573736167652875696e7431362c62797465732c75696e7436342c62797465732900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc00000000000000000000000000000000000000000000000000000000000000002772657472794d6573736167652875696e7431362c62797465732c75696e7436342c62797465732900000000000000000000000000000000000000000000000000", + ], + "canceled": null, + "executed": { + "id": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "timestamp": "1720520363", + "txHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + }, + "executionEta": "1719935819", + "id": "4", + "proposalId": "4", + "queued": { + "id": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "timestamp": "1719763019", + "txHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + }, + "signatures": [ + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + ], + "targets": [ + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + ], + "values": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + ], + }, + "5": { + "calldatas": [ + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000197365745265636569766556657273696f6e2875696e7431362900000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000197365745265636569766556657273696f6e2875696e7431362900000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000207365744d61784461696c79526563656976654c696d69742875696e7432353629", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000207365744d61784461696c79526563656976654c696d69742875696e7432353629", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e00000000000000000000000000000000000000000000000000000000000000077061757365282900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc0000000000000000000000000000000000000000000000000000000000000000077061757365282900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e0000000000000000000000000000000000000000000000000000000000000026736574436f6e6669672875696e7431362c75696e7431362c75696e743235362c6279746573290000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc000000000000000000000000000000000000000000000000000000000000000026736574436f6e6669672875696e7431362c75696e7431362c75696e743235362c6279746573290000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e000000000000000000000000000000000000000000000000000000000000001761646454696d656c6f636b7328616464726573735b5d29000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc00000000000000000000000000000000000000000000000000000000000000001761646454696d656c6f636b7328616464726573735b5d29000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba00000000000000000000000000000000000000000000000000000000000000600000000000000000000000008764f50616b62a99a997876c2deaaa04554c5b2e000000000000000000000000000000000000000000000000000000000000002772657472794d6573736167652875696e7431362c62797465732c75696e7436342c62797465732900000000000000000000000000000000000000000000000000", + "0x00000000000000000000000087ed3fd3a25d157637b955991fb1b41b566916ba0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000eb9b85342c34f65af734c7bd4a149c86c472bc00000000000000000000000000000000000000000000000000000000000000002772657472794d6573736167652875696e7431362c62797465732c75696e7436342c62797465732900000000000000000000000000000000000000000000000000", + ], + "canceled": null, + "executed": { + "id": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "timestamp": "1720520363", + "txHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + }, + "executionEta": "1719935819", + "id": "5", + "proposalId": "5", + "queued": { + "id": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "timestamp": "1719763019", + "txHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + }, + "signatures": [ + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + "giveCallPermission(address,string,address)", + ], + "targets": [ + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + "0x230058da2d23eb8836ec5db7037ef7250c56e25e", + ], + "values": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + ], + }, +} +`; diff --git a/apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/__tests__/index.spec.ts b/apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/__tests__/index.spec.ts new file mode 100644 index 0000000000..334728e2e9 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/__tests__/index.spec.ts @@ -0,0 +1,12 @@ +import bscProposalsResponse from '__mocks__/subgraph/bscProposals.json'; +import { enrichRemoteProposals } from '..'; + +describe('enrichRemoteProposals', () => { + it('returns remote proposals in the correct format', async () => { + const res = await enrichRemoteProposals({ + gqlRemoteProposals: bscProposalsResponse.proposals[0].remoteProposals, + }); + + expect(res).toMatchSnapshot(); + }); +}); diff --git a/apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/index.ts b/apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/index.ts new file mode 100644 index 0000000000..9d3f5c74c9 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/enrichRemoteProposals/index.ts @@ -0,0 +1,58 @@ +import { getNonBscProposals } from 'clients/subgraph'; +import type { RemoteProposal } from 'clients/subgraph/gql/generated/governanceBsc'; +import type { NonBscProposalFragment } from 'clients/subgraph/gql/generated/governanceNonBsc'; +import { CHAIN_IDS_ON_LAYER_ZERO } from 'constants/layerZero'; +import type { ChainId } from 'types'; +import { extractSettledPromiseValue } from 'utilities'; + +export const enrichRemoteProposals = async ({ + gqlRemoteProposals, +}: { + gqlRemoteProposals: (Pick & { + trustedRemote: Pick; + })[]; +}) => { + // Group proposals by chain ID + const remoteProposalIdsMapping: { + [chainId in ChainId]?: number[]; + } = {}; + + gqlRemoteProposals.forEach(remoteProposal => { + // Map LayerZero chain ID to actual chain ID + const remoteChainId = CHAIN_IDS_ON_LAYER_ZERO[remoteProposal.trustedRemote.layerZeroChainId]; + + if (remoteProposal.proposalId) { + remoteProposalIdsMapping[remoteChainId] = [ + ...(remoteProposalIdsMapping[remoteChainId] || []), + remoteProposal.proposalId, + ]; + } + }); + + const results = await Promise.allSettled( + Object.entries(remoteProposalIdsMapping).map(([chainId, remoteProposalIds]) => + getNonBscProposals({ + chainId: Number(chainId) as ChainId, + variables: { + where: { + proposalId_in: remoteProposalIds.map(String), + }, + }, + }), + ), + ); + + const enrichedProposals = results.flatMap(extractSettledPromiseValue); + + const enrichedProposalsMapping: { + [proposalId: number]: NonBscProposalFragment; + } = {}; + + enrichedProposals.forEach(p => { + p?.proposals?.forEach(proposal => { + enrichedProposalsMapping[proposal.proposalId] = proposal; + }); + }); + + return enrichedProposalsMapping; +}; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/subgraph/utilities/formatToProposal/__tests__/__snapshots__/index.spec.ts.snap new file mode 100644 index 0000000000..d84710b26d --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/__tests__/__snapshots__/index.spec.ts.snap @@ -0,0 +1,144 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`formatToProposal > returns proposal in the correct format 1`] = ` +{ + "abstainVotes": [], + "abstainedVotesMantissa": "0", + "againstVotes": [], + "againstVotesMantissa": "0", + "cancelDate": undefined, + "cancelTxHash": undefined, + "createdDate": 2024-10-01T11:58:15.000Z, + "createdTxHash": "0xcfafe0fcb0ed8ba08a454be1c05d0883287b76457cf0fae93d07f0131d565e49", + "description": { + "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", + "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", + "description": "#### Description + Mint faucet on all network", + "forDescription": "I agree that Venus Protocol should proceed with this proposal", + "title": "Test VIP", + "version": "v2", + }, + "endBlock": 44354696, + "endDate": 2024-06-26T06:49:41.000Z, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 1970-01-01T00:00:00.000Z, + "expiredDate": undefined, + "forVotes": [], + "forVotesMantissa": "0", + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x00000000000000000000000003862dfa5d0be8f64509c001cb8c6188194469df0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "allocateTo(address,uint256)", + "target": "0xb32171ecd878607ffc4f8fc0bcce6852bb3149e0", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027b1000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 2, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027f7000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000772d68929655ce7234c8c94256526dda66ef641e0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + { + "actionIndex": 3, + "callData": "0x00000000000000000000000000000000000000000000000000000000000027da000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac9b3801d0a8f5055428ae0bf301ca1da9768550000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6661756365742875696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000002200010000000000000000000000000000000000000000000000000000000000124f80000000000000000000000000000000000000000000000000000000000000", + "signature": "execute(uint16,bytes,bytes,address)", + "target": "0xcfd34aeb46b1cb4779c945854d405e91d27a1899", + "value": "0", + }, + ], + "proposalId": 436, + "proposalType": 0, + "proposerAddress": "0x2ce1d0ffd7e869d9df33e28552b12ddded326706", + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposals": [ + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0xf3118a17863996b9f2a073c9a66faaa664355cf8", + "value": "0", + }, + ], + "proposalId": 436, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 5611, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x8ac9b3801d0a8f5055428ae0bf301ca1da976855", + "value": "0", + }, + ], + "proposalId": 436, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + { + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 421614, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": undefined, + "expiredDate": undefined, + "proposalActions": [ + { + "actionIndex": 0, + "callData": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", + "signature": "faucet(uint256)", + "target": "0x772d68929655ce7234c8c94256526dda66ef641e", + "value": "0", + }, + ], + "proposalId": 436, + "queuedDate": undefined, + "queuedTxHash": undefined, + "remoteProposalId": undefined, + "state": 0, + }, + ], + "startDate": 2024-06-26T06:42:11.000Z, + "state": 0, + "totalVotesMantissa": "0", + "userVoteSupport": undefined, +} +`; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/__tests__/index.spec.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposal/__tests__/index.spec.ts new file mode 100644 index 0000000000..f9caabad07 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/__tests__/index.spec.ts @@ -0,0 +1,24 @@ +import fakeAccountAddress from '__mocks__/models/address'; +import bscProposalsResponse from '__mocks__/subgraph/bscProposals.json'; +import nonBscProposalsResponse from '__mocks__/subgraph/nonBscProposals.json'; +import BigNumber from 'bignumber.js'; +import type { ProposalsQuery } from 'clients/subgraph/gql/generated/governanceBsc'; +import { formatToProposal } from '..'; + +describe('formatToProposal', () => { + beforeEach(() => { + vi.useFakeTimers().setSystemTime(new Date(1710401645000)); + }); + + it('returns proposal in the correct format', async () => { + const res = formatToProposal({ + gqlProposal: bscProposalsResponse.proposals[0] as ProposalsQuery['proposals'][number], + gqlRemoteProposalsMapping: nonBscProposalsResponse.proposals, + currentBlockNumber: 41360384, + proposalMinQuorumVotesMantissa: new BigNumber('1000000000000000000000'), + accountAddress: fakeAccountAddress, + }); + + expect(res).toMatchSnapshot(); + }); +}); diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/__tests__/__snapshots__/index.spec.ts.snap new file mode 100644 index 0000000000..8097eca3f6 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/__tests__/__snapshots__/index.spec.ts.snap @@ -0,0 +1,20 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`formatToProposalActions > returns proposal actions in the correct format 1`] = ` +[ + { + "actionIndex": 0, + "callData": "fake-call-data-1", + "signature": "fakeSignature1()", + "target": "0x2Ce1d0ffd7e869d9df33e28552b12DdDed326706", + "value": "0", + }, + { + "actionIndex": 1, + "callData": "fake-call-data-2", + "signature": "fakeSignature2()", + "target": "0x3Ce1d0ffd7e869d9df33e28552b12DdDed326706", + "value": "1000000", + }, +] +`; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/__tests__/index.spec.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/__tests__/index.spec.ts new file mode 100644 index 0000000000..091418ef4e --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/__tests__/index.spec.ts @@ -0,0 +1,17 @@ +import { formatToProposalActions } from '..'; + +describe('formatToProposalActions', () => { + it('returns proposal actions in the correct format', async () => { + const res = formatToProposalActions({ + callDatas: ['fake-call-data-1', 'fake-call-data-2'], + signatures: ['fakeSignature1()', 'fakeSignature2()'], + targets: [ + '0x2Ce1d0ffd7e869d9df33e28552b12DdDed326706', + '0x3Ce1d0ffd7e869d9df33e28552b12DdDed326706', + ], + values: ['0', '1000000'], + }); + + expect(res).toMatchSnapshot(); + }); +}); diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/index.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/index.ts new file mode 100644 index 0000000000..02221161b1 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToProposalActions/index.ts @@ -0,0 +1,22 @@ +import type { ProposalAction } from 'types'; + +export const formatToProposalActions = ({ + callDatas, + signatures, + targets, + values, +}: { + callDatas: string[]; + signatures: string[]; + targets: string[]; + values: (string | null)[]; +}) => + callDatas.reduce((acc, callData, index) => { + const signature = signatures[index]; + const value = values[index]; + const target = targets[index]; + + return callData && signature && value && target + ? [...acc, { actionIndex: index, signature, value, target, callData }] + : acc; + }, []); diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/__tests__/__snapshots__/index.spec.ts.snap new file mode 100644 index 0000000000..0d2f2d0c75 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/__tests__/__snapshots__/index.spec.ts.snap @@ -0,0 +1,153 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`formatToRemoteProposal > returns bridged remote proposal in the correct format 1`] = ` +{ + "bridgedDate": 2022-06-29T10:43:23.000Z, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": 2024-07-09T10:19:23.000Z, + "executedTxHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "executionEtaDate": 2024-07-02T15:56:59.000Z, + "expiredDate": undefined, + "proposalActions": [], + "proposalId": 1, + "queuedDate": 2024-06-30T15:56:59.000Z, + "queuedTxHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "remoteProposalId": 4, + "state": 0, +} +`; + +exports[`formatToRemoteProposal > returns canceled remote proposal in the correct format 1`] = ` +{ + "bridgedDate": 2022-06-29T10:43:23.000Z, + "canceledDate": 2024-07-09T10:19:23.000Z, + "canceledTxHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 2024-07-02T15:56:59.000Z, + "expiredDate": undefined, + "proposalActions": [], + "proposalId": 1, + "queuedDate": 2024-06-30T15:56:59.000Z, + "queuedTxHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "remoteProposalId": 4, + "state": 0, +} +`; + +exports[`formatToRemoteProposal > returns expired remote proposal in the correct format 1`] = ` +{ + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": undefined, + "executedTxHash": undefined, + "executionEtaDate": 2024-07-02T15:56:59.000Z, + "expiredDate": 2024-07-16T15:56:59.000Z, + "proposalActions": [], + "proposalId": 1, + "queuedDate": 2024-06-30T15:56:59.000Z, + "queuedTxHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "remoteProposalId": 4, + "state": 4, +} +`; + +exports[`formatToRemoteProposal > returns pending remote proposal in the correct format 1`] = ` +{ + "bridgedDate": undefined, + "canceledDate": undefined, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": 2024-07-09T10:19:23.000Z, + "executedTxHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "executionEtaDate": 2024-07-02T15:56:59.000Z, + "expiredDate": undefined, + "proposalActions": [], + "proposalId": 1, + "queuedDate": 2024-06-30T15:56:59.000Z, + "queuedTxHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "remoteProposalId": 4, + "state": 0, +} +`; + +exports[`formatToRemoteProposal > returns remote proposal as canceled when source proposal state is 2 in the correct format 1`] = ` +{ + "bridgedDate": undefined, + "canceledDate": 2024-03-14T12:01:40.000Z, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": 2024-07-09T10:19:23.000Z, + "executedTxHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "executionEtaDate": 2024-07-02T15:56:59.000Z, + "expiredDate": undefined, + "proposalActions": [], + "proposalId": 1, + "queuedDate": 2024-06-30T15:56:59.000Z, + "queuedTxHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "remoteProposalId": 4, + "state": 0, +} +`; + +exports[`formatToRemoteProposal > returns remote proposal as canceled when source proposal state is 3 in the correct format 1`] = ` +{ + "bridgedDate": undefined, + "canceledDate": 2024-03-14T12:05:00.000Z, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": 2024-07-09T10:19:23.000Z, + "executedTxHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "executionEtaDate": 2024-07-02T15:56:59.000Z, + "expiredDate": undefined, + "proposalActions": [], + "proposalId": 1, + "queuedDate": 2024-06-30T15:56:59.000Z, + "queuedTxHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "remoteProposalId": 4, + "state": 0, +} +`; + +exports[`formatToRemoteProposal > returns remote proposal as canceled when source proposal state is 6 in the correct format 1`] = ` +{ + "bridgedDate": undefined, + "canceledDate": 2024-03-14T12:03:20.000Z, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": 2024-07-09T10:19:23.000Z, + "executedTxHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "executionEtaDate": 2024-07-02T15:56:59.000Z, + "expiredDate": undefined, + "proposalActions": [], + "proposalId": 1, + "queuedDate": 2024-06-30T15:56:59.000Z, + "queuedTxHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "remoteProposalId": 4, + "state": 0, +} +`; + +exports[`formatToRemoteProposal > returns withdrawn remote proposal in the correct format 1`] = ` +{ + "bridgedDate": undefined, + "canceledDate": 2022-06-29T10:43:23.000Z, + "canceledTxHash": undefined, + "chainId": 11155111, + "executedDate": 2024-07-09T10:19:23.000Z, + "executedTxHash": "0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164", + "executionEtaDate": 2024-07-02T15:56:59.000Z, + "expiredDate": undefined, + "proposalActions": [], + "proposalId": 1, + "queuedDate": 2024-06-30T15:56:59.000Z, + "queuedTxHash": "0x3f4f7a17f7ed78c0c3620e61391aeab8b0a22b2438c7c8b65396e3d52c617d1f", + "remoteProposalId": 4, + "state": 0, +} +`; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/__tests__/index.spec.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/__tests__/index.spec.ts new file mode 100644 index 0000000000..907aa16c96 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/__tests__/index.spec.ts @@ -0,0 +1,110 @@ +import nonBscProposalsResponse from '__mocks__/subgraph/nonBscProposals.json'; +import { ProposalState, RemoteProposalState } from 'types'; +import type Vi from 'vitest'; +import { formatToProposalActions } from '../../formatToProposalActions'; +import { getRemoteProposalState } from '../getRemoteProposalState'; + +import { formatToRemoteProposal } from '..'; + +vi.mock('../getRemoteProposalState'); +vi.mock('../../formatToProposalActions'); + +const params = { + layerZeroChainId: 10161, + proposalId: 1, + remoteProposalId: 1, + gqlRemoteProposal: nonBscProposalsResponse.proposals[0], + proposalState: ProposalState.Executed, + callDatas: [], + signatures: [], + targets: [], + values: [], +}; + +const fakeDate = new Date('2024-03-14T12:00:00Z'); + +describe('formatToRemoteProposal', () => { + beforeEach(() => { + vi.useFakeTimers().setSystemTime(fakeDate); + + (getRemoteProposalState as Vi.Mock).mockImplementation(() => RemoteProposalState.Pending); + (formatToProposalActions as Vi.Mock).mockImplementation(() => []); + }); + + afterEach(() => { + vi.useRealTimers(); + }); + + it('returns pending remote proposal in the correct format', () => { + const result = formatToRemoteProposal(params); + + expect(result).toMatchSnapshot(); + }); + + it('returns withdrawn remote proposal in the correct format', () => { + const result = formatToRemoteProposal({ + ...params, + withdrawnTimestampSeconds: 1656499403, + }); + + expect(result).toMatchSnapshot(); + }); + + it('returns canceled remote proposal in the correct format', () => { + const result = formatToRemoteProposal({ + ...params, + gqlRemoteProposal: { + ...nonBscProposalsResponse.proposals[0], + canceled: { + id: '0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164', + timestamp: '1720520363', + txHash: '0x544c7a7eaa39193348b5907232f9cee66c8aa6f609200d03792289b40487d164', + }, + executed: null, + }, + bridgedTimestampSeconds: 1656499403, + }); + + expect(result).toMatchSnapshot(); + }); + + it.each([ + [ProposalState.Canceled, { proposalCanceledDate: new Date(fakeDate.getTime() + 100000) }], + [ProposalState.Expired, { proposalExpiredDate: new Date(fakeDate.getTime() + 200000) }], + [ProposalState.Defeated, { proposalEndDate: new Date(fakeDate.getTime() + 300000) }], + ])( + 'returns remote proposal as canceled when source proposal state is %s in the correct format', + (proposalState, otherParams) => { + const result = formatToRemoteProposal({ + ...params, + ...otherParams, + proposalState, + }); + + expect(result).toMatchSnapshot(); + }, + ); + + it('returns bridged remote proposal in the correct format', () => { + const result = formatToRemoteProposal({ + ...params, + bridgedTimestampSeconds: 1656499403, + }); + + expect(result).toMatchSnapshot(); + }); + + it('returns expired remote proposal in the correct format', () => { + (getRemoteProposalState as Vi.Mock).mockImplementation(() => RemoteProposalState.Expired); + + const result = formatToRemoteProposal({ + ...params, + gqlRemoteProposal: { + ...nonBscProposalsResponse.proposals[0], + executed: null, + }, + }); + + expect(result).toMatchSnapshot(); + }); +}); diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/getRemoteProposalState/__tests__/index.spec.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/getRemoteProposalState/__tests__/index.spec.ts new file mode 100644 index 0000000000..a66c5dff59 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/getRemoteProposalState/__tests__/index.spec.ts @@ -0,0 +1,127 @@ +import { PROPOSAL_EXECUTION_GRACE_PERIOD_MS } from 'constants/chainMetadata'; +import { ProposalState, RemoteProposalState } from 'types'; +import { getRemoteProposalState } from '..'; + +describe('getRemoteProposalState', () => { + beforeEach(() => { + vi.useFakeTimers().setSystemTime(new Date('2024-03-14T12:00:00Z')); + }); + + afterEach(() => { + vi.useRealTimers(); + }); + + it('returns Canceled when isRemoteProposalCanceled is true', () => { + const result = getRemoteProposalState({ + proposalState: ProposalState.Executed, + isRemoteProposalBridged: true, + isRemoteProposalQueued: true, + isRemoteProposalExecuted: false, + isRemoteProposalCanceled: true, + }); + expect(result).toBe(RemoteProposalState.Canceled); + }); + + it('returns Canceled when proposalState is Canceled, Defeated or Expired', () => { + const baseParams = { + isRemoteProposalBridged: true, + isRemoteProposalQueued: true, + isRemoteProposalExecuted: false, + isRemoteProposalCanceled: true, + }; + + expect( + getRemoteProposalState({ + proposalState: ProposalState.Canceled, + ...baseParams, + }), + ).toBe(RemoteProposalState.Canceled); + + expect( + getRemoteProposalState({ + proposalState: ProposalState.Defeated, + ...baseParams, + }), + ).toBe(RemoteProposalState.Canceled); + + expect( + getRemoteProposalState({ + proposalState: ProposalState.Expired, + ...baseParams, + }), + ).toBe(RemoteProposalState.Canceled); + }); + + it('returns Executed when isRemoteProposalExecuted is true', () => { + const result = getRemoteProposalState({ + proposalState: ProposalState.Executed, + isRemoteProposalBridged: true, + isRemoteProposalQueued: true, + isRemoteProposalExecuted: true, + isRemoteProposalCanceled: false, + }); + expect(result).toBe(RemoteProposalState.Executed); + }); + + it('returns Pending when not isRemoteProposalBridged and not isRemoteProposalQueued', () => { + const result = getRemoteProposalState({ + proposalState: ProposalState.Executed, + isRemoteProposalBridged: false, + isRemoteProposalQueued: false, + isRemoteProposalExecuted: false, + isRemoteProposalCanceled: false, + }); + expect(result).toBe(RemoteProposalState.Pending); + }); + + it('returns Bridged when isRemoteProposalBridged and not isRemoteProposalQueued', () => { + const result = getRemoteProposalState({ + proposalState: ProposalState.Executed, + isRemoteProposalBridged: true, + isRemoteProposalQueued: false, + isRemoteProposalExecuted: false, + isRemoteProposalCanceled: false, + }); + expect(result).toBe(RemoteProposalState.Bridged); + }); + + it('returns Queued when isRemoteProposalQueued and not expired', () => { + const result = getRemoteProposalState({ + proposalState: ProposalState.Executed, + isRemoteProposalBridged: true, + isRemoteProposalQueued: true, + isRemoteProposalExecuted: false, + isRemoteProposalCanceled: false, + remoteProposalExecutionEtaDate: new Date('2024-03-14T13:00:00Z'), + }); + expect(result).toBe(RemoteProposalState.Queued); + }); + + it('returns Queued when isRemoteProposalQueued and remoteProposalExecutionEtaDate is undefined', () => { + const result = getRemoteProposalState({ + proposalState: ProposalState.Executed, + isRemoteProposalBridged: true, + isRemoteProposalQueued: true, + isRemoteProposalExecuted: false, + isRemoteProposalCanceled: false, + }); + expect(result).toBe(RemoteProposalState.Queued); + }); + + it('returns Expired when isRemoteProposalQueued and expired', () => { + const remoteProposalExecutionEtaDate = new Date('2024-03-14T11:59:59Z'); + remoteProposalExecutionEtaDate.setMilliseconds( + remoteProposalExecutionEtaDate.getMilliseconds() - PROPOSAL_EXECUTION_GRACE_PERIOD_MS - 1, + ); + + const result = getRemoteProposalState({ + proposalState: ProposalState.Executed, + isRemoteProposalBridged: true, + isRemoteProposalQueued: true, + isRemoteProposalExecuted: false, + isRemoteProposalCanceled: false, + remoteProposalExecutionEtaDate, + }); + expect(result).toBe(RemoteProposalState.Expired); + }); +}); diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/getRemoteProposalState/index.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/getRemoteProposalState/index.ts new file mode 100644 index 0000000000..62bc23e6ac --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/getRemoteProposalState/index.ts @@ -0,0 +1,55 @@ +import { PROPOSAL_EXECUTION_GRACE_PERIOD_MS } from 'constants/chainMetadata'; +import { ProposalState, RemoteProposalState } from 'types'; + +export const getRemoteProposalState = ({ + proposalState, + isRemoteProposalBridged, + isRemoteProposalQueued, + isRemoteProposalCanceled, + isRemoteProposalExecuted, + remoteProposalExecutionEtaDate, +}: { + proposalState: ProposalState; + isRemoteProposalBridged: boolean; + isRemoteProposalQueued: boolean; + isRemoteProposalExecuted: boolean; + isRemoteProposalCanceled: boolean; + remoteProposalExecutionEtaDate?: Date; +}) => { + if ( + isRemoteProposalCanceled || + proposalState === ProposalState.Canceled || + proposalState === ProposalState.Defeated || + proposalState === ProposalState.Expired + ) { + return RemoteProposalState.Canceled; + } + + if (isRemoteProposalExecuted) { + return RemoteProposalState.Executed; + } + + if (!isRemoteProposalBridged && !isRemoteProposalQueued) { + return RemoteProposalState.Pending; + } + + if (isRemoteProposalBridged && !isRemoteProposalQueued) { + return RemoteProposalState.Bridged; + } + + if (!remoteProposalExecutionEtaDate) { + return RemoteProposalState.Queued; + } + + const nowMs = new Date().getTime(); + const expiredEtaTimestampMs = + remoteProposalExecutionEtaDate.getTime() + PROPOSAL_EXECUTION_GRACE_PERIOD_MS; + + const expired = expiredEtaTimestampMs < nowMs; + + if (isRemoteProposalQueued && !expired) { + return RemoteProposalState.Queued; + } + + return RemoteProposalState.Expired; +}; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/index.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/index.ts new file mode 100644 index 0000000000..125a43b5a7 --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/formatToRemoteProposal/index.ts @@ -0,0 +1,122 @@ +import type { NonBscProposalFragment } from 'clients/subgraph/gql/generated/governanceNonBsc'; +import { PROPOSAL_EXECUTION_GRACE_PERIOD_MS } from 'constants/chainMetadata'; +import { CHAIN_IDS_ON_LAYER_ZERO } from 'constants/layerZero'; +import { ProposalState, type RemoteProposal, RemoteProposalState } from 'types'; +import { convertToDate } from 'utilities'; +import { formatToProposalActions } from '../formatToProposalActions'; +import { getRemoteProposalState } from './getRemoteProposalState'; + +export const formatToRemoteProposal = ({ + proposalState, + proposalCanceledDate, + proposalExpiredDate, + proposalEndDate, + proposalId, + layerZeroChainId, + gqlRemoteProposal, + bridgedTimestampSeconds, + failedTimestampSeconds, + withdrawnTimestampSeconds, + withdrawnTxHash, + callDatas, + signatures, + targets, + values, +}: { + proposalState: ProposalState; + layerZeroChainId: number; + proposalId: number; + callDatas: string[]; + signatures: string[]; + targets: string[]; + values: string[]; + proposalCanceledDate?: Date; + proposalExpiredDate?: Date; + proposalEndDate?: Date; + failedTimestampSeconds?: number; + bridgedTimestampSeconds?: number; + withdrawnTimestampSeconds?: number; + withdrawnTxHash?: string; + gqlRemoteProposal?: NonBscProposalFragment; +}) => { + const chainId = CHAIN_IDS_ON_LAYER_ZERO[layerZeroChainId]; + + let canceledDate: Date | undefined; + let canceledTxHash: string | undefined; + + if (gqlRemoteProposal?.canceled?.timestamp) { + canceledDate = convertToDate({ + timestampSeconds: Number(gqlRemoteProposal?.canceled?.timestamp), + }); + canceledTxHash = gqlRemoteProposal.canceled.txHash; + } else if (failedTimestampSeconds) { + canceledDate = convertToDate({ + timestampSeconds: Number(failedTimestampSeconds), + }); + } else if (withdrawnTimestampSeconds) { + canceledDate = convertToDate({ + timestampSeconds: Number(withdrawnTimestampSeconds), + }); + canceledTxHash = withdrawnTxHash; + } else if ( + proposalState === ProposalState.Canceled || + proposalState === ProposalState.Expired || + proposalState === ProposalState.Defeated + ) { + canceledDate = proposalCanceledDate || proposalExpiredDate || proposalEndDate; + } + + const executionEtaDate = gqlRemoteProposal?.executionEta + ? convertToDate({ + timestampSeconds: Number(gqlRemoteProposal.executionEta), + }) + : undefined; + + const state = getRemoteProposalState({ + proposalState, + isRemoteProposalBridged: !!bridgedTimestampSeconds, + isRemoteProposalQueued: !!gqlRemoteProposal?.queued?.timestamp, + isRemoteProposalExecuted: !!gqlRemoteProposal?.executed?.timestamp, + isRemoteProposalCanceled: !!canceledDate, + remoteProposalExecutionEtaDate: executionEtaDate, + }); + + const expiredDate = + state === RemoteProposalState.Expired && executionEtaDate + ? new Date(executionEtaDate.getTime() + PROPOSAL_EXECUTION_GRACE_PERIOD_MS) + : undefined; + + const remoteProposal: RemoteProposal = { + proposalId, + remoteProposalId: gqlRemoteProposal && Number(gqlRemoteProposal.proposalId), + chainId, + proposalActions: formatToProposalActions({ + callDatas, + signatures, + targets, + values, + }), + canceledDate, + canceledTxHash, + bridgedDate: bridgedTimestampSeconds + ? convertToDate({ timestampSeconds: bridgedTimestampSeconds }) + : undefined, + queuedDate: gqlRemoteProposal?.queued?.timestamp + ? convertToDate({ + timestampSeconds: Number(gqlRemoteProposal.queued.timestamp), + }) + : undefined, + queuedTxHash: gqlRemoteProposal?.queued?.txHash, + executionEtaDate, + executedDate: gqlRemoteProposal?.executed?.timestamp + ? convertToDate({ + timestampSeconds: Number(gqlRemoteProposal.executed.timestamp), + }) + : undefined, + executedTxHash: gqlRemoteProposal?.executed?.txHash, + expiredDate, + state, + }; + + return remoteProposal; +}; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposal/index.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposal/index.ts new file mode 100644 index 0000000000..64ff123f8a --- /dev/null +++ b/apps/evm/src/clients/subgraph/utilities/formatToProposal/index.ts @@ -0,0 +1,238 @@ +import BigNumber from 'bignumber.js'; +import type { BscProposalFragment } from 'clients/subgraph/gql/generated/governanceBsc'; +import type { NonBscProposalFragment } from 'clients/subgraph/gql/generated/governanceNonBsc'; +import { CHAIN_METADATA, PROPOSAL_EXECUTION_GRACE_PERIOD_MS } from 'constants/chainMetadata'; +import { governanceChain } from 'libs/wallet'; +import { + type AbstainVoter, + type AgainstVoter, + type ForVoter, + type Proposal, + ProposalState, + type RemoteProposal, + VoteSupport, +} from 'types'; +import { + areAddressesEqual, + compareBigNumbers, + convertToDate, + formatToProposalDescription, + getProposalState, + getProposalType, + getUserVoteSupport, +} from 'utilities'; +import { formatToProposalActions } from './formatToProposalActions'; +import { formatToRemoteProposal } from './formatToRemoteProposal'; + +const { blockTimeMs: BSC_BLOCK_TIME_MS } = CHAIN_METADATA[governanceChain.id]; + +export const formatToProposal = ({ + gqlProposal, + gqlRemoteProposalsMapping, + currentBlockNumber, + proposalMinQuorumVotesMantissa, + accountAddress, +}: { + gqlProposal: BscProposalFragment; + gqlRemoteProposalsMapping: { + [proposalId: number]: NonBscProposalFragment; + }; + currentBlockNumber: number; + proposalMinQuorumVotesMantissa: BigNumber; + accountAddress?: string; +}) => { + const executionEtaDate = convertToDate({ + timestampSeconds: Number(gqlProposal.executionEta), + }); + + const nowMs = new Date().getTime(); + const startDate = new Date( + nowMs + (Number(gqlProposal.startBlock) - currentBlockNumber) * BSC_BLOCK_TIME_MS!, + ); + const endDate = new Date( + nowMs + (Number(gqlProposal.endBlock) - currentBlockNumber) * BSC_BLOCK_TIME_MS!, + ); + + // Extract votes + const { + forVotes, + againstVotes, + abstainVotes, + totalVotesMantissa, + abstainedVotesMantissa, + againstVotesMantissa, + forVotesMantissa, + userVoteSupport, + } = [...gqlProposal.votes] + .sort((a, b) => compareBigNumbers(new BigNumber(a.votes), new BigNumber(b.votes), 'desc')) + .reduce<{ + forVotes: ForVoter[]; + againstVotes: AgainstVoter[]; + abstainVotes: AbstainVoter[]; + totalVotesMantissa: BigNumber; + abstainedVotesMantissa: BigNumber; + againstVotesMantissa: BigNumber; + forVotesMantissa: BigNumber; + userVoteSupport?: VoteSupport; + }>( + (acc, gqlVote) => { + const accCopy = { ...acc }; + + const vote = { + proposalId: gqlProposal.proposalId, + address: gqlVote.voter.id, + reason: gqlVote.reason ?? undefined, + support: getUserVoteSupport({ voteSupport: gqlVote.support }), + votesMantissa: new BigNumber(gqlVote.votes), + }; + + accCopy.totalVotesMantissa = accCopy.totalVotesMantissa.plus(vote.votesMantissa); + + if (vote.support === VoteSupport.For) { + accCopy.forVotes.push(vote as ForVoter); + accCopy.forVotesMantissa = accCopy.forVotesMantissa.plus(vote.votesMantissa); + } else if (vote.support === VoteSupport.Against) { + accCopy.againstVotes.push(vote as AgainstVoter); + accCopy.againstVotesMantissa = accCopy.againstVotesMantissa.plus(vote.votesMantissa); + } else { + accCopy.abstainVotes.push(vote as AbstainVoter); + accCopy.abstainedVotesMantissa = accCopy.abstainedVotesMantissa.plus(vote.votesMantissa); + } + + if (!!accountAddress && areAddressesEqual(accountAddress, vote.address)) { + accCopy.userVoteSupport = vote.support; + } + + return accCopy; + }, + { + forVotes: [], + againstVotes: [], + abstainVotes: [], + totalVotesMantissa: new BigNumber(0), + abstainedVotesMantissa: new BigNumber(0), + againstVotesMantissa: new BigNumber(0), + forVotesMantissa: new BigNumber(0), + userVoteSupport: undefined, + }, + ); + + const state = getProposalState({ + startBlockNumber: Number(gqlProposal.startBlock), + endBlockNumber: Number(gqlProposal.endBlock), + currentBlockNumber, + proposalMinQuorumVotesMantissa, + forVotesMantissa, + passing: gqlProposal.passing, + queued: !!gqlProposal.queued?.timestamp, + executed: !!gqlProposal.executed?.timestamp, + canceled: !!gqlProposal.canceled?.timestamp, + executionEtaTimestampMs: Number(gqlProposal.executionEta * 1000), + }); + + // Extract BSC proposal actions + const proposalActions = formatToProposalActions({ + callDatas: gqlProposal.calldatas || [], + signatures: gqlProposal.signatures || [], + targets: gqlProposal.targets || [], + values: gqlProposal.values || [], + }); + + const cancelDate = gqlProposal.canceled?.timestamp + ? convertToDate({ + timestampSeconds: Number(gqlProposal.canceled.timestamp), + }) + : undefined; + + const queuedDate = gqlProposal.queued?.timestamp + ? convertToDate({ + timestampSeconds: Number(gqlProposal.queued.timestamp), + }) + : undefined; + + const executedDate = gqlProposal.executed?.timestamp + ? convertToDate({ + timestampSeconds: Number(gqlProposal.executed.timestamp), + }) + : undefined; + + const expiredDate = + state === ProposalState.Expired && executionEtaDate + ? new Date(executionEtaDate.getTime() + PROPOSAL_EXECUTION_GRACE_PERIOD_MS) + : undefined; + + const remoteProposals = gqlProposal.remoteProposals.reduce( + ( + acc, + { proposalId, trustedRemote, stateTransactions, calldatas, signatures, targets, values }, + ) => { + const gqlRemoteProposal = gqlRemoteProposalsMapping[proposalId]; + + const remoteProposal = formatToRemoteProposal({ + proposalState: state, + proposalCanceledDate: cancelDate, + proposalExpiredDate: expiredDate, + proposalEndDate: endDate, + proposalId: Number(gqlProposal.proposalId), + layerZeroChainId: trustedRemote.layerZeroChainId, + gqlRemoteProposal, + failedTimestampSeconds: stateTransactions?.stored?.timestamp + ? Number(stateTransactions.stored.timestamp) + : undefined, + bridgedTimestampSeconds: stateTransactions?.executed?.timestamp + ? Number(stateTransactions.executed.timestamp) + : undefined, + withdrawnTimestampSeconds: stateTransactions?.withdrawn?.timestamp + ? Number(stateTransactions.withdrawn.timestamp) + : undefined, + withdrawnTxHash: stateTransactions?.withdrawn?.txHash, + callDatas: calldatas ?? [], + signatures: signatures ?? [], + targets: targets ?? [], + values: values ?? [], + }); + + return [...acc, remoteProposal]; + }, + [], + ); + + const result: Proposal = { + proposalId: Number(gqlProposal.proposalId), + proposalType: getProposalType({ type: gqlProposal.type }), + proposerAddress: gqlProposal.proposer.id, + state, + description: formatToProposalDescription({ + description: gqlProposal.description, + }), + endBlock: +gqlProposal.endBlock, + createdDate: gqlProposal.created?.timestamp + ? convertToDate({ + timestampSeconds: Number(gqlProposal.created.timestamp), + }) + : undefined, + cancelDate, + queuedDate, + executedDate, + expiredDate, + proposalActions, + forVotes, + againstVotes, + abstainVotes, + abstainedVotesMantissa, + againstVotesMantissa, + forVotesMantissa, + totalVotesMantissa, + userVoteSupport, + createdTxHash: gqlProposal.created?.txHash, + cancelTxHash: gqlProposal.canceled?.txHash, + executedTxHash: gqlProposal.executed?.txHash, + queuedTxHash: gqlProposal.queued?.txHash, + startDate, + endDate, + executionEtaDate, + remoteProposals, + }; + + return result; +}; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/__tests__/__snapshots__/index.spec.ts.snap b/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/__tests__/__snapshots__/index.spec.ts.snap deleted file mode 100644 index 5f68e80f21..0000000000 --- a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/__tests__/__snapshots__/index.spec.ts.snap +++ /dev/null @@ -1,32 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`formatToProposalPreview > returns proposal preview in the correct format 1`] = ` -{ - "abstainedVotesMantissa": "1.05462e+23", - "againstVotesMantissa": "2.05462e+23", - "cancelDate": undefined, - "description": { - "abstainDescription": "I am indifferent to whether Venus Protocol proceeds or not", - "againstDescription": "I do not think that Venus Protocol should proceed with this proposal", - "description": " - This VIP does the following: - 1. Updates the implementation of all VTokens and Comptroller market facet in Core Pool - 2. Updates the implementation of VTokens and Comptrollers in IL - 3. Accepts the ownership of the NativeTokenGateway contract - 4. Gives call permissions to Timelocks for seizeVenus function - 5. Sets XVS and vXVS address in unitroller", - "forDescription": "I agree that Venus Protocol should proceed with this proposal", - "title": "VIP-Gateway Update VToken and comptroller implementation in IL and Core Pool and introduces the NativeTokenGateway contract", - "version": "v2", - }, - "endDate": 2024-03-14T07:34:11.000Z, - "etaDate": 2024-03-14T07:34:08.000Z, - "executedDate": 2024-03-14T07:38:32.000Z, - "forVotesMantissa": "6.05462e+23", - "proposalId": 387, - "proposalType": 0, - "queuedDate": 2024-03-14T07:24:08.000Z, - "state": 1, - "userVoteSupport": 1, -} -`; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/__tests__/index.spec.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/__tests__/index.spec.ts deleted file mode 100644 index 197800e5da..0000000000 --- a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/__tests__/index.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import proposalPreviewsResponse from '__mocks__/subgraph/proposalPreviews.json'; -import BigNumber from 'bignumber.js'; -import type { ProposalPreviewsQuery } from 'clients/subgraph'; -import { formatToProposalPreview } from '..'; - -describe('formatToProposalPreview', () => { - beforeEach(() => { - vi.useFakeTimers().setSystemTime(new Date(1710401645000)); - }); - - it('returns proposal preview in the correct format', async () => { - const res = formatToProposalPreview({ - gqlProposal: proposalPreviewsResponse - .proposals[0] as ProposalPreviewsQuery['proposals'][number], - currentBlockNumber: 38563073, - proposalMinQuorumVotesMantissa: new BigNumber('600000000000000000000000'), - blockTimeMs: 3000, - }); - - expect(res).toMatchSnapshot(); - }); -}); diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/index.ts b/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/index.ts deleted file mode 100644 index 7039c61fcd..0000000000 --- a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/index.ts +++ /dev/null @@ -1,64 +0,0 @@ -import BigNumber from 'bignumber.js'; -import type { ProposalPreviewsQuery } from 'clients/subgraph'; -import type { ProposalPreview } from 'types'; -import { convertToDate, formatToProposalDescription } from 'utilities'; -import { getProposalState } from './getProposalState'; -import { getProposalType } from './getProposalType'; -import { getUserVoteSupport } from './getUserVoteSupport'; - -export const formatToProposalPreview = ({ - gqlProposal, - currentBlockNumber, - proposalMinQuorumVotesMantissa, - proposalExecutionGracePeriodMs, - blockTimeMs, -}: { - gqlProposal: ProposalPreviewsQuery['proposals'][number]; - currentBlockNumber: number; - proposalMinQuorumVotesMantissa: BigNumber; - blockTimeMs: number; - proposalExecutionGracePeriodMs?: number; -}) => { - const nowMs = new Date().getTime(); - const endDate = new Date(nowMs + (gqlProposal.endBlock - currentBlockNumber) * blockTimeMs); - const forVotesMantissa = new BigNumber(gqlProposal.forVotes); - - const res: ProposalPreview = { - proposalId: +gqlProposal.id, - description: formatToProposalDescription({ description: gqlProposal.description }), - state: getProposalState({ - startBlockNumber: gqlProposal.startBlock, - endBlockNumber: gqlProposal.endBlock, - proposalMinQuorumVotesMantissa, - proposalExecutionGracePeriodMs, - currentBlockNumber, - passing: gqlProposal.passing, - queued: !!gqlProposal.queued, - executed: !!gqlProposal.executed, - canceled: !!gqlProposal.canceled, - forVotesMantissa, - executionEtaTimestampMs: gqlProposal.executionEta * 1000, - }), - againstVotesMantissa: new BigNumber(gqlProposal.againstVotes), - forVotesMantissa, - abstainedVotesMantissa: new BigNumber(gqlProposal.abstainVotes), - executedDate: gqlProposal.executed - ? convertToDate({ timestampSeconds: gqlProposal.executed.timestamp }) - : undefined, - queuedDate: gqlProposal.queued - ? convertToDate({ timestampSeconds: gqlProposal.queued.timestamp }) - : undefined, - cancelDate: gqlProposal.canceled - ? convertToDate({ timestampSeconds: gqlProposal.canceled.timestamp }) - : undefined, - etaDate: gqlProposal.executionEta - ? convertToDate({ timestampSeconds: gqlProposal.executionEta }) - : undefined, - endDate, - userVoteSupport: - gqlProposal.votes?.[0] && getUserVoteSupport({ voteSupport: gqlProposal.votes[0].support }), - proposalType: getProposalType({ type: gqlProposal.type }), - }; - - return res; -}; diff --git a/apps/evm/src/components/LabeledProgressCircle/index.tsx b/apps/evm/src/components/LabeledProgressCircle/index.tsx new file mode 100644 index 0000000000..c63db4b7fa --- /dev/null +++ b/apps/evm/src/components/LabeledProgressCircle/index.tsx @@ -0,0 +1,30 @@ +import { cn } from 'utilities'; +import { ProgressCircle } from '../ProgressCircle'; + +export interface LabeledProgressCircleProps extends React.HTMLAttributes { + value: number; + total: number; +} + +export const LabeledProgressCircle: React.FC = ({ + className, + value, + total, + ...otherProps +}) => ( +
+ + +

+ {value}/{total} +

+
+); diff --git a/apps/evm/src/components/MarkdownViewer/index.tsx b/apps/evm/src/components/MarkdownViewer/index.tsx index d8656e7ccf..0eef267640 100644 --- a/apps/evm/src/components/MarkdownViewer/index.tsx +++ b/apps/evm/src/components/MarkdownViewer/index.tsx @@ -16,33 +16,33 @@ export const MarkdownViewer: React.FC = ({ className, conte allowedElements={['h1', 'h2', 'h3', 'h4', 'p', 'a', 'ul', 'li', 'ol', 'strong', 'em']} skipHtml components={{ - h1: ({ children, ...otherProps }) => ( + h1: ({ children, node, ...otherProps }) => (

{children}

), - h2: ({ children, ...otherProps }) => ( + h2: ({ children, node, ...otherProps }) => (

{children}

), - h4: ({ children, ...otherProps }) => ( + h4: ({ children, node, ...otherProps }) => (

{children}

), - p: ({ children, ...otherProps }) => ( + p: ({ children, node, ...otherProps }) => (

{children}

), - a: ({ children, ...otherProps }) => {children}, - ul: ({ children, ...otherProps }) => ( + a: ({ children, node, ...otherProps }) => {children}, + ul: ({ children, node, ...otherProps }) => (
    {children}
), - ol: ({ children, ...otherProps }) => ( + ol: ({ children, node, ...otherProps }) => (
    {children}
diff --git a/apps/evm/src/components/ProgressCircle/index.tsx b/apps/evm/src/components/ProgressCircle/index.tsx index b08e4b796f..0d603b3931 100644 --- a/apps/evm/src/components/ProgressCircle/index.tsx +++ b/apps/evm/src/components/ProgressCircle/index.tsx @@ -23,7 +23,7 @@ export const ProgressCircle: React.FC = ({ const theme = useTheme(); const { circumference, offset } = useMemo(() => { - const radius = sizePx / 2; + const radius = sizePx / 2 - strokeWidthPx / 2; const tmpCircumference = 2 * Math.PI * radius; const tmpOffset = tmpCircumference * ((100 - value) / 100); @@ -31,7 +31,7 @@ export const ProgressCircle: React.FC = ({ circumference: tmpCircumference, offset: tmpOffset, }; - }, [value, sizePx]); + }, [value, sizePx, strokeWidthPx]); return ( = { [ChainId.OPTIMISM_SEPOLIA]: 10232, }; +export const CHAIN_IDS_ON_LAYER_ZERO = Object.entries(LAYER_ZERO_CHAIN_IDS).reduce< + Record +>( + (acc, [chainId, layerZeroChainId]) => ({ + ...acc, + [layerZeroChainId]: Number(chainId) as ChainId, + }), + {}, +); + export const DEFAULT_ADAPTER_PARAMS = '0x000100000000000000000000000000000000000000000000000000000000000493E0'; diff --git a/apps/evm/src/containers/ChainExplorerLink/index.tsx b/apps/evm/src/containers/ChainExplorerLink/index.tsx index 20dbd3de78..c3cad555fc 100644 --- a/apps/evm/src/containers/ChainExplorerLink/index.tsx +++ b/apps/evm/src/containers/ChainExplorerLink/index.tsx @@ -5,7 +5,7 @@ import { Icon } from 'components/Icon'; import { Link } from 'containers/Link'; import { useTranslation } from 'libs/translations'; import type { ChainId } from 'types'; -import { type UrlType, cn, generateChainExplorerUrl } from 'utilities'; +import { type UrlType, cn, generateExplorerUrl } from 'utilities'; export interface ChainExplorerLinkProps { hash: string; @@ -27,7 +27,7 @@ export const ChainExplorerLink: React.FC = ({ const { t } = useTranslation(); const url = useMemo( - () => generateChainExplorerUrl({ hash, urlType, chainId }), + () => generateExplorerUrl({ hash, urlType, chainId }), [hash, urlType, chainId], ); diff --git a/apps/evm/src/containers/ConnectWallet/Container/index.tsx b/apps/evm/src/containers/ConnectWallet/Container/index.tsx new file mode 100644 index 0000000000..4450394e49 --- /dev/null +++ b/apps/evm/src/containers/ConnectWallet/Container/index.tsx @@ -0,0 +1,7 @@ +import { cn } from 'utilities'; + +export interface ContainerProps extends React.HTMLAttributes {} + +export const Container: React.FC = ({ className, ...otherProps }) => ( +
+); diff --git a/apps/evm/src/containers/ConnectWallet/__tests__/index.spec.tsx b/apps/evm/src/containers/ConnectWallet/__tests__/index.spec.tsx new file mode 100644 index 0000000000..f046fdee6e --- /dev/null +++ b/apps/evm/src/containers/ConnectWallet/__tests__/index.spec.tsx @@ -0,0 +1,91 @@ +import { fireEvent, waitFor } from '@testing-library/react'; +import type Vi from 'vitest'; + +import fakeAccountAddress from '__mocks__/models/address'; +import { en } from 'libs/translations'; +import { useAuthModal, useSwitchChain } from 'libs/wallet'; +import { renderComponent } from 'testUtils/render'; +import { ChainId } from 'types'; +import { ConnectWallet } from '..'; + +describe('ConnectWallet', () => { + beforeEach(() => { + (useAuthModal as Vi.Mock).mockReturnValue({ openAuthModal: vi.fn() }); + (useSwitchChain as Vi.Mock).mockReturnValue({ switchChain: vi.fn() }); + }); + + it('renders without crashing', () => { + renderComponent(); + }); + + it('displays authentication button when user is not connected', async () => { + const { getByText } = renderComponent(); + const connectButton = getByText(en.connectWallet.connectButton); + expect(connectButton).toBeInTheDocument(); + }); + + it('calls openAuthModal when connect button is clicked', async () => { + const mockOpenAuthModal = vi.fn(); + (useAuthModal as Vi.Mock).mockReturnValue({ openAuthModal: mockOpenAuthModal }); + + const { getByText } = renderComponent(); + const connectButton = getByText(en.connectWallet.connectButton); + + fireEvent.click(connectButton); + + await waitFor(() => { + expect(mockOpenAuthModal).toHaveBeenCalledTimes(1); + }); + }); + + it('displays chain switching button when current chain is different from chainId parameter', async () => { + const { getByText } = renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + const switchChainButton = getByText( + en.connectWallet.switchChain.replace('{{chainName}}', 'opBNB testnet'), + ); + expect(switchChainButton).toBeInTheDocument(); + }); + + it('calls switchChain when switch chain button is clicked', async () => { + const mockSwitchChain = vi.fn(); + (useSwitchChain as Vi.Mock).mockReturnValue({ switchChain: mockSwitchChain }); + + const { getByText } = renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + const switchChainButton = getByText( + en.connectWallet.switchChain.replace('{{chainName}}', 'opBNB testnet'), + ); + + fireEvent.click(switchChainButton); + + await waitFor(() => { + expect(mockSwitchChain).toHaveBeenCalledTimes(1); + expect(mockSwitchChain).toHaveBeenCalledWith({ chainId: ChainId.OPBNB_TESTNET }); + }); + }); + + it('renders children when user is connected and on the correct chain', () => { + const { getByText } = renderComponent( + +
Child Component
+
, + { + accountAddress: fakeAccountAddress, + }, + ); + + expect(getByText('Child Component')).toBeInTheDocument(); + }); + + it('displays the message prop when provided', () => { + const message = 'Custom connect wallet message'; + const { getByText } = renderComponent(); + + expect(getByText(message)).toBeInTheDocument(); + }); +}); diff --git a/apps/evm/src/containers/ConnectWallet/index.tsx b/apps/evm/src/containers/ConnectWallet/index.tsx index fc637dcc9c..c86d02e87d 100644 --- a/apps/evm/src/containers/ConnectWallet/index.tsx +++ b/apps/evm/src/containers/ConnectWallet/index.tsx @@ -1,50 +1,69 @@ -/** @jsxImportSource @emotion/react */ import { useTranslation } from 'libs/translations'; -import { useAccountAddress, useAuthModal } from 'libs/wallet'; +import { useAccountAddress, useAuthModal, useChainId, useSwitchChain } from 'libs/wallet'; +import { CHAIN_METADATA } from 'constants/chainMetadata'; +import { useMemo } from 'react'; +import type { ChainId } from 'types'; import { Button, type Variant } from '../../components/Button'; import { NoticeInfo } from '../../components/Notice'; -import { useStyles } from './styles'; +import { Container } from './Container'; -export interface PromptProps { - openAuthModal: () => void; - connected: boolean; +export interface ConnectWalletProps extends React.HTMLAttributes { + chainId?: ChainId; buttonVariant?: Variant; message?: string; className?: string; children?: React.ReactNode; } -export const Prompt: React.FC = ({ - message, - openAuthModal, - className, +export const ConnectWallet: React.FC = ({ children, - connected, - buttonVariant = 'secondary', + chainId, + message, + buttonVariant, + ...otherProps }) => { - const styles = useStyles(); - const { t } = useTranslation(); + const { accountAddress } = useAccountAddress(); + const isUserConnected = !!accountAddress; - return ( -
- {connected ? ( - children - ) : ( - <> - {!!message && } - - - - )} -
+ const { chainId: currentChainId } = useChainId(); + + const isOnWrongChain = useMemo( + () => chainId && currentChainId !== chainId, + [currentChainId, chainId], ); -}; -export const ConnectWallet: React.FC> = props => { - const { accountAddress } = useAccountAddress(); + const chainMetadata = chainId && CHAIN_METADATA[chainId]; + const { openAuthModal } = useAuthModal(); - return ; + const { switchChain } = useSwitchChain(); + const handleSwitchChain = () => chainId && switchChain({ chainId }); + + const { t } = useTranslation(); + + if (!isUserConnected) { + return ( + + {!!message && } + + + + ); + } + + if (isOnWrongChain) { + return ( + + + + ); + } + + return {children}; }; diff --git a/apps/evm/src/containers/ConnectWallet/styles.ts b/apps/evm/src/containers/ConnectWallet/styles.ts deleted file mode 100644 index 81d362e23b..0000000000 --- a/apps/evm/src/containers/ConnectWallet/styles.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { css } from '@emotion/react'; -import { useTheme } from '@mui/material'; - -export const useStyles = () => { - const theme = useTheme(); - - return { - container: css` - width: 100%; - `, - notice: css` - margin-bottom: ${theme.spacing(8)}; - `, - }; -}; diff --git a/apps/evm/src/containers/Layout/Footer/index.tsx b/apps/evm/src/containers/Layout/Footer/index.tsx index a50d847438..a7f00c3ee1 100644 --- a/apps/evm/src/containers/Layout/Footer/index.tsx +++ b/apps/evm/src/containers/Layout/Footer/index.tsx @@ -1,7 +1,7 @@ import { useGetToken } from 'libs/tokens'; import { useTranslation } from 'libs/translations'; import { useChainId } from 'libs/wallet'; -import { generateChainExplorerUrl } from 'utilities'; +import { generateExplorerUrl } from 'utilities'; import { Link } from 'containers/Link'; import { IconLink } from './IconLink'; @@ -33,7 +33,7 @@ export const Footer: React.FC = () => { { flex-direction: column; align-items: center; justify-content: center; + ${theme.breakpoints.down('sm')} { flex-direction: row; border-left: none; border-top: 1px solid ${theme.palette.secondary.light}; - padding-top: ${theme.spacing(10)}; - padding-bottom: ${theme.spacing(10)}; + padding: ${theme.spacing(6)}; } `, }; diff --git a/apps/evm/src/containers/ReadableActionSignature/index.tsx b/apps/evm/src/containers/ReadableActionSignature/index.tsx index 92ef7b7e7d..42afaeae3a 100644 --- a/apps/evm/src/containers/ReadableActionSignature/index.tsx +++ b/apps/evm/src/containers/ReadableActionSignature/index.tsx @@ -1,23 +1,23 @@ import { useGetVTokens } from 'clients/api'; import { useGetTokens } from 'libs/tokens'; -import { useChainId } from 'libs/wallet'; import type { FormValues } from 'pages/Governance/ProposalList/CreateProposalModal/proposalSchema'; -import type { ProposalAction } from 'types'; -import { cn, generateChainExplorerUrl } from 'utilities'; +import type { ChainId, ProposalAction } from 'types'; +import { cn, generateExplorerUrl } from 'utilities'; import formatSignature from './formatSignature'; import getContractName from './getContractName'; export interface ReadableActionSignatureProps extends React.HTMLAttributes { action: FormValues['actions'][number] | ProposalAction; + chainId: ChainId; } export const ReadableActionSignature: React.FC = ({ className, action, + chainId, ...otherProps }) => { - const { chainId } = useChainId(); const { data: getVTokensData } = useGetVTokens(); const tokens = useGetTokens(); const vTokens = getVTokensData?.vTokens || []; @@ -32,7 +32,7 @@ export const ReadableActionSignature: React.FC = ( return (
{ - beforeEach(() => { - (useChainId as Vi.Mock).mockImplementation(() => ({ - chainId: ChainId.BSC_TESTNET, - })); - }); - it('formats string with existing query', () => { const { result } = renderHook(() => useFormatTo()); const formattedTo = result.current.formatTo({ to: '/path?param=value' }); diff --git a/apps/evm/src/hooks/useGetChainMetadata/__tests__/index.spec.tsx b/apps/evm/src/hooks/useGetChainMetadata/__tests__/index.spec.tsx index d4e1aa2a63..320fce73d9 100644 --- a/apps/evm/src/hooks/useGetChainMetadata/__tests__/index.spec.tsx +++ b/apps/evm/src/hooks/useGetChainMetadata/__tests__/index.spec.tsx @@ -1,19 +1,12 @@ -import type Vi from 'vitest'; - import { renderHook } from 'testUtils/render'; import { CHAIN_METADATA } from 'constants/chainMetadata'; -import { useChainId } from 'libs/wallet'; import { ChainId } from 'types'; import { useGetChainMetadata } from '..'; describe('useGetChainMetadata', () => { it('returns the correct chain metadata', () => { - (useChainId as Vi.Mock).mockImplementation(() => ({ - chainId: ChainId.BSC_TESTNET, - })); - const { result } = renderHook(() => useGetChainMetadata()); expect(result.current).toBe(CHAIN_METADATA[ChainId.BSC_TESTNET]); diff --git a/apps/evm/src/hooks/useGetVTreasuryContractAddress/__tests__/index.spec.tsx b/apps/evm/src/hooks/useGetVTreasuryContractAddress/__tests__/index.spec.tsx index 017707cc43..253a9ac5a8 100644 --- a/apps/evm/src/hooks/useGetVTreasuryContractAddress/__tests__/index.spec.tsx +++ b/apps/evm/src/hooks/useGetVTreasuryContractAddress/__tests__/index.spec.tsx @@ -4,7 +4,6 @@ import fakeAddress, { altAddress } from '__mocks__/models/address'; import { getVTreasuryContractAddress, getVTreasuryV8ContractAddress } from 'libs/contracts'; import { renderHook } from 'testUtils/render'; -import { useChainId } from 'libs/wallet'; import { ChainId } from 'types'; import { useGetVTreasuryContractAddress } from '../'; @@ -20,22 +19,16 @@ describe('useGetVTreasuryContractAddress', () => { it.each([ChainId.BSC_TESTNET, ChainId.BSC_MAINNET])( 'calls the right getter function when current chain is BSC', chainId => { - (useChainId as Vi.Mock).mockImplementation(() => ({ - chainId, - })); - - const { result } = renderHook(() => useGetVTreasuryContractAddress()); + const { result } = renderHook(() => useGetVTreasuryContractAddress(), { chainId }); expect(result.current).toEqual(fakeAddress); }, ); it('calls the right getter function when current chain is not BSC', () => { - (useChainId as Vi.Mock).mockImplementation(() => ({ + const { result } = renderHook(() => useGetVTreasuryContractAddress(), { chainId: ChainId.ETHEREUM, - })); - - const { result } = renderHook(() => useGetVTreasuryContractAddress()); + }); expect(result.current).toEqual(altAddress); }); diff --git a/apps/evm/src/hooks/useIsFeatureEnabled/__tests__/index.spec.ts b/apps/evm/src/hooks/useIsFeatureEnabled/__tests__/index.spec.ts index 7cbc2ef2ca..33b8b9e6c7 100644 --- a/apps/evm/src/hooks/useIsFeatureEnabled/__tests__/index.spec.ts +++ b/apps/evm/src/hooks/useIsFeatureEnabled/__tests__/index.spec.ts @@ -1,6 +1,3 @@ -import type Vi from 'vitest'; - -import { useChainId } from 'libs/wallet'; import { renderHook } from 'testUtils/render'; import { ChainId } from 'types'; @@ -15,14 +12,14 @@ describe('useIsFeatureEnabled', () => { Object.values(ChainId) .filter((value): value is ChainId => !Number.isNaN(+value)) .forEach(chainId => { - (useChainId as Vi.Mock).mockImplementation(() => ({ - chainId, - })); - - const { result } = renderHook(() => - useIsFeatureEnabled({ - name: featureName as FeatureFlag, - }), + const { result } = renderHook( + () => + useIsFeatureEnabled({ + name: featureName as FeatureFlag, + }), + { + chainId, + }, ); const expectedResult = enabledChainIds.includes(chainId); diff --git a/apps/evm/src/hooks/useIsFeatureEnabled/index.tsx b/apps/evm/src/hooks/useIsFeatureEnabled/index.tsx index 8360972fdf..72830a7f3d 100644 --- a/apps/evm/src/hooks/useIsFeatureEnabled/index.tsx +++ b/apps/evm/src/hooks/useIsFeatureEnabled/index.tsx @@ -107,12 +107,18 @@ export const featureFlags = { ChainId.OPTIMISM_MAINNET, ChainId.OPTIMISM_SEPOLIA, ], - multichainGovernance: [ + omnichainGovernance: [ ChainId.BSC_TESTNET, + ChainId.BSC_MAINNET, ChainId.SEPOLIA, + ChainId.ETHEREUM, ChainId.OPBNB_TESTNET, + ChainId.OPBNB_MAINNET, ChainId.ARBITRUM_SEPOLIA, + ChainId.ARBITRUM_ONE, ChainId.ZKSYNC_SEPOLIA, + ChainId.ZKSYNC_MAINNET, + ChainId.OPTIMISM_MAINNET, ChainId.OPTIMISM_SEPOLIA, ], gaslessTransactions: [ChainId.ZKSYNC_SEPOLIA, ChainId.ZKSYNC_MAINNET], diff --git a/apps/evm/src/libs/contracts/config/index.ts b/apps/evm/src/libs/contracts/config/index.ts index ebe5e99157..73406e78c2 100644 --- a/apps/evm/src/libs/contracts/config/index.ts +++ b/apps/evm/src/libs/contracts/config/index.ts @@ -1,6 +1,17 @@ +import { abi as OmnichainGovernanceExecutorAbi } from '@venusprotocol/governance-contracts/artifacts/contracts/Cross-chain/OmnichainGovernanceExecutor.sol/OmnichainGovernanceExecutor.json'; import { abi as GovernorBravoDelegateAbi } from '@venusprotocol/governance-contracts/artifacts/contracts/Governance/GovernorBravoDelegate.sol/GovernorBravoDelegate.json'; +import venusGovernanceArbitrumOneDeployments from '@venusprotocol/governance-contracts/deployments/arbitrumone_addresses.json'; +import venusGovernanceArbitrumSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/arbitrumsepolia_addresses.json'; import venusGovernanceBscMainnetDeployments from '@venusprotocol/governance-contracts/deployments/bscmainnet_addresses.json'; import venusGovernanceBscTestnetDeployments from '@venusprotocol/governance-contracts/deployments/bsctestnet_addresses.json'; +import venusGovernanceEthereumDeployments from '@venusprotocol/governance-contracts/deployments/ethereum_addresses.json'; +import venusGovernanceOpBnbMainnetDeployments from '@venusprotocol/governance-contracts/deployments/opbnbmainnet_addresses.json'; +import venusGovernanceOpBnbTestnetDeployments from '@venusprotocol/governance-contracts/deployments/opbnbtestnet_addresses.json'; +import venusGovernanceOptimismMainnetDeployments from '@venusprotocol/governance-contracts/deployments/opmainnet_addresses.json'; +import venusGovernanceOptimismSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/opsepolia_addresses.json'; +import venusGovernanceSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/sepolia_addresses.json'; +import venusGovernanceZkSyncMainnetDeployments from '@venusprotocol/governance-contracts/deployments/zksyncmainnet_addresses.json'; +import venusGovernanceZkSyncSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/zksyncsepolia_addresses.json'; import { abi as IsolatedPoolComptrollerAbi } from '@venusprotocol/isolated-pools/artifacts/contracts/Comptroller.sol/Comptroller.json'; import { abi as NativeTokenGatewayAbi } from '@venusprotocol/isolated-pools/artifacts/contracts/Gateway/NativeTokenGateway.sol/NativeTokenGateway.json'; import { abi as JumpRateModelV2Abi } from '@venusprotocol/isolated-pools/artifacts/contracts/JumpRateModelV2.sol/JumpRateModelV2.json'; @@ -35,7 +46,7 @@ import venusOracleZkSyncMainnetDeployments from '@venusprotocol/oracle/deploymen import venusOracleZkSyncSepoliaDeployments from '@venusprotocol/oracle/deployments/zksyncsepolia_addresses.json'; import { abi as XVSProxyOFTDest } from '@venusprotocol/token-bridge/artifacts/contracts/Bridge/XVSProxyOFTDest.sol/XVSProxyOFTDest.json'; import { abi as XVSProxyOFTSrc } from '@venusprotocol/token-bridge/artifacts/contracts/Bridge/XVSProxyOFTSrc.sol/XVSProxyOFTSrc.json'; -import { abi as XvsTokenMultichainAbi } from '@venusprotocol/token-bridge/artifacts/contracts/Bridge/token/XVS.sol/XVS.json'; +import { abi as XvsTokenOmnichainAbi } from '@venusprotocol/token-bridge/artifacts/contracts/Bridge/token/XVS.sol/XVS.json'; import tokenBridgeArbitrumOneDeployments from '@venusprotocol/token-bridge/deployments/arbitrumone_addresses.json'; import tokenBridgeArbitrumSepoliaDeployments from '@venusprotocol/token-bridge/deployments/arbitrumsepolia_addresses.json'; import tokenBridgeBscMainnetDeployments from '@venusprotocol/token-bridge/deployments/bscmainnet_addresses.json'; @@ -190,8 +201,8 @@ export const contracts: ContractConfig[] = [ }, }, { - name: 'XvsTokenMultichain', - abi: XvsTokenMultichainAbi, + name: 'XvsTokenOmnichain', + abi: XvsTokenOmnichainAbi, address: { [ChainId.ETHEREUM]: tokenBridgeEthereumDeployments.addresses.XVS, [ChainId.SEPOLIA]: tokenBridgeSepoliaDeployments.addresses.XVS, @@ -251,6 +262,30 @@ export const contracts: ContractConfig[] = [ venusGovernanceBscMainnetDeployments.addresses.GovernorBravoDelegator_Proxy, }, }, + { + name: 'OmnichainGovernanceExecutor', + abi: OmnichainGovernanceExecutorAbi, + address: { + [ChainId.ETHEREUM]: venusGovernanceEthereumDeployments.addresses.OmnichainGovernanceExecutor, + [ChainId.SEPOLIA]: venusGovernanceSepoliaDeployments.addresses.OmnichainGovernanceExecutor, + [ChainId.OPBNB_MAINNET]: + venusGovernanceOpBnbMainnetDeployments.addresses.OmnichainGovernanceExecutor, + [ChainId.OPBNB_TESTNET]: + venusGovernanceOpBnbTestnetDeployments.addresses.OmnichainGovernanceExecutor, + [ChainId.ARBITRUM_SEPOLIA]: + venusGovernanceArbitrumSepoliaDeployments.addresses.OmnichainGovernanceExecutor, + [ChainId.ARBITRUM_ONE]: + venusGovernanceArbitrumOneDeployments.addresses.OmnichainGovernanceExecutor, + [ChainId.ZKSYNC_SEPOLIA]: + venusGovernanceZkSyncSepoliaDeployments.addresses.OmnichainGovernanceExecutor, + [ChainId.ZKSYNC_MAINNET]: + venusGovernanceZkSyncMainnetDeployments.addresses.OmnichainGovernanceExecutor, + [ChainId.OPTIMISM_MAINNET]: + venusGovernanceOptimismMainnetDeployments.addresses.OmnichainGovernanceExecutor, + [ChainId.OPTIMISM_SEPOLIA]: + venusGovernanceOptimismSepoliaDeployments.addresses.OmnichainGovernanceExecutor, + }, + }, { name: 'XvsVesting', abi: XvsVestingAbi, diff --git a/apps/evm/src/libs/errors/importProposalErrorPhrases.ts b/apps/evm/src/libs/errors/importProposalErrorPhrases.ts index ce8cc6e1da..219d8be0f3 100644 --- a/apps/evm/src/libs/errors/importProposalErrorPhrases.ts +++ b/apps/evm/src/libs/errors/importProposalErrorPhrases.ts @@ -1,6 +1,7 @@ import { t } from 'libs/translations'; export const importProposalErrorPhrases = { + proposalNotFound: t('errors.proposalNotFound'), noMetaKey: t('errors.noMetaKey'), noSignaturesKey: t('errors.noSignaturesKey'), noTypeKey: t('errors.noTypeKey'), diff --git a/apps/evm/src/libs/translations/translations/en.json b/apps/evm/src/libs/translations/translations/en.json index 65a2b28c77..1dd4f3fbdb 100644 --- a/apps/evm/src/libs/translations/translations/en.json +++ b/apps/evm/src/libs/translations/translations/en.json @@ -227,7 +227,8 @@ "disconnect": "Disconnect" }, "connectWallet": { - "connectButton": "Connect wallet" + "connectButton": "Connect wallet", + "switchChain": "Switch to {{chainName}}" }, "convertVrt": { "connectWalletToWithdrawXvs": "Please connect your wallet to withdraw XVS", @@ -273,6 +274,7 @@ "noSignaturesKey": "There are no call signatures in the file", "noTargetsKey": "File does not contain the list of targets", "noTypeKey": "File does not indicate the proposal's type", + "proposalNotFound": "Proposal not found", "somethingWentWrong": "Something went wrong", "somethingWentWrongRetrievingTransactions": "Something went wrong retrieving transactions", "somethingWentWrongRetrievingVoterAccounts": "Something went wrong retrieving voter accounts", @@ -683,6 +685,7 @@ }, "proposalState": { "active": "Active", + "bridged": "Bridged", "canceled": "Canceled", "created": "Created", "defeated": "Defeated", @@ -1065,7 +1068,7 @@ }, "for": "For", "goToXvsSnapshot": "Go to XVS Snapshot", - "multichain": { + "omnichain": { "switchToBnb": "Switch to BNB chain", "votingOnlyEnabledOnBnb": "Voting is only available on the BNB chain" }, @@ -1109,21 +1112,25 @@ "cancelButtonLabel": "Cancel", "canceledDate": "Canceled: {{ date, dd MMM yyyy h:mm a }}", "command": { - "cta": { + "actionButton": { + "cancel": "Cancel", "execute": "Execute", - "retry": "Retry", - "wrongChain": "Switch to {{chainName}}" + "queue": "Queue" + }, + "cta": { + "execute": "Execute" }, "dates": { - "executableIn": "Executable on {{date, }}", + "activeAt": "Pending until {{date, }}", + "executableAt": "Executable at {{date, }}", "previousStep": "{{date, }}", - "queuedIn": "Queued on {{date, }}" + "queueableAt": "Queueable at {{date, }}" }, "description": { "bridged": "Waiting for the bridge to propagate the transaction", "canceled": "Payload execution cancelled by governance guardian", - "executionFailed": "Payload execution failed. Please try again.", - "pending": "Waiting for the BNB chain payload to be executed", + "pending": "Waiting for the {{chainName}} payload to be executed", + "pendingBsc": "Waiting for voting to start", "waitingToBeExecutable": "Waiting for queueing period to end", "wrongChain": "This payload needs to be executed on the {{chainName}} chain" }, @@ -1131,13 +1138,7 @@ "title": "Operations" }, "status": { - "bridged": "Bridged", - "canceled": "Canceled", - "executed": "Executed", - "expired": "Expired", - "pending": "Pending", - "queued": "Queued", - "succeeded": "Succeeded" + "pending": "Pending" } }, "commands": { @@ -1155,6 +1156,7 @@ "description": "Description", "executeButtonLabel": "Execute", "executedDate": "Executed: {{ date, dd MMM yyyy h:mm a }}", + "expiredDate": "Expired: {{ date, dd MMM yyyy h:mm a }}", "greenPulseAnimation": { "altText": "Green pulse animation" }, @@ -1171,6 +1173,10 @@ }, "queueButtonLabel": "Queue", "queuedUntilDate": "Queued until: {{ date, dd MMM yyyy h:mm a }}", + "status": { + "executedPayloads": "Executed payloads", + "readyForExecution": "Ready for execution" + }, "statusCard": { "ariaLabelAbstain": "votes abstain", "ariaLabelAgainst": "votes against", @@ -1178,7 +1184,8 @@ "dateOnly": "{{date, dd MMM yyyy}}", "timeOnly": "{{date, h:mm a}}" }, - "timeUntilExecutable": "Time until executable", + "timeUntilExecutable": "Executable at: {{ date, dd MMM yyyy h:mm a }}", + "timeUntilVotable": "Voting starts at: {{ date, dd MMM yyyy h:mm a }}", "voteStatus": { "abstained": "Abstained", "notVoted": "Not voted", @@ -1193,8 +1200,7 @@ "delegated": "Delegated", "delegatingTo": "Delegating to", "holding": "Holding", - "readableSent": "{{date, distanceToNow}} ago", - "sent": "Sent", + "proposalNumber": "Proposal #", "transactions": "Transactions", "undelegated": "Undelegated", "venusBalance": "Venus balance", diff --git a/apps/evm/src/libs/wallet/index.ts b/apps/evm/src/libs/wallet/index.ts index de709c1137..85a9ec9c5d 100644 --- a/apps/evm/src/libs/wallet/index.ts +++ b/apps/evm/src/libs/wallet/index.ts @@ -1,3 +1,6 @@ +export { usePublicClient } from 'wagmi'; +export type { PublicClient } from 'viem'; + export * from './constants'; export * from './types'; export * from './chains'; diff --git a/apps/evm/src/pages/Governance/ProposalList/CreateProposalModal/ProposalPreview/index.tsx b/apps/evm/src/pages/Governance/ProposalList/CreateProposalModal/ProposalPreview/index.tsx index a1e316e242..8c5c0bddea 100644 --- a/apps/evm/src/pages/Governance/ProposalList/CreateProposalModal/ProposalPreview/index.tsx +++ b/apps/evm/src/pages/Governance/ProposalList/CreateProposalModal/ProposalPreview/index.tsx @@ -7,6 +7,7 @@ import { ReadableActionSignature } from 'containers/ReadableActionSignature'; import { useTranslation } from 'libs/translations'; import { ProposalType } from 'types'; +import { governanceChain } from 'libs/wallet'; import type { FormValues } from '../proposalSchema'; import { useStyles } from './styles'; @@ -99,6 +100,7 @@ const ProposalPreview: React.FC = () => { ))}
diff --git a/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/Status/Indicator/index.tsx b/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/Status/Indicator/index.tsx new file mode 100644 index 0000000000..b1577b9de3 --- /dev/null +++ b/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/Status/Indicator/index.tsx @@ -0,0 +1,43 @@ +import { Icon, type IconName } from 'components'; +import { useMemo } from 'react'; +import { type Proposal, ProposalState } from 'types'; +import { cn } from 'utilities'; + +export type IndicatorProps = React.HTMLAttributes & Pick; + +export const Indicator: React.FC = ({ state, className, ...otherProps }) => { + const [colorClass, iconName] = useMemo<[string, IconName]>(() => { + let tmpColorClass = 'bg-grey'; + let tmpIconName: IconName = 'dots'; + + if (state === ProposalState.Executed) { + tmpColorClass = 'bg-green'; + tmpIconName = 'mark'; + } else if (state === ProposalState.Succeeded) { + tmpColorClass = 'bg-orange'; + tmpIconName = 'exclamation'; + } else if ( + state === ProposalState.Defeated || + state === ProposalState.Expired || + state === ProposalState.Canceled + ) { + tmpColorClass = 'bg-red'; + tmpIconName = 'close'; + } + + return [tmpColorClass, tmpIconName]; + }, [state]); + + return ( +
+ +
+ ); +}; diff --git a/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/Status/index.tsx b/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/Status/index.tsx new file mode 100644 index 0000000000..8c743e03e7 --- /dev/null +++ b/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/Status/index.tsx @@ -0,0 +1,68 @@ +import { LabeledProgressCircle } from 'components'; +import { useIsFeatureEnabled } from 'hooks/useIsFeatureEnabled'; +import { useTranslation } from 'libs/translations'; +import { useMemo } from 'react'; +import { ProposalState } from 'types'; +import { cn, getProposalStateLabel } from 'utilities'; +import { Indicator } from './Indicator'; + +export interface StatusProps extends React.HTMLAttributes { + state: ProposalState; + totalPayloadsCount: number; + executedPayloadsCount: number; +} + +export const Status: React.FC = ({ + state, + totalPayloadsCount, + executedPayloadsCount, + className, + ...otherProps +}) => { + const { t } = useTranslation(); + const isOmnichainGovernanceFeatureEnabled = useIsFeatureEnabled({ + name: 'omnichainGovernance', + }); + + const isFullyExecuted = executedPayloadsCount === totalPayloadsCount; + const shouldShowExecutedPayloadsStatus = + isOmnichainGovernanceFeatureEnabled && state === ProposalState.Executed && !isFullyExecuted; + + const label = useMemo(() => { + if (shouldShowExecutedPayloadsStatus) { + return t('voteProposalUi.status.executedPayloads'); + } + + if (state === ProposalState.Succeeded) { + return t('voteProposalUi.status.readyForExecution'); + } + + return getProposalStateLabel({ state }); + }, [t, state, shouldShowExecutedPayloadsStatus]); + + return ( +
+
+ {shouldShowExecutedPayloadsStatus ? ( + + ) : ( + + )} +
+ +

+ {label} +

+
+ ); +}; diff --git a/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/index.tsx b/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/index.tsx index d7e4cc16e9..e4a4152bb7 100644 --- a/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/index.tsx +++ b/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/index.tsx @@ -1,17 +1,23 @@ /** @jsxImportSource @emotion/react */ -import type { SerializedStyles } from '@emotion/react'; import Typography from '@mui/material/Typography'; import { useMemo } from 'react'; -import { ActiveVotingProgress, Countdown, Icon, type IconName, ProposalTypeChip } from 'components'; +import { ActiveVotingProgress, Countdown, ProposalTypeChip } from 'components'; import { routes } from 'constants/routing'; -import { useGetToken } from 'libs/tokens'; import { useTranslation } from 'libs/translations'; -import { useAccountAddress } from 'libs/wallet'; -import { type ProposalPreview, ProposalState, ProposalType, type Token, VoteSupport } from 'types'; -import { getProposalStateLabel } from 'utilities/getProposalStateLabel'; +import { + type Proposal, + ProposalState, + ProposalType, + RemoteProposalState, + type Token, + VoteSupport, +} from 'types'; import { ProposalCard } from 'containers/ProposalCard'; +import { useGetToken } from 'libs/tokens'; +import { useAccountAddress } from 'libs/wallet'; +import { Status } from './Status'; import greenPulseAnimation from './greenPulseAnimation.gif'; import { useStyles } from './styles'; import TEST_IDS from './testIds'; @@ -22,94 +28,9 @@ import TEST_IDS from './testIds'; // t('voteProposalUi.executedDate') // t('voteProposalUi.queuedUntilDate') // t('voteProposalUi.defeatedDate') +// t('voteProposalUi.expiredDate') -interface StateCard { - state: ProposalState | undefined; -} - -const StatusCard: React.FC = ({ state }) => { - const styles = useStyles(); - const { t } = useTranslation(); - - const statusContent: Record< - Exclude, - { - iconWrapperCss: SerializedStyles; - iconName: IconName; - iconCss?: SerializedStyles; - label: string; - } - > = useMemo(() => { - const label = state ? getProposalStateLabel({ state }) : t('proposalState.active'); - - return { - [ProposalState.Queued]: { - iconWrapperCss: styles.iconDotsWrapper, - iconName: 'dots', - label, - }, - [ProposalState.Pending]: { - iconWrapperCss: styles.iconDotsWrapper, - iconName: 'dots', - label, - }, - [ProposalState.Executed]: { - iconWrapperCss: styles.iconMarkWrapper, - iconName: 'mark', - iconCss: styles.iconCheck, - label, - }, - [ProposalState.Defeated]: { - iconWrapperCss: styles.iconCloseWrapper, - iconName: 'close', - label, - }, - [ProposalState.Succeeded]: { - iconWrapperCss: styles.iconInfoWrapper, - iconName: 'exclamation', - label, - }, - [ProposalState.Expired]: { - iconWrapperCss: styles.iconCloseWrapper, - iconName: 'close', - label, - }, - [ProposalState.Canceled]: { - iconWrapperCss: styles.iconCloseWrapper, - iconName: 'close', - label, - }, - }; - }, [ - t, - styles.iconCheck, - styles.iconCloseWrapper, - styles.iconDotsWrapper, - styles.iconInfoWrapper, - styles.iconMarkWrapper, - state, - ]); - - if (state !== undefined && state !== ProposalState.Active) { - return ( - <> -
- -
- - {statusContent[state].label} - - - ); - } - - return null; -}; - -interface GovernanceProposalProps extends ProposalPreview { +interface GovernanceProposalProps extends Proposal { className?: string; isUserConnected: boolean; xvs?: Token; @@ -120,9 +41,11 @@ const GovernanceProposalUi: React.FC = ({ proposalId, description, state, + remoteProposals, executedDate, - etaDate, + executionEtaDate, cancelDate, + expiredDate, endDate, userVoteSupport, forVotesMantissa, @@ -157,13 +80,43 @@ const GovernanceProposalUi: React.FC = ({ case ProposalState.Executed: return [executedDate, 'voteProposalUi.executedDate']; case ProposalState.Queued: - return [etaDate, 'voteProposalUi.queuedUntilDate']; + return [executionEtaDate, 'voteProposalUi.queuedUntilDate']; case ProposalState.Defeated: return [endDate, 'voteProposalUi.defeatedDate']; + case ProposalState.Expired: + return [expiredDate, 'voteProposalUi.expiredDate']; default: return [undefined, undefined]; } - }, [state, cancelDate, executedDate, endDate, etaDate]); + }, [state, cancelDate, executedDate, endDate, executionEtaDate, expiredDate]); + + const contentRightItemDom = useMemo(() => { + if (state === ProposalState.Active) { + return ( + + ); + } + + const totalPayloadsCount = 1 + remoteProposals.length; // BSC proposal + remote proposals + const executedPayloadsCount = + (state === ProposalState.Executed ? 1 : 0) + + remoteProposals.filter( + remoteProposal => remoteProposal.state === RemoteProposalState.Executed, + ).length; + + return ( + + ); + }, [state, remoteProposals, forVotesMantissa, againstVotesMantissa, abstainedVotesMantissa, xvs]); return ( = ({ ) : undefined } title={description.title} - contentRightItem={ - state === ProposalState.Active ? ( - - ) : ( - - ) - } + contentRightItem={contentRightItemDom} footer={ statusDate && statusKey ? (
diff --git a/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/styles.ts b/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/styles.ts index eb134d4cb7..a2275c468b 100644 --- a/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/styles.ts +++ b/apps/evm/src/pages/Governance/ProposalList/GovernanceProposal/styles.ts @@ -5,56 +5,6 @@ export const useStyles = () => { const theme = useTheme(); return { - // /* StatusCard styles */ - statusText: css` - color: ${theme.palette.text.primary}; - text-transform: none; - margin-top: ${theme.spacing(2)}; - text-align: center; - ${theme.breakpoints.down('sm')} { - margin-top: 0; - margin-left: ${theme.spacing(3)}; - } - `, - - iconWrapper: css` - border-radius: 50%; - width: ${theme.shape.iconSize.xxLarge}px; - height: ${theme.shape.iconSize.xxLarge}px; - display: flex; - align-items: center; - justify-content: center; - ${theme.breakpoints.down('sm')} { - width: ${theme.shape.iconSize.xLarge}px; - height: ${theme.shape.iconSize.xLarge}px; - } - `, - iconDotsWrapper: css` - background-color: ${theme.palette.text.secondary}; - `, - iconInfoWrapper: css` - background-color: ${theme.palette.interactive.warning}; - `, - iconMarkWrapper: css` - background-color: ${theme.palette.interactive.success}; - `, - iconCloseWrapper: css` - background-color: ${theme.palette.interactive.error}; - `, - icon: css` - width: ${theme.spacing(6)}; - height: ${theme.spacing(6)}; - color: white; - ${theme.breakpoints.down('sm')} { - width: ${theme.spacing(4)}; - height: ${theme.spacing(4)}; - } - `, - iconCheck: css` - background-color: ${theme.palette.interactive.success}; - border-radius: 50%; - stroke-width: ${theme.spacing(0.5)}; - `, timestamp: css` display: flex; justify-content: space-between; diff --git a/apps/evm/src/pages/Governance/ProposalList/index.tsx b/apps/evm/src/pages/Governance/ProposalList/index.tsx index cf29cbf1dd..a7b1cd1455 100644 --- a/apps/evm/src/pages/Governance/ProposalList/index.tsx +++ b/apps/evm/src/pages/Governance/ProposalList/index.tsx @@ -5,8 +5,8 @@ import { useCreateProposal, useGetCurrentVotes, useGetLatestProposalIdByProposer, - useGetProposalPreviews, useGetProposalState, + useGetProposals, } from 'clients/api'; import { ErrorState, @@ -127,13 +127,13 @@ const ProposalList: React.FC = ({ const debouncedSearchValue = useDebounceValue(searchValue); const { - data: { proposalPreviews, total } = { proposalPreviews: [] }, + data: { proposals, total } = { proposals: [] }, error: proposalsError, refetch: refetchProposals, isFetching: isGetProposalsFetching, isRefetching, isPlaceholderData: isGetProposalsPreviousData, - } = useGetProposalPreviews({ + } = useGetProposals({ limit: PROPOSALS_PER_PAGE, accountAddress, page: currentPage, @@ -144,7 +144,7 @@ const ProposalList: React.FC = ({ const isFetchingProposals = (isGetProposalsFetching || isRefetching) && - (isGetProposalsPreviousData || proposalPreviews.length === 0); + (isGetProposalsPreviousData || proposals.length === 0); const { mutateAsync: createProposal, isPending: isCreateProposalLoading } = useCreateProposal(); @@ -178,7 +178,7 @@ const ProposalList: React.FC = ({ latestProposalStateData?.state !== 1; return ( -
+

{t('vote.proposals')}

@@ -247,7 +247,7 @@ const ProposalList: React.FC = ({ )}
- {proposalPreviews.map(proposalPreview => ( + {proposals.map(proposalPreview => ( ))}
diff --git a/apps/evm/src/pages/Governance/VotingWallet/index.tsx b/apps/evm/src/pages/Governance/VotingWallet/index.tsx index 7c23cf9a95..873795432a 100644 --- a/apps/evm/src/pages/Governance/VotingWallet/index.tsx +++ b/apps/evm/src/pages/Governance/VotingWallet/index.tsx @@ -116,14 +116,14 @@ const VotingWallet: React.FC = ({ className }) => { switchChain({ chainId: governanceChain.id })} > - {t('vote.multichain.switchToBnb')} + {t('vote.omnichain.switchToBnb')} } /> diff --git a/apps/evm/src/pages/Governance/__tests__/__snapshots__/index.omnichainGovernance.spec.tsx.snap b/apps/evm/src/pages/Governance/__tests__/__snapshots__/index.omnichainGovernance.spec.tsx.snap new file mode 100644 index 0000000000..47f5e9563d --- /dev/null +++ b/apps/evm/src/pages/Governance/__tests__/__snapshots__/index.omnichainGovernance.spec.tsx.snap @@ -0,0 +1,3 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Governance > displays proposals with unexecuted payloads correctly 1`] = `"Proposals+ Create proposal#98Not votedVIP Comptroller Diamond proxyExecuted: 21 Sep 2023 7:54 AM3/7Executed payloads#97Not votedVIP Comptroller Diamond proxyActive until: 20 Sep 2023 7:54 AMFor605.46K XVSAgainst500K XVSAbstain500K XVS#96Not votedVIP Comptroller Diamond proxyCanceled: 19 Sep 2023 3:46 PMCanceled#95Not votedtestDefeated: 15 Sep 2023 10:23 AMDefeated#94Not voted123Ready for execution#93Not voted123QueuedItems 1 - 10 out of 1001234"`; diff --git a/apps/evm/src/pages/Governance/__tests__/__snapshots__/index.spec.tsx.snap b/apps/evm/src/pages/Governance/__tests__/__snapshots__/index.spec.tsx.snap new file mode 100644 index 0000000000..8c003a968e --- /dev/null +++ b/apps/evm/src/pages/Governance/__tests__/__snapshots__/index.spec.tsx.snap @@ -0,0 +1,3 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Governance > displays proposals correctly 1`] = `"Proposals+ Create proposal#98Not votedVIP Comptroller Diamond proxyExecuted: 21 Sep 2023 7:54 AMExecuted#97Not votedVIP Comptroller Diamond proxyActive until: 20 Sep 2023 7:54 AMFor605.46K XVSAgainst500K XVSAbstain500K XVS#96Not votedVIP Comptroller Diamond proxyCanceled: 19 Sep 2023 3:46 PMCanceled#95Not votedtestDefeated: 15 Sep 2023 10:23 AMDefeated#94Not voted123Ready for execution#93Not voted123QueuedItems 1 - 10 out of 1001234"`; diff --git a/apps/evm/src/pages/Governance/__tests__/indexSearch.spec.tsx b/apps/evm/src/pages/Governance/__tests__/index.governanceSearch.spec.tsx similarity index 91% rename from apps/evm/src/pages/Governance/__tests__/indexSearch.spec.tsx rename to apps/evm/src/pages/Governance/__tests__/index.governanceSearch.spec.tsx index a9ae3ab004..cfda50c380 100644 --- a/apps/evm/src/pages/Governance/__tests__/indexSearch.spec.tsx +++ b/apps/evm/src/pages/Governance/__tests__/index.governanceSearch.spec.tsx @@ -1,7 +1,7 @@ import { fireEvent, waitFor } from '@testing-library/dom'; import type Vi from 'vitest'; -import { useGetProposalPreviews } from 'clients/api'; +import { useGetProposals } from 'clients/api'; import { type UseIsFeatureEnabled, useIsFeatureEnabled } from 'hooks/useIsFeatureEnabled'; import { en } from 'libs/translations'; import { renderComponent } from 'testUtils/render'; @@ -30,7 +30,7 @@ describe('Governance - Feature enabled: governanceSearch', () => { }); await waitFor(() => - expect(useGetProposalPreviews).toHaveBeenCalledWith({ + expect(useGetProposals).toHaveBeenCalledWith({ page: expect.any(Number), limit: expect.any(Number), accountAddress: undefined, @@ -51,7 +51,7 @@ describe('Governance - Feature enabled: governanceSearch', () => { }); await waitFor(() => - expect(useGetProposalPreviews).toHaveBeenCalledWith({ + expect(useGetProposals).toHaveBeenCalledWith({ page: expect.any(Number), limit: expect.any(Number), accountAddress: undefined, diff --git a/apps/evm/src/pages/Governance/__tests__/index.omnichainGovernance.spec.tsx b/apps/evm/src/pages/Governance/__tests__/index.omnichainGovernance.spec.tsx new file mode 100644 index 0000000000..86bad1dcb4 --- /dev/null +++ b/apps/evm/src/pages/Governance/__tests__/index.omnichainGovernance.spec.tsx @@ -0,0 +1,37 @@ +import { screen, waitFor } from '@testing-library/dom'; +import type Vi from 'vitest'; + +import fakeAccountAddress from '__mocks__/models/address'; +import { proposals } from '__mocks__/models/proposals'; +import { type UseIsFeatureEnabled, useIsFeatureEnabled } from 'hooks/useIsFeatureEnabled'; +import { renderComponent } from 'testUtils/render'; +import Governance from '..'; +import GOVERNANCE_PROPOSAL_TEST_IDS from '../ProposalList/GovernanceProposal/testIds'; +import TEST_IDS from '../testIds'; + +describe('Governance', () => { + beforeEach(() => { + (useIsFeatureEnabled as Vi.Mock).mockImplementation( + ({ name }: UseIsFeatureEnabled) => + name === 'voteProposal' || name === 'createProposal' || name === 'omnichainGovernance', + ); + }); + + it('renders without crashing', async () => { + renderComponent(); + }); + + it('displays proposals with unexecuted payloads correctly', async () => { + renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + // Wait for list to be displayed + const firstProposalId = proposals[0].proposalId.toString(); + await waitFor(async () => + screen.getByTestId(GOVERNANCE_PROPOSAL_TEST_IDS.governanceProposal(firstProposalId)), + ); + + expect(screen.getByTestId(TEST_IDS.proposalList).textContent).toMatchSnapshot(); + }); +}); diff --git a/apps/evm/src/pages/Governance/__tests__/index.spec.tsx b/apps/evm/src/pages/Governance/__tests__/index.spec.tsx index d609fa01ed..6a88c1b4f4 100644 --- a/apps/evm/src/pages/Governance/__tests__/index.spec.tsx +++ b/apps/evm/src/pages/Governance/__tests__/index.spec.tsx @@ -1,11 +1,11 @@ -import { fireEvent, waitFor } from '@testing-library/react'; +import { fireEvent, screen, waitFor } from '@testing-library/react'; import BigNumber from 'bignumber.js'; import _cloneDeep from 'lodash/cloneDeep'; import type Vi from 'vitest'; import fakeAccountAddress, { altAddress } from '__mocks__/models/address'; import fakeContractTransaction from '__mocks__/models/contractTransaction'; -import { proposalPreviews } from '__mocks__/models/proposalPreviews'; +import { proposals } from '__mocks__/models/proposals'; import { vaults } from '__mocks__/models/vaults'; import { renderComponent } from 'testUtils/render'; @@ -47,6 +47,20 @@ describe('Governance', () => { renderComponent(); }); + it('displays proposals correctly', async () => { + renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + // Wait for list to be displayed + const firstProposalId = proposals[0].proposalId.toString(); + await waitFor(async () => + screen.getByTestId(GOVERNANCE_PROPOSAL_TEST_IDS.governanceProposal(firstProposalId)), + ); + + expect(screen.getByTestId(TEST_IDS.proposalList).textContent).toMatchSnapshot(); + }); + it('opens create proposal modal when clicking text if user has enough voting weight', async () => { (getProposalState as Vi.Mock).mockImplementation(async () => ({ state: 2 })); const { getByText } = renderComponent(, { @@ -223,7 +237,7 @@ describe('Governance', () => { it('proposals navigate to details', async () => { const { getByTestId } = renderComponent(); - const firstProposalId = proposalPreviews[0].proposalId.toString(); + const firstProposalId = proposals[0].proposalId.toString(); // Getting all because the cards are rendered twice (once for mobile and once for larger screens) const firstProposalAnchor = await waitFor(async () => diff --git a/apps/evm/src/pages/Governance/testIds.ts b/apps/evm/src/pages/Governance/testIds.ts index 3bd35c6d97..97de28d8f3 100644 --- a/apps/evm/src/pages/Governance/testIds.ts +++ b/apps/evm/src/pages/Governance/testIds.ts @@ -1,4 +1,5 @@ export default { createProposal: 'create-proposal', proposalStateSelect: 'proposal-state-select', + proposalList: 'proposal-list', }; diff --git a/apps/evm/src/pages/Proposal/Commands/BscCommand/ActionButton/index.tsx b/apps/evm/src/pages/Proposal/Commands/BscCommand/ActionButton/index.tsx new file mode 100644 index 0000000000..9a16dfa2b4 --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/BscCommand/ActionButton/index.tsx @@ -0,0 +1,122 @@ +import { useCancelProposal, useExecuteProposal, useQueueProposal } from 'clients/api'; +import { Button } from 'components'; +import type { ConnectWalletProps } from 'containers/ConnectWallet'; +import { ConnectWallet } from 'containers/ConnectWallet'; +import { handleError } from 'libs/errors'; +import { useTranslation } from 'libs/translations'; +import { governanceChain, useAccountAddress } from 'libs/wallet'; +import { useMemo } from 'react'; +import { ProposalState } from 'types'; +import { cn } from 'utilities'; +import { useIsProposalCancelableByUser } from '../../useIsProposalCancelableByUser'; +import { useIsProposalExecutable } from '../../useIsProposalExecutable'; + +export interface ActionButtonProps extends Omit { + proposalId: number; + proposerAddress: string; + state: ProposalState; + executionEtaDate?: Date; +} + +export const ActionButton: React.FC = ({ + state, + proposalId, + proposerAddress, + executionEtaDate, + className, + ...otherProps +}) => { + const { t } = useTranslation(); + const { accountAddress } = useAccountAddress(); + + const { isExecutable } = useIsProposalExecutable({ + isQueued: state === ProposalState.Queued, + executionEtaDate, + }); + + const { isCancelable } = useIsProposalCancelableByUser({ + state, + proposerAddress, + accountAddress, + }); + + const isQueueable = state === ProposalState.Succeeded; + + const { mutateAsync: cancelProposal, isPending: isCancelProposalLoading } = useCancelProposal(); + const { mutateAsync: executeProposal, isPending: isExecuteProposalLoading } = + useExecuteProposal(); + const { mutateAsync: queueProposal, isPending: isQueueProposalLoading } = useQueueProposal(); + + const buttonDom = useMemo(() => { + if (isCancelable) { + const cancel = async () => { + try { + await cancelProposal({ proposalId }); + } catch (error) { + handleError({ error }); + } + }; + + return ( + + ); + } + + if (isQueueable) { + const queue = async () => { + try { + await queueProposal({ proposalId }); + } catch (error) { + handleError({ error }); + } + }; + + return ( + + ); + } + + if (isExecutable) { + const execute = async () => { + try { + await executeProposal({ proposalId, chainId: governanceChain.id }); + } catch (error) { + handleError({ error }); + } + }; + + return ( + + ); + } + }, [ + t, + proposalId, + isCancelable, + isQueueable, + isExecutable, + cancelProposal, + queueProposal, + executeProposal, + isCancelProposalLoading, + isExecuteProposalLoading, + isQueueProposalLoading, + ]); + + return ( + + {buttonDom} + + ); +}; diff --git a/apps/evm/src/pages/Proposal/Commands/BscCommand/CurrentStep/index.tsx b/apps/evm/src/pages/Proposal/Commands/BscCommand/CurrentStep/index.tsx new file mode 100644 index 0000000000..0cf6174145 --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/BscCommand/CurrentStep/index.tsx @@ -0,0 +1,139 @@ +import { useMemo } from 'react'; + +import { useTranslation } from 'libs/translations'; +import { governanceChain } from 'libs/wallet'; +import { type Proposal, ProposalState } from 'types'; +import { generateExplorerUrl, getProposalStateLabel } from 'utilities'; +import { Status, type StatusProps } from '../../Status'; + +export interface CurrentStepProps extends React.HTMLAttributes { + proposal: Proposal; +} + +export const CurrentStep: React.FC = ({ proposal, ...otherProps }) => { + const { t } = useTranslation(); + + const [type, status, statusHref] = useMemo< + [StatusProps['type'], string, string | undefined] + >(() => { + let tmpType: StatusProps['type'] = 'info'; + const tmpStatus = getProposalStateLabel({ state: proposal.state }); + let tmpStatusHref: string | undefined; + + if (proposal.state === ProposalState.Canceled && proposal.cancelTxHash) { + tmpStatusHref = generateExplorerUrl({ + hash: proposal.cancelTxHash, + urlType: 'tx', + chainId: governanceChain.id, + }); + } + + if (proposal.state === ProposalState.Queued && proposal.queuedTxHash) { + tmpStatusHref = generateExplorerUrl({ + hash: proposal.queuedTxHash, + urlType: 'tx', + chainId: governanceChain.id, + }); + } + + if (proposal.state === ProposalState.Executed && proposal.executedTxHash) { + tmpStatusHref = generateExplorerUrl({ + hash: proposal.executedTxHash, + urlType: 'tx', + chainId: governanceChain.id, + }); + } + + if ( + proposal.state === ProposalState.Canceled || + proposal.state === ProposalState.Defeated || + proposal.state === ProposalState.Expired + ) { + tmpType = 'error'; + } else if (proposal.state === ProposalState.Executed) { + tmpType = 'success'; + } + + return [tmpType, tmpStatus, tmpStatusHref]; + }, [ + proposal.state, + proposal.cancelTxHash, + proposal.queuedTxHash, + proposal.queuedTxHash, + proposal.executedTxHash, + ]); + + const previousStepDate = useMemo(() => { + if (proposal.state === ProposalState.Pending) { + return proposal.createdDate; + } + + if (proposal.state === ProposalState.Canceled) { + return proposal.cancelDate; + } + + if (proposal.state === ProposalState.Active) { + return proposal.startDate; + } + + if (proposal.state === ProposalState.Defeated) { + return proposal.endDate; + } + + if (proposal.state === ProposalState.Queued) { + return proposal.queuedDate; + } + + if (proposal.state === ProposalState.Executed) { + return proposal.executedDate; + } + + if (proposal.state === ProposalState.Expired) { + return proposal.expiredDate; + } + }, [ + proposal.state, + proposal.createdDate, + proposal.cancelDate, + proposal.startDate, + proposal.endDate, + proposal.queuedDate, + proposal.executedDate, + proposal.expiredDate, + ]); + + const subDescription = useMemo(() => { + if (proposal.state === ProposalState.Pending) { + return t('voteProposalUi.command.dates.activeAt', { + date: proposal.startDate, + }); + } + + if (proposal.state === ProposalState.Active) { + return t('voteProposalUi.command.dates.queueableAt', { + date: proposal.endDate, + }); + } + + if (proposal.state === ProposalState.Queued) { + return t('voteProposalUi.command.dates.executableAt', { + date: proposal.executionEtaDate, + }); + } + }, [t, proposal.state, proposal.startDate, proposal.endDate, proposal.executionEtaDate]); + + return ( + + ); +}; diff --git a/apps/evm/src/pages/Proposal/Commands/BscCommand/index.tsx b/apps/evm/src/pages/Proposal/Commands/BscCommand/index.tsx new file mode 100644 index 0000000000..29371034df --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/BscCommand/index.tsx @@ -0,0 +1,100 @@ +import { CHAIN_METADATA } from 'constants/chainMetadata'; +import { useTranslation } from 'libs/translations'; +import { governanceChain, useChainId } from 'libs/wallet'; +import { useAccountAddress } from 'libs/wallet'; +import { useMemo } from 'react'; +import { type Proposal, ProposalState } from 'types'; +import { Command } from '../Command'; +import { Description } from '../Description'; +import { useIsProposalCancelableByUser } from '../useIsProposalCancelableByUser'; +import { useIsProposalExecutable } from '../useIsProposalExecutable'; +import { ActionButton } from './ActionButton'; +import { CurrentStep } from './CurrentStep'; + +const governanceChainMetadata = CHAIN_METADATA[governanceChain.id]; + +export interface BscCommandProps extends React.HTMLAttributes { + proposal: Proposal; +} + +export const BscCommand: React.FC = ({ proposal, ...otherProps }) => { + const { t } = useTranslation(); + const { chainId: currentChainId } = useChainId(); + const { accountAddress } = useAccountAddress(); + + const isOnWrongChain = currentChainId !== governanceChain.id; + + const { isExecutable } = useIsProposalExecutable({ + isQueued: proposal.state === ProposalState.Queued, + executionEtaDate: proposal.executionEtaDate, + }); + + const { isCancelable } = useIsProposalCancelableByUser({ + state: proposal.state, + proposerAddress: proposal.proposerAddress, + accountAddress, + }); + + const isQueueable = proposal.state === ProposalState.Succeeded; + + const isActionable = isCancelable || isQueueable || isExecutable; + + const description = useMemo(() => { + switch (proposal.state) { + case ProposalState.Pending: + return t('voteProposalUi.command.description.pendingBsc'); + case ProposalState.Canceled: + return t('voteProposalUi.command.description.canceled'); + case ProposalState.Queued: + if (!isExecutable) { + return t('voteProposalUi.command.description.waitingToBeExecutable'); + } + + if (isOnWrongChain) { + return t('voteProposalUi.command.description.wrongChain', { + chainName: governanceChainMetadata.name, + }); + } + break; + } + }, [t, proposal.state, isExecutable, isOnWrongChain]); + + return ( + + {description} + + ) : undefined + } + proposalActions={proposal.proposalActions} + contentRightItem={ + isActionable ? ( + + ) : ( + + ) + } + contentBottomItem={ + isActionable ? ( + + ) : undefined + } + {...otherProps} + /> + ); +}; diff --git a/apps/evm/src/pages/Proposal/Commands/Command/ActionsAccordion/index.tsx b/apps/evm/src/pages/Proposal/Commands/Command/ActionsAccordion/index.tsx new file mode 100644 index 0000000000..54ceb3876f --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/Command/ActionsAccordion/index.tsx @@ -0,0 +1,43 @@ +import { useTranslation } from 'react-i18next'; + +import { AccordionAnimatedContent, type AccordionAnimatedContentProps, Icon } from 'components'; +import { ReadableActionSignature } from 'containers/ReadableActionSignature'; +import type { ChainId, ProposalAction } from 'types'; + +export interface ActionsAccordionProps extends AccordionAnimatedContentProps { + chainId: ChainId; + proposalActions: ProposalAction[]; +} + +export const ActionsAccordion: React.FC = ({ + chainId, + proposalActions, + ...otherProps +}) => { + const { t } = useTranslation(); + + return ( + +
+
+ + +

+ {t('voteProposalUi.command.operations.title')} +

+
+ +
+ {proposalActions.map(action => ( + + ))} +
+
+
+ ); +}; diff --git a/apps/evm/src/pages/Proposal/Commands/Command/Cta/index.tsx b/apps/evm/src/pages/Proposal/Commands/Command/Cta/index.tsx deleted file mode 100644 index 95be70348b..0000000000 --- a/apps/evm/src/pages/Proposal/Commands/Command/Cta/index.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { Button } from 'components'; -import { CHAIN_METADATA } from 'constants/chainMetadata'; -import { useTranslation } from 'libs/translations'; -import { useSwitchChain } from 'libs/wallet'; -import { useMemo } from 'react'; -import type { ProposalCommand } from 'types'; -import { useCommand } from '../useCommand'; - -export type CtaProps = Omit, 'onClick'> & - Pick< - ProposalCommand, - | 'chainId' - | 'state' - | 'failedExecutionAt' - | 'canceledAt' - | 'bridgedAt' - | 'queuedAt' - | 'succeededAt' - | 'executableAt' - | 'executedAt' - | 'expiredAt' - >; - -export const Cta: React.FC = ({ - chainId, - state, - failedExecutionAt, - canceledAt, - bridgedAt, - queuedAt, - executableAt, - executedAt, - expiredAt, - ...otherProps -}) => { - const { t } = useTranslation(); - const chainMetadata = CHAIN_METADATA[chainId]; - - const { isOnWrongChain, hasFailedExecution } = useCommand({ - chainId, - state, - executableAt, - failedExecutionAt, - executedAt, - }); - - const { switchChain } = useSwitchChain(); - - // TODO: wire up (see VEN-2701) - const execute = () => {}; - const retry = () => {}; - - const onClick = (e: React.MouseEvent) => { - e.stopPropagation(); - - if (isOnWrongChain) { - return switchChain({ chainId }); - } - - if (hasFailedExecution) { - return retry(); - } - - return execute(); - }; - - const buttonLabel = useMemo(() => { - if (isOnWrongChain) { - return t('voteProposalUi.command.cta.wrongChain', { - chainName: chainMetadata.name, - }); - } - - if (hasFailedExecution) { - return t('voteProposalUi.command.cta.retry'); - } - - return t('voteProposalUi.command.cta.execute'); - }, [t, isOnWrongChain, hasFailedExecution, chainMetadata.name]); - - return ( - - ); -}; diff --git a/apps/evm/src/pages/Proposal/Commands/Command/StepInfo/index.tsx b/apps/evm/src/pages/Proposal/Commands/Command/StepInfo/index.tsx deleted file mode 100644 index 821625a8e3..0000000000 --- a/apps/evm/src/pages/Proposal/Commands/Command/StepInfo/index.tsx +++ /dev/null @@ -1,157 +0,0 @@ -import { Icon, type IconName } from 'components'; -import { useTranslation } from 'libs/translations'; -import { useMemo } from 'react'; -import { type ProposalCommand, ProposalCommandState } from 'types'; -import { cn } from 'utilities'; - -export type StepInfoProps = React.HTMLAttributes & - Pick< - ProposalCommand, - | 'chainId' - | 'state' - | 'failedExecutionAt' - | 'canceledAt' - | 'bridgedAt' - | 'queuedAt' - | 'succeededAt' - | 'executableAt' - | 'executedAt' - | 'expiredAt' - >; - -export const StepInfo: React.FC = ({ - chainId, - state, - failedExecutionAt, - canceledAt, - bridgedAt, - queuedAt, - executableAt, - executedAt, - expiredAt, - ...otherProps -}) => { - const { t } = useTranslation(); - - const getStatusColor = () => { - if (state === ProposalCommandState.Executed) { - return 'text-green'; - } - - if (state === ProposalCommandState.Canceled || state === ProposalCommandState.Expired) { - return 'text-red'; - } - - return 'text-offWhite'; - }; - - const getIconName = (): IconName => { - if (state === ProposalCommandState.Executed) { - return 'mark'; - } - - if (state === ProposalCommandState.Canceled) { - return 'close'; - } - - return 'dots'; - }; - - const getStatusText = () => { - if (state === ProposalCommandState.Pending) { - return t('voteProposalUi.command.status.pending'); - } - - if (state === ProposalCommandState.Bridged) { - return t('voteProposalUi.command.status.bridged'); - } - - if (state === ProposalCommandState.Canceled) { - return t('voteProposalUi.command.status.canceled'); - } - - if (state === ProposalCommandState.Queued) { - return t('voteProposalUi.command.status.queued'); - } - - if (state === ProposalCommandState.Succeeded) { - return t('voteProposalUi.command.status.succeeded'); - } - - if (state === ProposalCommandState.Executed) { - return t('voteProposalUi.command.status.executed'); - } - - if (state === ProposalCommandState.Expired) { - return t('voteProposalUi.command.status.expired'); - } - }; - - const previousStepDate = useMemo(() => { - if (state === ProposalCommandState.Bridged) { - return bridgedAt; - } - - if (state === ProposalCommandState.Canceled) { - return canceledAt; - } - - if (state === ProposalCommandState.Queued) { - return queuedAt; - } - - if (state === ProposalCommandState.Executed) { - return executedAt; - } - - if (state === ProposalCommandState.Expired) { - return expiredAt; - } - }, [state, bridgedAt, canceledAt, queuedAt, executedAt, expiredAt]); - - const nextStepDate = useMemo(() => { - let tmpNextStepDate: Date | undefined; - - if (state === ProposalCommandState.Bridged) { - tmpNextStepDate = queuedAt; - } - - if (state === ProposalCommandState.Queued) { - tmpNextStepDate = executableAt; - } - - return tmpNextStepDate; - }, [state, executableAt, queuedAt]); - - return ( -
-
- - - {getStatusText()} -
- - {state !== ProposalCommandState.Pending && ( -
- {previousStepDate && ( -

- {t('voteProposalUi.command.dates.previousStep', { date: previousStepDate })} -

- )} - - {(state === ProposalCommandState.Bridged || state === ProposalCommandState.Queued) && ( -

- {state === ProposalCommandState.Bridged - ? t('voteProposalUi.command.dates.queuedIn', { - date: nextStepDate, - }) - : t('voteProposalUi.command.dates.executableIn', { - date: nextStepDate, - })} -

- )} -
- )} -
- ); -}; diff --git a/apps/evm/src/pages/Proposal/Commands/Command/index.tsx b/apps/evm/src/pages/Proposal/Commands/Command/index.tsx index b960e8d968..44922276ec 100644 --- a/apps/evm/src/pages/Proposal/Commands/Command/index.tsx +++ b/apps/evm/src/pages/Proposal/Commands/Command/index.tsx @@ -1,94 +1,31 @@ -import { AccordionAnimatedContent, Icon } from 'components'; +import { useState } from 'react'; + +import { Icon } from 'components'; import { CHAIN_METADATA } from 'constants/chainMetadata'; -import { ReadableActionSignature } from 'containers/ReadableActionSignature'; -import { isAfter } from 'date-fns/isAfter'; -import { useNow } from 'hooks/useNow'; -import { useTranslation } from 'libs/translations'; -import { useMemo, useState } from 'react'; -import { type ProposalCommand, ProposalCommandState } from 'types'; +import type { ChainId, ProposalAction } from 'types'; import { cn } from 'utilities'; import TEST_IDS from '../../testIds'; -import { Cta } from './Cta'; -import { StepInfo } from './StepInfo'; -import { useCommand } from './useCommand'; +import { ActionsAccordion } from './ActionsAccordion'; -export type CommandProps = React.HTMLAttributes & ProposalCommand & {}; +export interface CommandProps extends React.HTMLAttributes { + chainId: ChainId; + proposalActions: ProposalAction[]; + description?: React.ReactElement; + contentRightItem?: React.ReactElement; + contentBottomItem?: React.ReactElement; +} export const Command: React.FC = ({ chainId, - state, - actionSignatures, - bridgedAt, - canceledAt, - queuedAt, - succeededAt, - failedExecutionAt, - executableAt, - executedAt, - expiredAt, + proposalActions, + description, + contentRightItem, + contentBottomItem, ...otherProps }) => { const chainMetadata = CHAIN_METADATA[chainId]; - const { t } = useTranslation(); const [isOpen, setIsOpen] = useState(false); const toggleAccordion = () => setIsOpen(prevState => !prevState); - const now = useNow(); - - const { isOnWrongChain, isExecutable, hasFailedExecution } = useCommand({ - chainId, - state, - executableAt, - failedExecutionAt, - executedAt, - }); - - const description = useMemo(() => { - switch (state) { - case ProposalCommandState.Pending: - return t('voteProposalUi.command.description.pending'); - case ProposalCommandState.Bridged: - return t('voteProposalUi.command.description.bridged'); - case ProposalCommandState.Canceled: - return t('voteProposalUi.command.description.canceled'); - case ProposalCommandState.Queued: - if (!executableAt || isAfter(executableAt, now)) { - return t('voteProposalUi.command.description.waitingToBeExecutable'); - } - - if (isOnWrongChain) { - return t('voteProposalUi.command.description.wrongChain', { - chainName: chainMetadata.name, - }); - } - - if (hasFailedExecution) { - return t('voteProposalUi.command.description.executionFailed'); - } - break; - } - }, [t, state, executableAt, hasFailedExecution, now, chainMetadata, isOnWrongChain]); - - const accordionContentDom = ( -
-
- - -

- {t('voteProposalUi.command.operations.title')} -

-
- -
- {actionSignatures.map(action => ( - - ))} -
-
- ); return (
@@ -112,75 +49,28 @@ export const Command: React.FC = ({
- {!!description && ( -

- {description} -

- )} + {description}
- - {accordionContentDom} - -
- - {isExecutable ? ( - - ) : ( - - )} +
+ + {contentRightItem}
- - {accordionContentDom} - + - {isExecutable && ( - - )} + {contentBottomItem} ); }; diff --git a/apps/evm/src/pages/Proposal/Commands/Command/useCommand.tsx b/apps/evm/src/pages/Proposal/Commands/Command/useCommand.tsx deleted file mode 100644 index 7b8e11d6a8..0000000000 --- a/apps/evm/src/pages/Proposal/Commands/Command/useCommand.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { isBefore } from 'date-fns/isBefore'; -import { useNow } from 'hooks/useNow'; -import { useChainId } from 'libs/wallet'; -import { useMemo } from 'react'; -import { type ProposalCommand, ProposalCommandState } from 'types'; - -export type UseCommandProps = React.HTMLAttributes & - Pick; - -export const useCommand = ({ - chainId, - state, - executableAt, - failedExecutionAt, - executedAt, -}: UseCommandProps) => { - const { chainId: currentChainId } = useChainId(); - const now = useNow(); - - const isExecutable = useMemo( - () => state === ProposalCommandState.Queued && !!(executableAt && isBefore(executableAt, now)), - [executableAt, state, now], - ); - - const hasFailedExecution = useMemo( - () => !executedAt && !!failedExecutionAt, - [failedExecutionAt, executedAt], - ); - - const isOnWrongChain = useMemo(() => currentChainId !== chainId, [currentChainId, chainId]); - - return { - isExecutable, - hasFailedExecution, - isOnWrongChain, - }; -}; diff --git a/apps/evm/src/pages/Proposal/Commands/Description/index.tsx b/apps/evm/src/pages/Proposal/Commands/Description/index.tsx new file mode 100644 index 0000000000..e1dbc7b181 --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/Description/index.tsx @@ -0,0 +1,12 @@ +import { cn } from 'utilities'; + +export interface DescriptionProps extends React.HTMLAttributes { + type?: 'warning' | 'info'; +} + +export const Description: React.FC = ({ type = 'info', ...otherProps }) => ( +

+); diff --git a/apps/evm/src/pages/Proposal/Commands/NonBscCommand/CurrentStep/index.tsx b/apps/evm/src/pages/Proposal/Commands/NonBscCommand/CurrentStep/index.tsx new file mode 100644 index 0000000000..bb9fe0b470 --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/NonBscCommand/CurrentStep/index.tsx @@ -0,0 +1,148 @@ +import { useMemo } from 'react'; + +import { useTranslation } from 'libs/translations'; +import { type RemoteProposal, RemoteProposalState } from 'types'; +import generateExplorerUrl from 'utilities/generateExplorerUrl'; +import { Status, type StatusProps } from '../../Status'; + +export interface CurrentStepProps extends React.HTMLAttributes { + remoteProposal: RemoteProposal; + proposalExecutedTxHash?: string; +} + +export const CurrentStep: React.FC = ({ + proposalExecutedTxHash, + remoteProposal, + ...otherProps +}) => { + const { t } = useTranslation(); + + const [type, status, statusHref] = useMemo< + [StatusProps['type'], string, string | undefined] + >(() => { + let tmpType: StatusProps['type'] = 'info'; + let tmpStatus = t('voteProposalUi.command.status.pending'); + let tmpStatusHref: string | undefined; + + if (remoteProposal.state === RemoteProposalState.Bridged) { + tmpStatus = t('proposalState.bridged'); + tmpStatusHref = + proposalExecutedTxHash && + generateExplorerUrl({ + hash: proposalExecutedTxHash, + urlType: 'layerZeroTx', + chainId: remoteProposal.chainId, + }); + } + + if (remoteProposal.state === RemoteProposalState.Canceled) { + tmpStatus = t('proposalState.canceled'); + tmpType = 'error'; + tmpStatusHref = + remoteProposal.canceledTxHash && + generateExplorerUrl({ + hash: remoteProposal.canceledTxHash, + urlType: 'tx', + chainId: remoteProposal.chainId, + }); + } + + if (remoteProposal.state === RemoteProposalState.Queued) { + tmpStatus = t('proposalState.queued'); + tmpStatusHref = + remoteProposal.queuedTxHash && + generateExplorerUrl({ + hash: remoteProposal.queuedTxHash, + urlType: 'tx', + chainId: remoteProposal.chainId, + }); + } + + if (remoteProposal.state === RemoteProposalState.Executed) { + tmpStatus = t('proposalState.executed'); + tmpType = 'success'; + tmpStatusHref = + remoteProposal.executedTxHash && + generateExplorerUrl({ + hash: remoteProposal.executedTxHash, + urlType: 'tx', + chainId: remoteProposal.chainId, + }); + } + + if (remoteProposal.state === RemoteProposalState.Expired) { + tmpStatus = t('proposalState.expired'); + tmpType = 'error'; + } + + return [tmpType, tmpStatus, tmpStatusHref]; + }, [ + proposalExecutedTxHash, + remoteProposal.state, + remoteProposal.chainId, + remoteProposal.canceledTxHash, + remoteProposal.queuedTxHash, + remoteProposal.executedTxHash, + t, + ]); + + const previousStepDate = useMemo(() => { + if (remoteProposal.state === RemoteProposalState.Bridged) { + return remoteProposal.bridgedDate; + } + + if (remoteProposal.state === RemoteProposalState.Canceled) { + return remoteProposal.canceledDate; + } + + if (remoteProposal.state === RemoteProposalState.Queued) { + return remoteProposal.queuedDate; + } + + if (remoteProposal.state === RemoteProposalState.Executed) { + return remoteProposal.executedDate; + } + + if (remoteProposal.state === RemoteProposalState.Expired) { + return remoteProposal.expiredDate; + } + }, [ + remoteProposal.state, + remoteProposal.bridgedDate, + remoteProposal.canceledDate, + remoteProposal.queuedDate, + remoteProposal.executedDate, + remoteProposal.expiredDate, + ]); + + const nextStepDate = useMemo(() => { + let tmpNextStepDate: Date | undefined; + + if (remoteProposal.state === RemoteProposalState.Queued) { + tmpNextStepDate = remoteProposal.executionEtaDate; + } + + return tmpNextStepDate; + }, [remoteProposal.state, remoteProposal.executionEtaDate]); + + return ( + + ); +}; diff --git a/apps/evm/src/pages/Proposal/Commands/NonBscCommand/index.tsx b/apps/evm/src/pages/Proposal/Commands/NonBscCommand/index.tsx new file mode 100644 index 0000000000..09235f93e2 --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/NonBscCommand/index.tsx @@ -0,0 +1,128 @@ +import { useExecuteProposal } from 'clients/api'; +import { Button } from 'components'; +import { CHAIN_METADATA } from 'constants/chainMetadata'; +import { ConnectWallet } from 'containers/ConnectWallet'; +import { isAfter } from 'date-fns/isAfter'; +import { useNow } from 'hooks/useNow'; +import { VError, handleError } from 'libs/errors'; +import { useTranslation } from 'libs/translations'; +import { governanceChain, useChainId } from 'libs/wallet'; +import { useMemo } from 'react'; +import { type RemoteProposal, RemoteProposalState } from 'types'; +import { Command } from '../Command'; +import { Description } from '../Description'; +import { useIsProposalExecutable } from '../useIsProposalExecutable'; +import { CurrentStep } from './CurrentStep'; + +const governanceChainMetadata = CHAIN_METADATA[governanceChain.id]; + +export interface NonBscCommand extends React.HTMLAttributes { + remoteProposal: RemoteProposal; + proposalExecutedTxHash?: string; +} + +export const NonBscCommand: React.FC = ({ + proposalExecutedTxHash, + remoteProposal, + ...otherProps +}) => { + const { t } = useTranslation(); + const now = useNow(); + const { chainId: currentChainId } = useChainId(); + + const chainMetadata = CHAIN_METADATA[remoteProposal.chainId]; + + const isOnWrongChain = currentChainId !== remoteProposal.chainId; + + const { isExecutable } = useIsProposalExecutable({ + isQueued: remoteProposal.state === RemoteProposalState.Queued, + executionEtaDate: remoteProposal.executionEtaDate, + }); + + const { mutateAsync: executeProposal, isPending: isExecuteProposalLoading } = + useExecuteProposal(); + + const execute = async () => { + if (!remoteProposal.remoteProposalId) { + throw new VError({ type: 'unexpected', code: 'somethingWentWrong' }); + } + + try { + await executeProposal({ + proposalId: remoteProposal.remoteProposalId, + chainId: remoteProposal.chainId, + }); + } catch (error) { + handleError({ error }); + } + }; + + const description = useMemo(() => { + switch (remoteProposal.state) { + case RemoteProposalState.Pending: + return t('voteProposalUi.command.description.pending', { + chainName: governanceChainMetadata.name, + }); + case RemoteProposalState.Bridged: + return t('voteProposalUi.command.description.bridged'); + case RemoteProposalState.Canceled: + return t('voteProposalUi.command.description.canceled'); + case RemoteProposalState.Queued: + if (!remoteProposal.executionEtaDate || isAfter(remoteProposal.executionEtaDate, now)) { + return t('voteProposalUi.command.description.waitingToBeExecutable'); + } + + if (isOnWrongChain) { + return t('voteProposalUi.command.description.wrongChain', { + chainName: chainMetadata.name, + }); + } + break; + } + }, [ + t, + remoteProposal.state, + remoteProposal.executionEtaDate, + now, + chainMetadata, + isOnWrongChain, + ]); + + return ( + + {description} + + ) : undefined + } + proposalActions={remoteProposal.proposalActions} + contentRightItem={ + isExecutable ? ( + + + + ) : ( + + ) + } + contentBottomItem={ + isExecutable ? ( + + + + ) : undefined + } + {...otherProps} + /> + ); +}; diff --git a/apps/evm/src/pages/Proposal/Commands/Progress/index.tsx b/apps/evm/src/pages/Proposal/Commands/Progress/index.tsx index fa30e37b23..7e076b095c 100644 --- a/apps/evm/src/pages/Proposal/Commands/Progress/index.tsx +++ b/apps/evm/src/pages/Proposal/Commands/Progress/index.tsx @@ -1,20 +1,20 @@ -import { Icon, ProgressCircle } from 'components'; +import { Icon, LabeledProgressCircle } from 'components'; import { useTranslation } from 'libs/translations'; import { cn } from 'utilities'; export interface ProgressProps extends React.HTMLAttributes { - successfulPayloadsCount: number; + executedPayloadsCount: number; totalPayloadsCount: number; } export const Progress: React.FC = ({ className, - successfulPayloadsCount, + executedPayloadsCount, totalPayloadsCount, ...otherProps }) => { const { t } = useTranslation(); - const isComplete = successfulPayloadsCount === totalPayloadsCount; + const isComplete = executedPayloadsCount === totalPayloadsCount; return (

@@ -25,20 +25,9 @@ export const Progress: React.FC = ({

{isComplete ? ( - + ) : ( -
- - -

- {successfulPayloadsCount}/{totalPayloadsCount} -

-
+ )}
); diff --git a/apps/evm/src/pages/Proposal/Commands/Status/index.tsx b/apps/evm/src/pages/Proposal/Commands/Status/index.tsx new file mode 100644 index 0000000000..5a5c7aca3a --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/Status/index.tsx @@ -0,0 +1,62 @@ +import { Icon, type IconName } from 'components'; +import { Link } from 'containers/Link'; +import { useMemo } from 'react'; +import { cn } from 'utilities'; + +export interface StatusProps extends React.HTMLAttributes { + type: 'info' | 'success' | 'error'; + status: string; + statusHref?: string; + description?: string; + subDescription?: string; +} + +export const Status: React.FC = ({ + type, + status, + statusHref, + description, + subDescription, + ...otherProps +}) => { + const [colorClass, iconName] = useMemo<[string, IconName]>(() => { + if (type === 'success') { + return ['text-green', 'mark']; + } + + if (type === 'error') { + return ['text-red', 'close']; + } + + return ['text-offWhite', 'dots']; + }, [type]); + + const statusDom = ( +
+ + {status} +
+ ); + + return ( +
+
+ {statusHref ? ( + + {statusDom} + + ) : ( + statusDom + )} +
+ + {(description || subDescription) && ( +
+ {description &&

{description}

} + + {subDescription &&

{subDescription}

} +
+ )} +
+ ); +}; diff --git a/apps/evm/src/pages/Proposal/Commands/__tests__/__snapshots__/index.spec.tsx.snap b/apps/evm/src/pages/Proposal/Commands/__tests__/__snapshots__/index.spec.tsx.snap index a67ac8acbf..545f9c46eb 100644 --- a/apps/evm/src/pages/Proposal/Commands/__tests__/__snapshots__/index.spec.tsx.snap +++ b/apps/evm/src/pages/Proposal/Commands/__tests__/__snapshots__/index.spec.tsx.snap @@ -8,7 +8,7 @@ exports[`Commands > displays the right information for each command 3`] = `"Sepo exports[`Commands > displays the right information for each command 4`] = `"SepoliaThis payload needs to be executed on the Sepolia chainSwitch to SepoliaSwitch to Sepolia"`; -exports[`Commands > displays the right information for each command 5`] = `"opBNB testnetThis payload needs to be executed on the opBNB testnet chainSwitch to opBNB testnetSwitch to opBNB testnet"`; +exports[`Commands > displays the right information for each command 5`] = `"Arbitrum SepoliaPayload execution cancelled by governance guardianCanceled01 Feb 2023 00:00 AM"`; exports[`Commands > displays the right information for each command 6`] = `"Arbitrum SepoliaPayload execution cancelled by governance guardianCanceled01 Feb 2023 12:00 AM"`; diff --git a/apps/evm/src/pages/Proposal/Commands/__tests__/index.spec.tsx b/apps/evm/src/pages/Proposal/Commands/__tests__/index.spec.tsx deleted file mode 100644 index 36e89ff040..0000000000 --- a/apps/evm/src/pages/Proposal/Commands/__tests__/index.spec.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { fireEvent, screen, waitFor } from '@testing-library/react'; -import { commands as fakeCommands } from '__mocks__/models/proposalCommands'; -import { CHAIN_METADATA } from 'constants/chainMetadata'; -import { en } from 'libs/translations'; -import { useSwitchChain } from 'libs/wallet'; -import { renderComponent } from 'testUtils/render'; -import type Vi from 'vitest'; -import { Commands } from '..'; -import TEST_IDS from '../../testIds'; - -describe('Commands', () => { - it('renders without crashing', () => { - renderComponent(); - }); - - it('displays the correct count of executed payloads', () => { - renderComponent(); - - const executedCommandsCount = fakeCommands.filter(command => !!command.executedAt).length; - expect(screen.getByText(`${executedCommandsCount}/${fakeCommands.length}`)).toBeInTheDocument(); - }); - - it('displays the correct number of commands', () => { - renderComponent(); - - expect(screen.getAllByTestId(TEST_IDS.command).length).toBe(fakeCommands.length); - }); - - it('displays the right information for each command', () => { - renderComponent(); - - const commands = screen.getAllByTestId(TEST_IDS.command); - commands.forEach(command => expect(command.textContent).toMatchSnapshot()); - }); - - it('lets user switch chain if command is executable and connected wallet is on the wrong chain and command', async () => { - const switchChainMock = vi.fn(); - (useSwitchChain as Vi.Mock).mockImplementation(() => ({ - switchChain: switchChainMock, - })); - - const executableCommand = fakeCommands[3]; - - renderComponent(); - - // Check warning message is displayed - expect( - screen.getByText( - en.voteProposalUi.command.description.wrongChain.replace( - '{{chainName}}', - CHAIN_METADATA[executableCommand.chainId].name, - ), - ), - ).toBeInTheDocument(); - - // Click on switch chain button - const switchChainButton = screen.getAllByText( - en.voteProposalUi.command.cta.wrongChain.replace( - '{{chainName}}', - CHAIN_METADATA[executableCommand.chainId].name, - ), - )[0]; - - fireEvent.click(switchChainButton); - - await waitFor(() => expect(switchChainMock).toHaveBeenCalledTimes(1)); - expect(switchChainMock).toHaveBeenCalledWith({ chainId: executableCommand.chainId }); - }); - - // TODO: add more tests (see VEN-2701) -}); diff --git a/apps/evm/src/pages/Proposal/Commands/index.tsx b/apps/evm/src/pages/Proposal/Commands/index.tsx index 2911be7462..216488787b 100644 --- a/apps/evm/src/pages/Proposal/Commands/index.tsx +++ b/apps/evm/src/pages/Proposal/Commands/index.tsx @@ -1,37 +1,57 @@ import { Card, type CardProps } from 'components'; import { useTranslation } from 'libs/translations'; -import { type ProposalCommand, ProposalCommandState } from 'types'; -import { Command } from './Command'; +import { useMemo } from 'react'; +import { type Proposal, ProposalState, RemoteProposalState } from 'types'; +import { cn } from 'utilities'; +import TEST_IDS from '../testIds'; +import { BscCommand } from './BscCommand'; +import { NonBscCommand } from './NonBscCommand'; import { Progress } from './Progress'; +const commandClasses = cn('border-b border-b-lightGrey pb-4 last:pb-0 last:border-b-0'); + export interface CommandsProps extends CardProps { - commands: ProposalCommand[]; + proposal: Proposal; } -export const Commands: React.FC = ({ commands, ...otherProps }) => { +export const Commands: React.FC = ({ proposal, ...otherProps }) => { const { t } = useTranslation(); - const successfulPayloadsCount = commands.reduce( - (acc, command) => (command.state === ProposalCommandState.Executed ? acc + 1 : acc), - 0, - ); + const [totalPayloadsCount, executedPayloadsCount] = useMemo(() => { + const totalCount = 1 + proposal.remoteProposals.length; // BSC proposal + Remote proposals + + let count = proposal.remoteProposals.reduce( + (acc, command) => (command.state === RemoteProposalState.Executed ? acc + 1 : acc), + 0, + ); + + if (proposal.state === ProposalState.Executed) { + count += 1; + } + + return [totalCount, count]; + }, [proposal.remoteProposals, proposal.state]); return ( - +

{t('voteProposalUi.commands.title')}

- {commands.map(command => ( - + + {proposal.remoteProposals.map(remoteProposal => ( + ))}
diff --git a/apps/evm/src/pages/Proposal/Commands/useIsProposalCancelableByUser/index.tsx b/apps/evm/src/pages/Proposal/Commands/useIsProposalCancelableByUser/index.tsx new file mode 100644 index 0000000000..30fff083bf --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/useIsProposalCancelableByUser/index.tsx @@ -0,0 +1,40 @@ +import { useGetCurrentVotes, useGetProposalThreshold } from 'clients/api'; +import { ProposalState } from 'types'; +import { areAddressesEqual } from 'utilities'; + +export type UseIsProposalCancelableByUserProps = { + state: ProposalState; + proposerAddress: string; + accountAddress?: string; +}; + +export const useIsProposalCancelableByUser = ({ + state, + proposerAddress, + accountAddress, +}: UseIsProposalCancelableByUserProps) => { + const hasCorrectState = state === ProposalState.Pending || state === ProposalState.Active; + + const { data: proposalThresholdData } = useGetProposalThreshold({ + enabled: hasCorrectState, + }); + const proposalThresholdMantissa = proposalThresholdData?.thresholdMantissa; + + const { data: proposerVotesData } = useGetCurrentVotes( + { accountAddress: proposerAddress }, + { enabled: hasCorrectState }, + ); + const proposalVotesMantissa = proposerVotesData?.votesMantissa; + + const userIsProposer = areAddressesEqual(proposerAddress, accountAddress || ''); + const proposerHasEnoughVotingPower = + !proposalThresholdMantissa || + !proposalVotesMantissa || + proposalVotesMantissa.isGreaterThanOrEqualTo(proposalThresholdMantissa); + + const isCancelable = hasCorrectState && (userIsProposer || !proposerHasEnoughVotingPower); + + return { + isCancelable, + }; +}; diff --git a/apps/evm/src/pages/Proposal/Commands/useIsProposalExecutable/index.tsx b/apps/evm/src/pages/Proposal/Commands/useIsProposalExecutable/index.tsx new file mode 100644 index 0000000000..8ded165bff --- /dev/null +++ b/apps/evm/src/pages/Proposal/Commands/useIsProposalExecutable/index.tsx @@ -0,0 +1,24 @@ +import { isBefore } from 'date-fns/isBefore'; +import { useNow } from 'hooks/useNow'; +import { useMemo } from 'react'; + +export type UseIsProposalExecutableProps = { + executionEtaDate?: Date; + isQueued: boolean; +}; + +export const useIsProposalExecutable = ({ + isQueued, + executionEtaDate, +}: UseIsProposalExecutableProps) => { + const now = useNow(); + + const isExecutable = useMemo( + () => isQueued && !!(executionEtaDate && isBefore(executionEtaDate, now)), + [executionEtaDate, isQueued, now], + ); + + return { + isExecutable, + }; +}; diff --git a/apps/evm/src/pages/Proposal/Description/index.tsx b/apps/evm/src/pages/Proposal/Description/index.tsx index dc675aadd3..32b5faaa45 100644 --- a/apps/evm/src/pages/Proposal/Description/index.tsx +++ b/apps/evm/src/pages/Proposal/Description/index.tsx @@ -5,8 +5,10 @@ import { Card, MarkdownViewer } from 'components'; import { ReadableActionSignature } from 'containers/ReadableActionSignature'; import { useTranslation } from 'libs/translations'; import type { DescriptionV1, DescriptionV2, ProposalAction } from 'types'; +import TEST_IDS from '../testIds'; import { useIsFeatureEnabled } from 'hooks/useIsFeatureEnabled'; +import { governanceChain } from 'libs/wallet'; import { useStyles } from './styles'; interface DescriptionSummary { @@ -18,12 +20,12 @@ interface DescriptionSummary { export const Description: React.FC = ({ className, description, actions }) => { const styles = useStyles(); const { t } = useTranslation(); - const isMultichainGovernanceFeatureEnabled = useIsFeatureEnabled({ - name: 'multichainGovernance', + const isOmnichainGovernanceFeatureEnabled = useIsFeatureEnabled({ + name: 'omnichainGovernance', }); return ( - +
{t('voteProposalUi.description')} @@ -53,7 +55,7 @@ export const Description: React.FC = ({ className, descripti )} - {!isMultichainGovernanceFeatureEnabled && ( + {!isOmnichainGovernanceFeatureEnabled && ( <> {t('voteProposalUi.operation')} @@ -63,6 +65,7 @@ export const Description: React.FC = ({ className, descripti ))} diff --git a/apps/evm/src/pages/Proposal/Description/styles.ts b/apps/evm/src/pages/Proposal/Description/styles.ts index 995e830d7c..bd873415c3 100644 --- a/apps/evm/src/pages/Proposal/Description/styles.ts +++ b/apps/evm/src/pages/Proposal/Description/styles.ts @@ -25,17 +25,6 @@ export const useStyles = () => { background-color: ${theme.palette.background.paper}; font-family: ${theme.typography.fontFamily}; `, - actionTitle: css` - word-break: break-all; - - a { - color: ${theme.palette.interactive.success}; - } - - :hover { - color: ${theme.palette.interactive.success50}; - } - `, section: css` margin-top: ${theme.spacing(6)}; `, diff --git a/apps/evm/src/pages/Proposal/ProposalSummary/Stepper/index.tsx b/apps/evm/src/pages/Proposal/ProposalSummary/Stepper/index.tsx index b908e83a7e..27efffc36a 100644 --- a/apps/evm/src/pages/Proposal/ProposalSummary/Stepper/index.tsx +++ b/apps/evm/src/pages/Proposal/ProposalSummary/Stepper/index.tsx @@ -15,6 +15,7 @@ export interface StepperProps { cancelDate: Date | undefined; queuedDate: Date | undefined; executedDate: Date | undefined; + expiredDate: Date | undefined; endDate: Date | undefined; state: ProposalState; } @@ -45,6 +46,7 @@ const Stepper: React.FC = ({ cancelDate, queuedDate, executedDate, + expiredDate, endDate, state, }) => { @@ -113,7 +115,7 @@ const Stepper: React.FC = ({ state === ProposalState.Expired ? t('proposalState.expired') : t('proposalState.executed'), - getTimestamp: () => (state === ProposalState.Expired ? undefined : executedDate), + getTimestamp: () => (state === ProposalState.Expired ? expiredDate : executedDate), completedIcon: state === ProposalState.Expired ? FailIcon : SuccessIcon, }, ]; @@ -125,6 +127,7 @@ const Stepper: React.FC = ({ executedDate, state, endDate, + expiredDate, t, styles.closeIcon, styles.errorIconContainer, diff --git a/apps/evm/src/pages/Proposal/ProposalSummary/index.tsx b/apps/evm/src/pages/Proposal/ProposalSummary/index.tsx index e13f0bfa4c..b16b601cba 100644 --- a/apps/evm/src/pages/Proposal/ProposalSummary/index.tsx +++ b/apps/evm/src/pages/Proposal/ProposalSummary/index.tsx @@ -63,8 +63,8 @@ export const ProposalSummaryUi: React.FC { @@ -109,7 +110,7 @@ export const ProposalSummaryUi: React.FC ); - transactionHash = createdTxHash; break; case ProposalState.Canceled: - transactionHash = cancelTxHash; + if (!isOmnichainGovernanceFeatureEnabled) { + mainTransactionHash = cancelTxHash; + } break; case ProposalState.Succeeded: updateProposalButton = ( @@ -155,16 +157,28 @@ export const ProposalSummaryUi: React.FC ); } - - transactionHash = queuedTxHash; + if (!isOmnichainGovernanceFeatureEnabled) { + mainTransactionHash = queuedTxHash; + } break; case ProposalState.Executed: - transactionHash = executedTxHash; + if (!isOmnichainGovernanceFeatureEnabled) { + mainTransactionHash = executedTxHash; + } break; // no default } const countdownData = useMemo(() => { + if (state === ProposalState.Pending && startDate) { + return { + date: startDate, + // DO NOT REMOVE COMMENT: needed by i18next to extract translation key + // t('voteProposalUi.timeUntilVotable') + i18nKey: 'voteProposalUi.timeUntilVotable', + }; + } + if (state === ProposalState.Active && endDate) { return { date: endDate, @@ -182,7 +196,7 @@ export const ProposalSummaryUi: React.FC @@ -221,26 +235,29 @@ export const ProposalSummaryUi: React.FC - {transactionHash && ( + {mainTransactionHash && ( )}
- {isVoteProposalFeatureEnabled && updateProposalButton} + {isVoteProposalFeatureEnabled && + !isOmnichainGovernanceFeatureEnabled && + updateProposalButton} - {!isMultichainGovernanceFeatureEnabled && ( + {!isOmnichainGovernanceFeatureEnabled && (
{t('voteProposalUi.proposalHistory')} = ({ className, proposal const { mutateAsync: queueProposal, isPending: isQueueProposalLoading } = useQueueProposal(); const handleCancelProposal = () => cancelProposal({ proposalId }); - const handleExecuteProposal = () => executeProposal({ proposalId }); + const handleExecuteProposal = () => executeProposal({ proposalId, chainId: governanceChain.id }); const handleQueueProposal = () => queueProposal({ proposalId }); const { data: proposalThresholdData } = useGetProposalThreshold(); @@ -275,12 +292,12 @@ const ProposalSummary: React.FC = ({ className, proposal }); const { data: proposerVotesData } = useGetCurrentVotes( - { accountAddress: proposal.proposer }, + { accountAddress: proposal.proposerAddress }, { enabled: !!accountAddress }, ); const canCancelProposal = - areAddressesEqual(proposal.proposer, accountAddress || '') || + areAddressesEqual(proposal.proposerAddress, accountAddress || '') || (proposalThresholdData?.thresholdMantissa && proposerVotesData?.votesMantissa.isLessThan(proposalThresholdData.thresholdMantissa)); diff --git a/apps/evm/src/pages/Proposal/VoteSummary/index.tsx b/apps/evm/src/pages/Proposal/VoteSummary/index.tsx index 6d65a21ab1..328e7f2037 100644 --- a/apps/evm/src/pages/Proposal/VoteSummary/index.tsx +++ b/apps/evm/src/pages/Proposal/VoteSummary/index.tsx @@ -54,7 +54,7 @@ const VoteSummary = ({ return ( -
+
{ } `, labeledProgressBarContainer: css` - margin-bottom: ${theme.spacing(8)}; - ${theme.breakpoints.down('xl')} { flex: 2; - margin-right: ${theme.spacing(8)}; - margin-bottom: 0; - } - - ${theme.breakpoints.down('sm')} { - margin-right: 0; - margin-bottom: ${theme.spacing(8)}; } `, button: css` width: 100%; - margin-bottom: ${theme.spacing(8)}; ${theme.breakpoints.down('xl')} { flex: 1; margin-top: 0; - margin-bottom: 0; + margin-left: ${theme.spacing(8)}; + } + + ${theme.breakpoints.down('sm')} { + margin-left: 0; } `, votesHeader: css` diff --git a/apps/evm/src/pages/Proposal/__tests__/__snapshots__/index. omnichainGovernance.spec.tsx.snap b/apps/evm/src/pages/Proposal/__tests__/__snapshots__/index. omnichainGovernance.spec.tsx.snap new file mode 100644 index 0000000000..047aed8955 --- /dev/null +++ b/apps/evm/src/pages/Proposal/__tests__/__snapshots__/index. omnichainGovernance.spec.tsx.snap @@ -0,0 +1,35 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: +0 1`] = `"CommandsExecuted payloads0/1BNB testnetWaiting for voting to startPending20 Sep 2023 7:39 AMPending until 20 Sep 2023 7:47 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 1 1`] = `"CommandsExecuted payloads0/1BNB testnetActive20 Sep 2023 7:47 AMQueueable at 20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 2 1`] = `"CommandsExecuted payloads0/1BNB testnetPayload execution cancelled by governance guardianCanceled"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 3 1`] = `"CommandsExecuted payloads0/1BNB testnetDefeated20 Sep 2023 7:54 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 4 1`] = `"CommandsExecuted payloads0/1BNB testnetQueueQueue"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 5 1`] = `"CommandsExecuted payloads0/1BNB testnetWaiting for queueing period to endQueued20 Sep 2023 9:54 AMExecutable at 20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 5 2`] = `"CommandsExecuted payloads0/1BNB testnetExecuteExecute"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 6 1`] = `"CommandsExecuted payloads0/1BNB testnetExpired20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 7 1`] = `"CommandsAll payloads executedBNB testnetExecuted20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders description correctly 1`] = `"DescriptionThis vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented."`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: +0 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetWaiting for the BNB testnet payload to be executedPending"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 1 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetWaiting for the bridge to propagate the transactionBridged20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 2 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetWaiting for queueing period to endQueued20 Sep 2023 7:49 AMExecutable at 20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 2 2`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetConnect walletConnect wallet"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 3 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetPayload execution cancelled by governance guardianCanceled20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 4 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetExpired20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 5 1`] = `"CommandsAll payloads executedBNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetExecuted20 Sep 2023 7:49 AM"`; diff --git a/apps/evm/src/pages/Proposal/__tests__/__snapshots__/index.omnichainGovernance.tsx.snap b/apps/evm/src/pages/Proposal/__tests__/__snapshots__/index.omnichainGovernance.tsx.snap new file mode 100644 index 0000000000..047aed8955 --- /dev/null +++ b/apps/evm/src/pages/Proposal/__tests__/__snapshots__/index.omnichainGovernance.tsx.snap @@ -0,0 +1,35 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: +0 1`] = `"CommandsExecuted payloads0/1BNB testnetWaiting for voting to startPending20 Sep 2023 7:39 AMPending until 20 Sep 2023 7:47 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 1 1`] = `"CommandsExecuted payloads0/1BNB testnetActive20 Sep 2023 7:47 AMQueueable at 20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 2 1`] = `"CommandsExecuted payloads0/1BNB testnetPayload execution cancelled by governance guardianCanceled"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 3 1`] = `"CommandsExecuted payloads0/1BNB testnetDefeated20 Sep 2023 7:54 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 4 1`] = `"CommandsExecuted payloads0/1BNB testnetQueueQueue"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 5 1`] = `"CommandsExecuted payloads0/1BNB testnetWaiting for queueing period to endQueued20 Sep 2023 9:54 AMExecutable at 20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 5 2`] = `"CommandsExecuted payloads0/1BNB testnetExecuteExecute"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 6 1`] = `"CommandsExecuted payloads0/1BNB testnetExpired20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders BSC command correctly. Proposal state: 7 1`] = `"CommandsAll payloads executedBNB testnetExecuted20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders description correctly 1`] = `"DescriptionThis vip implement diamond proxy for the comptroller to divide the comptroller logic into facets. The current implementation of the comptroller is exceeding the max limit of the contract size. To resolve this diamond proxy is implemented."`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: +0 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetWaiting for the BNB testnet payload to be executedPending"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 1 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetWaiting for the bridge to propagate the transactionBridged20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 2 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetWaiting for queueing period to endQueued20 Sep 2023 7:49 AMExecutable at 20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 2 2`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetConnect walletConnect wallet"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 3 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetPayload execution cancelled by governance guardianCanceled20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 4 1`] = `"CommandsExecuted payloads1/2BNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetExpired20 Sep 2023 7:49 AM"`; + +exports[`ProposalUi page - Feature enabled: omnichainGovernance > renders remote commands correctly. Remote proposal state: 5 1`] = `"CommandsAll payloads executedBNB testnetExecuted20 Sep 2023 7:49 AMBNB testnetExecuted20 Sep 2023 7:49 AM"`; diff --git a/apps/evm/src/pages/Proposal/__tests__/index. omnichainGovernance.spec.tsx b/apps/evm/src/pages/Proposal/__tests__/index. omnichainGovernance.spec.tsx new file mode 100644 index 0000000000..c5010c15f5 --- /dev/null +++ b/apps/evm/src/pages/Proposal/__tests__/index. omnichainGovernance.spec.tsx @@ -0,0 +1,433 @@ +import { fireEvent, screen, waitFor } from '@testing-library/react'; +import BigNumber from 'bignumber.js'; + +import fakeAccountAddress from '__mocks__/models/address'; +import { proposals } from '__mocks__/models/proposals'; +import { + useCancelProposal, + useExecuteProposal, + useGetCurrentVotes, + useGetProposal, + useGetProposalThreshold, + useQueueProposal, +} from 'clients/api'; +import { type UseIsFeatureEnabled, useIsFeatureEnabled } from 'hooks/useIsFeatureEnabled'; +import { useNow } from 'hooks/useNow'; +import { en } from 'libs/translations'; +import { renderComponent } from 'testUtils/render'; +import { + ChainId, + type Proposal, + ProposalState, + type RemoteProposal, + RemoteProposalState, +} from 'types'; +import type Vi from 'vitest'; +import ProposalUi from '..'; +import TEST_IDS from '../testIds'; + +vi.mock('hooks/useNow'); +vi.mock('hooks/useVote'); +vi.mock('hooks/useIsFeatureEnabled'); + +const proposal = proposals[0]; +const remoteProposal: RemoteProposal = { + proposalId: 1, + remoteProposalId: 1, + chainId: ChainId.BSC_TESTNET, + state: RemoteProposalState.Pending, + proposalActions: [], +}; + +const activeProposal = proposals[1]; +const succeededProposal = proposals[4]; +const queuedProposal = proposals[5]; + +const fakeNow = new Date( + activeProposal.endDate!.setMinutes(activeProposal.endDate!.getMinutes() - 5), +); + +describe('ProposalUi page - Feature enabled: omnichainGovernance', () => { + beforeEach(() => { + vi.useFakeTimers().setSystemTime(fakeNow); + + (useNow as Vi.Mock).mockImplementation(() => fakeNow); + + (useGetProposal as Vi.Mock).mockImplementation(() => ({ + data: { + proposal: activeProposal, + }, + })); + + (useIsFeatureEnabled as Vi.Mock).mockImplementation( + ({ name }: UseIsFeatureEnabled) => name === 'omnichainGovernance', + ); + }); + + it('renders without crashing', async () => { + renderComponent(); + }); + + it.each([ + // Pending + { + ...proposal, + state: ProposalState.Pending, + remoteProposals: [], + }, + // Active + { + ...activeProposal, + remoteProposals: [], + }, + // Canceled + { + ...proposal, + state: ProposalState.Canceled, + remoteProposals: [], + }, + // Defeated + { + ...proposal, + state: ProposalState.Defeated, + remoteProposals: [], + }, + // Succeeded + { + ...proposal, + state: ProposalState.Succeeded, + remoteProposals: [], + }, + // Queued (not yet executable) + { + ...proposal, + state: ProposalState.Queued, + executionEtaDate: new Date(fakeNow.getTime() + 1000), + remoteProposals: [], + }, + // Executable + { + ...proposal, + state: ProposalState.Queued, + executionEtaDate: new Date(fakeNow.getTime() - 1000), + remoteProposals: [], + }, + // Expired + { + ...proposal, + state: ProposalState.Expired, + expiredDate: fakeNow, + remoteProposals: [], + }, + // Executed + { + ...proposal, + state: ProposalState.Executed, + executedDate: fakeNow, + remoteProposals: [], + }, + ])('renders BSC command correctly. Proposal state: $state', async proposal => { + (useGetProposal as Vi.Mock).mockImplementation(() => ({ + data: { + proposal, + }, + })); + + renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + expect(screen.getByTestId(TEST_IDS.commands).textContent).toMatchSnapshot(); + }); + + it.each([ + // Pending + remoteProposal, + // Bridged + { + ...remoteProposal, + state: RemoteProposalState.Bridged, + bridgedDate: fakeNow, + }, + + // Queued (not yet executable) + { + ...remoteProposal, + state: RemoteProposalState.Queued, + queuedDate: fakeNow, + executionEtaDate: new Date(fakeNow.getTime() + 1000), + }, + // Executable + { + ...remoteProposal, + state: RemoteProposalState.Queued, + queuedDate: fakeNow, + executionEtaDate: new Date(fakeNow.getTime() - 1000), + }, + // Canceled + { + ...remoteProposal, + state: RemoteProposalState.Canceled, + canceledDate: fakeNow, + }, + // Expired + { + ...remoteProposal, + state: RemoteProposalState.Expired, + expiredDate: fakeNow, + }, + // Executed + { + ...remoteProposal, + state: RemoteProposalState.Executed, + executedDate: fakeNow, + }, + ])('renders remote commands correctly. Remote proposal state: $state', async remoteProposal => { + const customProposal: Proposal = { + ...proposal, + state: ProposalState.Executed, + executedDate: fakeNow, + remoteProposals: [remoteProposal], + }; + + (useGetProposal as Vi.Mock).mockImplementation(() => ({ + data: { + proposal: customProposal, + }, + })); + + renderComponent(); + + expect(screen.getByTestId(TEST_IDS.commands).textContent).toMatchSnapshot(); + }); + + it('lets user cancel their own BSC proposal', async () => { + const cancelMock = vi.fn(); + (useCancelProposal as Vi.Mock).mockImplementation(() => ({ + mutateAsync: cancelMock, + })); + + renderComponent(, { + accountAddress: activeProposal.proposerAddress, + }); + + const cancelButton = screen + .getAllByText(en.voteProposalUi.command.actionButton.cancel)[0] + .closest('button'); + expect(cancelButton).toBeInTheDocument(); + + fireEvent.click(cancelButton!); + + await waitFor(() => expect(cancelMock).toHaveBeenCalledTimes(1)); + expect(cancelMock).toHaveBeenCalledWith({ + proposalId: activeProposal.proposalId, + }); + }); + + it('lets user cancel the BSC proposal if the proposer no longer has enough voting power', async () => { + const FAKE_THRESHOLD_MANTISSA = 100; + + (useGetProposalThreshold as Vi.Mock).mockImplementation(() => ({ + data: { + thresholdMantissa: new BigNumber(FAKE_THRESHOLD_MANTISSA), + }, + })); + + (useGetCurrentVotes as Vi.Mock).mockImplementation(() => ({ + data: { + votesMantissa: new BigNumber(FAKE_THRESHOLD_MANTISSA - 1), + }, + })); + + const cancelMock = vi.fn(); + (useCancelProposal as Vi.Mock).mockImplementation(() => ({ + mutateAsync: cancelMock, + })); + + renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + const cancelButton = screen + .getAllByText(en.voteProposalUi.command.actionButton.cancel)[0] + .closest('button'); + expect(cancelButton).toBeInTheDocument(); + + fireEvent.click(cancelButton!); + + await waitFor(() => expect(cancelMock).toHaveBeenCalledTimes(1)); + expect(cancelMock).toHaveBeenCalledWith({ + proposalId: activeProposal.proposalId, + }); + }); + + it('does not let user cancel if the BSC proposal if voting power of the proposer is greater than or equals threshold', async () => { + const cancelMock = vi.fn(); + (useCancelProposal as Vi.Mock).mockImplementation(() => ({ + mutateAsync: cancelMock, + })); + + renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + expect( + screen.queryByText(en.voteProposalUi.command.actionButton.cancel), + ).not.toBeInTheDocument(); + }); + + it('does not let user cancel the BSC proposal if it has passed the succeeded state', async () => { + (useGetProposal as Vi.Mock).mockImplementation(() => ({ + data: { + proposal: succeededProposal, + }, + })); + + const cancelMock = vi.fn(); + (useCancelProposal as Vi.Mock).mockImplementation(() => ({ + mutateAsync: cancelMock, + })); + + renderComponent(, { + accountAddress: activeProposal.proposerAddress, + }); + + expect( + screen.queryByText(en.voteProposalUi.command.actionButton.cancel), + ).not.toBeInTheDocument(); + }); + + it('lets user queue the BSC proposal', async () => { + (useGetProposal as Vi.Mock).mockImplementation(() => ({ + data: { + proposal: succeededProposal, + }, + })); + + const queueMock = vi.fn(); + (useQueueProposal as Vi.Mock).mockImplementation(() => ({ + mutateAsync: queueMock, + })); + + renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + const queueButton = screen + .getAllByText(en.voteProposalUi.command.actionButton.queue)[0] + .closest('button'); + expect(queueButton).toBeInTheDocument(); + + fireEvent.click(queueButton!); + + await waitFor(() => expect(queueMock).toHaveBeenCalledTimes(1)); + }); + + it('lets user queue the BSC proposal', async () => { + (useGetProposal as Vi.Mock).mockImplementation(() => ({ + data: { + proposal: succeededProposal, + }, + })); + + const queueMock = vi.fn(); + (useQueueProposal as Vi.Mock).mockImplementation(() => ({ + mutateAsync: queueMock, + })); + + renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + const queueButton = screen + .getAllByText(en.voteProposalUi.command.actionButton.queue)[0] + .closest('button'); + expect(queueButton).toBeInTheDocument(); + + fireEvent.click(queueButton!); + + await waitFor(() => expect(queueMock).toHaveBeenCalledTimes(1)); + }); + + it('lets user execute the BSC proposal', async () => { + const customProposal: Proposal = { + ...queuedProposal, + executionEtaDate: new Date(fakeNow.getTime() - 1000), + }; + + (useGetProposal as Vi.Mock).mockImplementation(() => ({ + data: { + proposal: customProposal, + }, + })); + + const executeMock = vi.fn(); + (useExecuteProposal as Vi.Mock).mockImplementation(() => ({ + mutateAsync: executeMock, + })); + + renderComponent(, { + accountAddress: fakeAccountAddress, + }); + + const executeButton = screen + .getAllByText(en.voteProposalUi.command.actionButton.execute)[0] + .closest('button'); + expect(executeButton).toBeInTheDocument(); + + fireEvent.click(executeButton!); + + await waitFor(() => expect(executeMock).toHaveBeenCalledTimes(1)); + expect(executeMock).toHaveBeenCalledWith({ + proposalId: customProposal.proposalId, + chainId: ChainId.BSC_TESTNET, + }); + }); + + it('lets user execute a remote proposal', async () => { + const executableRemoteProposal: RemoteProposal = { + ...queuedProposal.remoteProposals[3], + executionEtaDate: new Date(fakeNow.getTime() - 1000), + }; + + const executedProposal: Proposal = { + ...proposal, + remoteProposals: [executableRemoteProposal], + }; + + (useGetProposal as Vi.Mock).mockImplementation(() => ({ + data: { + proposal: executedProposal, + }, + })); + + const executeMock = vi.fn(); + (useExecuteProposal as Vi.Mock).mockImplementation(() => ({ + mutateAsync: executeMock, + })); + + renderComponent(, { + accountAddress: fakeAccountAddress, + chainId: executableRemoteProposal.chainId, + }); + + const executeButton = screen + .getAllByText(en.voteProposalUi.command.cta.execute)[0] + .closest('button'); + expect(executeButton).toBeInTheDocument(); + + fireEvent.click(executeButton!); + + await waitFor(() => expect(executeMock).toHaveBeenCalledTimes(1)); + expect(executeMock).toHaveBeenCalledWith({ + chainId: executableRemoteProposal.chainId, + proposalId: executableRemoteProposal.remoteProposalId, + }); + }); + + it('renders description correctly', async () => { + renderComponent(); + + expect(screen.getByTestId(TEST_IDS.description).textContent).toMatchSnapshot(); + }); +}); diff --git a/apps/evm/src/pages/Proposal/__tests__/index.multichainGovernance.spec.tsx b/apps/evm/src/pages/Proposal/__tests__/index.multichainGovernance.spec.tsx deleted file mode 100644 index bc92af9682..0000000000 --- a/apps/evm/src/pages/Proposal/__tests__/index.multichainGovernance.spec.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { screen } from '@testing-library/react'; -import proposals from '__mocks__/models/proposals'; -import { useGetProposal } from 'clients/api'; -import { type UseIsFeatureEnabled, useIsFeatureEnabled } from 'hooks/useIsFeatureEnabled'; -import { en } from 'libs/translations'; -import { renderComponent } from 'testUtils/render'; -import type Vi from 'vitest'; -import Proposal from '..'; - -vi.mock('hooks/useVote'); -vi.mock('hooks/useIsFeatureEnabled'); - -const activeProposal = proposals[1]; - -describe('Proposal page - Feature enabled: multichainGovernance', () => { - beforeEach(() => { - vi.useFakeTimers().setSystemTime( - activeProposal.endDate!.setMinutes(activeProposal.endDate!.getMinutes() - 5), - ); - - (useGetProposal as Vi.Mock).mockImplementation(() => ({ - data: activeProposal, - })); - - (useIsFeatureEnabled as Vi.Mock).mockImplementation( - ({ name }: UseIsFeatureEnabled) => name === 'multichainGovernance', - ); - }); - - it('renders without crashing', async () => { - renderComponent(); - }); - - it('renders commands block', async () => { - renderComponent(); - - expect(screen.getByText(en.voteProposalUi.commands.title)).toBeInTheDocument(); - }); -}); diff --git a/apps/evm/src/pages/Proposal/__tests__/index.spec.tsx b/apps/evm/src/pages/Proposal/__tests__/index.spec.tsx index b23ac7333a..89fd2a6796 100644 --- a/apps/evm/src/pages/Proposal/__tests__/index.spec.tsx +++ b/apps/evm/src/pages/Proposal/__tests__/index.spec.tsx @@ -9,7 +9,7 @@ import BigNumber from 'bignumber.js'; import type Vi from 'vitest'; import fakeAddress from '__mocks__/models/address'; -import proposals from '__mocks__/models/proposals'; +import { proposals } from '__mocks__/models/proposals'; import voters from '__mocks__/models/voters'; import { renderComponent } from 'testUtils/render'; @@ -27,7 +27,7 @@ import { type UseIsFeatureEnabled, useIsFeatureEnabled } from 'hooks/useIsFeatur import useVote from 'hooks/useVote'; import { VError } from 'libs/errors'; import { en } from 'libs/translations'; -import { VoteSupport } from 'types'; +import { ChainId, VoteSupport } from 'types'; import { REDIRECT_TEST_CONTENT } from 'containers/Redirect/__mocks__'; import Proposal from '..'; @@ -65,7 +65,9 @@ describe('Proposal page', () => { })); (useGetProposal as Vi.Mock).mockImplementation(() => ({ - data: activeProposal, + data: { + proposal: activeProposal, + }, })); (useGetProposalThreshold as Vi.Mock).mockImplementation(() => ({ @@ -110,7 +112,9 @@ describe('Proposal page', () => { it('vote buttons are hidden when proposal is not active', async () => { (useGetProposal as Vi.Mock).mockImplementation(() => ({ - data: canceledProposal, + data: { + proposal: canceledProposal, + }, })); const { queryByText } = renderComponent(, { @@ -184,7 +188,7 @@ describe('Proposal page', () => { await waitFor(() => expect(queryByTestId(TEST_IDS.votingDisabledWarning)).toBeNull()); }); - it('renders warning about voting being disabled when the feature flag is off', async () => { + it('renders warning about voting being disabled when the feature flag is off and proposal is active', async () => { (useIsFeatureEnabled as Vi.Mock).mockImplementation(() => false); const { getByTestId } = renderComponent(, { @@ -216,7 +220,11 @@ describe('Proposal page', () => { expect(castButton).toBeEnabled(); fireEvent.click(castButton); await waitFor(() => - expect(vote).toBeCalledWith({ proposalId: 97, voteReason: '', voteType: 1 }), + expect(vote).toHaveBeenCalledWith({ + proposalId: activeProposal.proposalId, + voteReason: '', + voteType: 1, + }), ); }); @@ -248,7 +256,11 @@ describe('Proposal page', () => { fireEvent.click(castButton); await waitFor(() => - expect(vote).toBeCalledWith({ proposalId: 97, voteReason: comment, voteType: 0 }), + expect(vote).toHaveBeenCalledWith({ + proposalId: activeProposal.proposalId, + voteReason: comment, + voteType: 0, + }), ); }); @@ -275,7 +287,11 @@ describe('Proposal page', () => { expect(castButton).toBeEnabled(); fireEvent.click(castButton); await waitFor(() => - expect(vote).toBeCalledWith({ proposalId: 97, voteReason: '', voteType: 2 }), + expect(vote).toHaveBeenCalledWith({ + proposalId: activeProposal.proposalId, + voteReason: '', + voteType: 2, + }), ); }); @@ -302,7 +318,7 @@ describe('Proposal page', () => { data: { votesMantissa: new BigNumber(0) }, })); - const proposerAddress = activeProposal.proposer; + const proposerAddress = activeProposal.proposerAddress; const { getByTestId } = renderComponent(, { accountAddress: proposerAddress, }); @@ -312,7 +328,7 @@ describe('Proposal page', () => { fireEvent.click(cancelButton); await waitFor(() => expect(cancelButton).toBeEnabled()); - expect(cancelProposal).toBeCalledWith({ proposalId: 97 }); + expect(cancelProposal).toHaveBeenCalledWith({ proposalId: activeProposal.proposalId }); }); it('does not allow user to cancel if voting power of the proposer is greater than or equals threshold', async () => { @@ -350,12 +366,14 @@ describe('Proposal page', () => { fireEvent.click(cancelButton); await waitFor(() => expect(cancelButton).toBeEnabled()); - expect(cancelProposal).toBeCalledWith({ proposalId: 97 }); + expect(cancelProposal).toHaveBeenCalledWith({ proposalId: activeProposal.proposalId }); }); it('user can queue succeeded proposal', async () => { (useGetProposal as Vi.Mock).mockImplementation(() => ({ - data: succeededProposal, + data: { + proposal: succeededProposal, + }, })); const { getByTestId } = renderComponent(, { @@ -368,12 +386,16 @@ describe('Proposal page', () => { fireEvent.click(queueButton); await waitFor(() => expect(queueButton).toBeEnabled()); - await waitFor(() => expect(queueProposal).toBeCalledWith({ proposalId: 94 })); + await waitFor(() => + expect(queueProposal).toHaveBeenCalledWith({ proposalId: succeededProposal.proposalId }), + ); }); it('user can execute queued proposal', async () => { (useGetProposal as Vi.Mock).mockImplementation(() => ({ - data: queuedProposal, + data: { + proposal: queuedProposal, + }, })); const { getByTestId } = renderComponent(, { @@ -385,6 +407,11 @@ describe('Proposal page', () => { fireEvent.click(executeButton); await waitFor(() => expect(executeButton).toBeEnabled()); - await waitFor(() => expect(executeProposal).toBeCalledWith({ proposalId: 93 })); + await waitFor(() => + expect(executeProposal).toHaveBeenCalledWith({ + proposalId: queuedProposal.proposalId, + chainId: ChainId.BSC_TESTNET, + }), + ); }); }); diff --git a/apps/evm/src/pages/Proposal/index.tsx b/apps/evm/src/pages/Proposal/index.tsx index 3f5bd7db94..5621187d8f 100644 --- a/apps/evm/src/pages/Proposal/index.tsx +++ b/apps/evm/src/pages/Proposal/index.tsx @@ -3,7 +3,6 @@ import { BigNumber } from 'bignumber.js'; import { useMemo, useState } from 'react'; import { useParams } from 'react-router-dom'; -import { commands as fakeCommands } from '__mocks__/models/proposalCommands'; import { useGetCurrentVotes, useGetProposal, useGetVoteReceipt } from 'clients/api'; import { Button, NoticeInfo, Page, Spinner } from 'components'; import { routes } from 'constants/routing'; @@ -41,8 +40,8 @@ export const ProposalUi: React.FC = ({ }) => { const { switchChain } = useSwitchChain(); const isVoteProposalFeatureEnabled = useIsFeatureEnabled({ name: 'voteProposal' }); - const isMultichainGovernanceFeatureEnabled = useIsFeatureEnabled({ - name: 'multichainGovernance', + const isOmnichainGovernanceFeatureEnabled = useIsFeatureEnabled({ + name: 'omnichainGovernance', }); const styles = useStyles(); const { t } = useTranslation(); @@ -58,35 +57,28 @@ export const ProposalUi: React.FC = ({ } return ( -
+
- {!isVoteProposalFeatureEnabled && ( + {!isVoteProposalFeatureEnabled && proposal.state === ProposalState.Active && ( switchChain({ chainId: governanceChain.id })} > - {t('vote.multichain.switchToBnb')} + {t('vote.omnichain.switchToBnb')} } /> )} - {isMultichainGovernanceFeatureEnabled && ( - - )} - -
+
= ({ /> = ({ /> = ({ + {isOmnichainGovernanceFeatureEnabled && } + {isVoteProposalFeatureEnabled && voteModalType !== undefined && ( = ({ const Proposal = () => { const { accountAddress } = useAccountAddress(); const { proposalId = '' } = useParams<{ proposalId: string }>(); - const { data: proposal, error: getProposalError } = useGetProposal( - { proposalId, accountAddress }, + const { data: proposalData, error: getProposalError } = useGetProposal( + { proposalId: Number(proposalId), accountAddress }, { enabled: !!proposalId }, ); + const proposal = proposalData?.proposal; const xvs = useGetToken({ symbol: 'XVS', diff --git a/apps/evm/src/pages/Proposal/styles.ts b/apps/evm/src/pages/Proposal/styles.ts index acda847023..64ac57a295 100644 --- a/apps/evm/src/pages/Proposal/styles.ts +++ b/apps/evm/src/pages/Proposal/styles.ts @@ -11,31 +11,6 @@ export const useStyles = () => { spinner: css` height: 100%; `, - votes: css` - display: flex; - - ${theme.breakpoints.down('xl')} { - display: block; - } - `, - vote: css` - display: flex; - flex-direction: column; - flex: 1; - margin-right: ${theme.spacing(8)}; - - ${theme.breakpoints.down('xl')} { - margin-right: 0; - - :last-of-type { - margin-bottom: 0; - } - } - - :last-of-type { - margin-right: 0; - } - `, successColor: theme.palette.interactive.success, againstColor: theme.palette.interactive.error, abstainColor: theme.palette.text.secondary, diff --git a/apps/evm/src/pages/Proposal/testIds.ts b/apps/evm/src/pages/Proposal/testIds.ts index 1dee325a03..d9a4fdfd38 100644 --- a/apps/evm/src/pages/Proposal/testIds.ts +++ b/apps/evm/src/pages/Proposal/testIds.ts @@ -5,5 +5,7 @@ export default { against: 'proposal-vote-summary-against', abstain: 'proposal-vote-summary-abstain', }, + commands: 'proposal-commands', command: 'proposal-command', + description: 'proposal-description', }; diff --git a/apps/evm/src/pages/Voter/Transactions/index.tsx b/apps/evm/src/pages/Voter/Transactions/index.tsx index 5dc8d647c5..82226c888b 100644 --- a/apps/evm/src/pages/Voter/Transactions/index.tsx +++ b/apps/evm/src/pages/Voter/Transactions/index.tsx @@ -8,8 +8,9 @@ import { useGetToken } from 'libs/tokens'; import { useTranslation } from 'libs/translations'; import { useChainId } from 'libs/wallet'; import { type VoteDetail, VoteSupport } from 'types'; -import { convertMantissaToTokens, generateChainExplorerUrl } from 'utilities'; +import { convertMantissaToTokens, generateExplorerUrl } from 'utilities'; +import { routes } from 'constants/routing'; import { useStyles } from './styles'; interface TransactionsProps { @@ -71,11 +72,20 @@ export const Transactions: React.FC = ({ }, }, { - key: 'sent', - label: t('voterDetail.sent'), - selectOptionLabel: t('voterDetail.sent'), - renderCell: transaction => - t('voterDetail.readableSent', { date: transaction.blockTimestamp }), + key: 'proposalId', + label: t('voterDetail.proposalNumber'), + selectOptionLabel: t('voterDetail.proposalNumber'), + renderCell: transaction => ( + + {transaction.proposalId} + + ), }, { key: 'amount', @@ -103,7 +113,7 @@ export const Transactions: React.FC = ({ `voter-transaction-table-row-${row.blockNumber}`} + rowKeyExtractor={row => `voter-transaction-table-row-${row.proposalId}`} breakpoint="sm" css={styles.cardContentGrid} /> @@ -117,7 +127,7 @@ export const Transactions: React.FC = ({ asChild > ; } -const Wrapper: React.FC = ({ children, queryClient, options }) => { +const Wrapper: React.FC = ({ children, options }) => { if (options?.accountAddress) { const accountAddress = options?.accountAddress; @@ -58,7 +58,7 @@ const Wrapper: React.FC = ({ children, queryClient, options }) => return ( - + @@ -71,31 +71,15 @@ const Wrapper: React.FC = ({ children, queryClient, options }) => ); }; -export const renderComponent = (children: ReactElement, options?: Partial) => { - const queryClient = createQueryClient(); - - const renderRes = renderComponentTl(children, { - wrapper: props => , +export const renderComponent = (children: ReactElement, options?: Partial) => + renderComponentTl(children, { + wrapper: props => , }); - return { - ...renderRes, - queryClient, - }; -}; - export const renderHook = ( hook: (props: TProps) => TResult, options?: Partial, -) => { - const queryClient = createQueryClient(); - - const renderRes = renderHookTl(hook, { - wrapper: props => , +) => + renderHookTl(hook, { + wrapper: props => , }); - - return { - ...renderRes, - queryClient, - }; -}; diff --git a/apps/evm/src/types/index.ts b/apps/evm/src/types/index.ts index fff157f8f0..b96a41ddec 100644 --- a/apps/evm/src/types/index.ts +++ b/apps/evm/src/types/index.ts @@ -154,32 +154,15 @@ export interface Pool { userBorrowLimitCents?: BigNumber; } -export enum ProposalCommandState { +export enum RemoteProposalState { Pending, Bridged, - Active, - Canceled, - Defeated, - Succeeded, Queued, + Canceled, Expired, Executed, } -export interface ProposalCommand { - chainId: ChainId; - state: ProposalCommandState; - actionSignatures: ProposalAction[]; - bridgedAt?: Date; - canceledAt?: Date; - queuedAt?: Date; - succeededAt?: Date; - failedExecutionAt?: Date; - executableAt?: Date; - executedAt?: Date; - expiredAt?: Date; -} - export enum ProposalState { Pending, Active, @@ -232,11 +215,9 @@ export enum VoteSupport { export type ProposalVoter = { proposalId: number; address: string; - blockNumber: number; reason: string | undefined; support: VoteSupport; votesMantissa: BigNumber; - blockTimestamp: Date; }; export type ForVoter = Omit & { @@ -251,37 +232,53 @@ export type AbstainVoter = Omit & { support: VoteSupport.Abstain; }; -export interface ProposalPreview { +export interface Proposal { proposalId: number; description: DescriptionV1 | DescriptionV2; againstVotesMantissa: BigNumber; forVotesMantissa: BigNumber; abstainedVotesMantissa: BigNumber; proposalType: ProposalType; - executedDate: Date | undefined; - queuedDate: Date | undefined; - etaDate: Date | undefined; - cancelDate: Date | undefined; state: ProposalState; - userVoteSupport?: VoteSupport; - endDate?: Date; -} - -export interface Proposal extends ProposalPreview { - startDate: Date | undefined; - createdDate: Date | undefined; endBlock: number; - proposer: string; - createdTxHash: string | undefined; - cancelTxHash: string | undefined; - executedTxHash: string | undefined; - queuedTxHash: string | undefined; + proposerAddress: string; totalVotesMantissa: BigNumber; - blockNumber?: number; proposalActions: ProposalAction[]; forVotes: ForVoter[]; againstVotes: AgainstVoter[]; abstainVotes: AbstainVoter[]; + remoteProposals: RemoteProposal[]; + blockNumber?: number; + userVoteSupport?: VoteSupport; + endDate?: Date; + executedDate?: Date; + queuedDate?: Date; + expiredDate?: Date; + executionEtaDate?: Date; + cancelDate?: Date; + startDate?: Date; + createdDate?: Date; + createdTxHash?: string; + cancelTxHash?: string; + executedTxHash?: string; + queuedTxHash?: string; +} + +export interface RemoteProposal { + proposalId: number; + chainId: ChainId; + state: RemoteProposalState; + proposalActions: ProposalAction[]; + remoteProposalId?: number; + bridgedDate?: Date; + canceledDate?: Date; + canceledTxHash?: string; + queuedDate?: Date; + queuedTxHash?: string; + executionEtaDate?: Date; + executedDate?: Date; + executedTxHash?: string; + expiredDate?: Date; } export interface JsonProposal { @@ -301,12 +298,11 @@ export interface JsonProposal { export interface VotersDetails { result: { + proposalId: number; address: string; votesMantissa: BigNumber; reason?: string; support: VoteSupport; - blockNumber: number; - blockTimestamp: Date; }[]; } @@ -424,9 +420,8 @@ export interface LockedDeposit { } export type VoteDetail = { + proposalId: number; votesMantissa: BigNumber; - blockNumber: number; - blockTimestamp: Date; support: VoteSupport; }; diff --git a/apps/evm/src/utilities/generateChainExplorerUrl.ts b/apps/evm/src/utilities/generateExplorerUrl.ts similarity index 64% rename from apps/evm/src/utilities/generateChainExplorerUrl.ts rename to apps/evm/src/utilities/generateExplorerUrl.ts index 533253b081..46b45a8d4c 100644 --- a/apps/evm/src/utilities/generateChainExplorerUrl.ts +++ b/apps/evm/src/utilities/generateExplorerUrl.ts @@ -3,22 +3,22 @@ import type { ChainId } from 'types'; export type UrlType = 'address' | 'token' | 'tx' | 'layerZeroTx'; -export interface GenerateChainExplorerUrlInput { +export interface generateExplorerUrlInput { hash: string; chainId: ChainId; urlType?: T; } -const generateLayerZeroScanUrl = ({ hash, chainId }: GenerateChainExplorerUrlInput) => { +const generateLayerZeroScanUrl = ({ hash, chainId }: generateExplorerUrlInput) => { const { layerZeroScanUrl } = CHAIN_METADATA[chainId]; return `${layerZeroScanUrl}/tx/${hash}`; }; -export const generateChainExplorerUrl = ({ +export const generateExplorerUrl = ({ hash, urlType, chainId, -}: GenerateChainExplorerUrlInput) => { +}: generateExplorerUrlInput) => { const safeUrlType = urlType || 'address'; if (safeUrlType === 'layerZeroTx') { @@ -29,4 +29,4 @@ export const generateChainExplorerUrl = ({ return `${explorerUrl}/${safeUrlType}/${hash}`; }; -export default generateChainExplorerUrl; +export default generateExplorerUrl; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalState/__tests__/index.spec.ts b/apps/evm/src/utilities/getProposalState/__tests__/index.spec.ts similarity index 93% rename from apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalState/__tests__/index.spec.ts rename to apps/evm/src/utilities/getProposalState/__tests__/index.spec.ts index b6d5fd2dbc..034f2916d5 100644 --- a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalState/__tests__/index.spec.ts +++ b/apps/evm/src/utilities/getProposalState/__tests__/index.spec.ts @@ -1,4 +1,5 @@ import BigNumber from 'bignumber.js'; +import { PROPOSAL_EXECUTION_GRACE_PERIOD_MS } from 'constants/chainMetadata'; import { ProposalState } from 'types'; import { type GetProposalStateInput, getProposalState } from '..'; @@ -63,8 +64,7 @@ describe('getProposalState', () => { params: { ...fakeParams, queued: true, - executionEtaTimestampMs: fakeNowMs - 2, - proposalExecutionGracePeriodMs: 1, + executionEtaTimestampMs: fakeNowMs - PROPOSAL_EXECUTION_GRACE_PERIOD_MS - 10, }, expectedProposalState: ProposalState.Expired, }, diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalState/index.ts b/apps/evm/src/utilities/getProposalState/index.ts similarity index 76% rename from apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalState/index.ts rename to apps/evm/src/utilities/getProposalState/index.ts index 11f743ec09..26017b888f 100644 --- a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalState/index.ts +++ b/apps/evm/src/utilities/getProposalState/index.ts @@ -1,4 +1,5 @@ import type BigNumber from 'bignumber.js'; +import { PROPOSAL_EXECUTION_GRACE_PERIOD_MS } from 'constants/chainMetadata'; import { ProposalState } from 'types'; export interface GetProposalStateInput { @@ -12,7 +13,6 @@ export interface GetProposalStateInput { executed: boolean; canceled: boolean; executionEtaTimestampMs?: number; - proposalExecutionGracePeriodMs?: number; } export const getProposalState = ({ @@ -20,7 +20,6 @@ export const getProposalState = ({ endBlockNumber, currentBlockNumber, proposalMinQuorumVotesMantissa, - proposalExecutionGracePeriodMs, forVotesMantissa, passing, queued, @@ -41,20 +40,13 @@ export const getProposalState = ({ } const nowMs = new Date().getTime(); - const expiredEtaTimestampMs = - (executionEtaTimestampMs ?? 0) + (proposalExecutionGracePeriodMs ?? 0); + const expiredEtaTimestampMs = (executionEtaTimestampMs ?? 0) + PROPOSAL_EXECUTION_GRACE_PERIOD_MS; - if (queued && !executed && !canceled && expiredEtaTimestampMs < nowMs) { + if (queued && !executed && expiredEtaTimestampMs < nowMs) { return ProposalState.Expired; } - if ( - queued && - !executed && - !canceled && - executionEtaTimestampMs && - executionEtaTimestampMs >= nowMs - ) { + if (queued && !executed) { return ProposalState.Queued; } diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalType/__tests__/index.spec.ts b/apps/evm/src/utilities/getProposalType/__tests__/index.spec.ts similarity index 91% rename from apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalType/__tests__/index.spec.ts rename to apps/evm/src/utilities/getProposalType/__tests__/index.spec.ts index c6b8e45c64..bb91af536c 100644 --- a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalType/__tests__/index.spec.ts +++ b/apps/evm/src/utilities/getProposalType/__tests__/index.spec.ts @@ -1,4 +1,4 @@ -import { Proposal_Type } from 'clients/subgraph'; +import { Proposal_Type } from 'clients/subgraph/gql/generated/governanceBsc'; import { ProposalType } from 'types'; import { type GetProposalTypeInput, getProposalType } from '..'; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalType/index.ts b/apps/evm/src/utilities/getProposalType/index.ts similarity index 82% rename from apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalType/index.ts rename to apps/evm/src/utilities/getProposalType/index.ts index 7725fc6a61..14adece146 100644 --- a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getProposalType/index.ts +++ b/apps/evm/src/utilities/getProposalType/index.ts @@ -1,4 +1,4 @@ -import { Proposal_Type } from 'clients/subgraph'; +import { Proposal_Type } from 'clients/subgraph/gql/generated/governanceBsc'; import { ProposalType } from 'types'; export interface GetProposalTypeInput { diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getUserVoteSupport/__tests__/index.spec.ts b/apps/evm/src/utilities/getUserVoteSupport/__tests__/index.spec.ts similarity index 91% rename from apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getUserVoteSupport/__tests__/index.spec.ts rename to apps/evm/src/utilities/getUserVoteSupport/__tests__/index.spec.ts index 5a6b9053bd..44dd4f7a81 100644 --- a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getUserVoteSupport/__tests__/index.spec.ts +++ b/apps/evm/src/utilities/getUserVoteSupport/__tests__/index.spec.ts @@ -1,4 +1,4 @@ -import { Support } from 'clients/subgraph'; +import { Support } from 'clients/subgraph/gql/generated/governanceBsc'; import { VoteSupport } from 'types'; import { type GetUserVoteSupportInput, getUserVoteSupport } from '..'; diff --git a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getUserVoteSupport/index.ts b/apps/evm/src/utilities/getUserVoteSupport/index.ts similarity index 82% rename from apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getUserVoteSupport/index.ts rename to apps/evm/src/utilities/getUserVoteSupport/index.ts index e769cd1855..2a7d329e36 100644 --- a/apps/evm/src/clients/subgraph/utilities/formatToProposalPreview/getUserVoteSupport/index.ts +++ b/apps/evm/src/utilities/getUserVoteSupport/index.ts @@ -1,4 +1,4 @@ -import { type Proposal, Support } from 'clients/subgraph'; +import { type Proposal, Support } from 'clients/subgraph/gql/generated/governanceBsc'; import { VoteSupport } from 'types'; export interface GetUserVoteSupportInput { diff --git a/apps/evm/src/utilities/index.ts b/apps/evm/src/utilities/index.ts index 80d4efac82..e595f6a9f1 100755 --- a/apps/evm/src/utilities/index.ts +++ b/apps/evm/src/utilities/index.ts @@ -11,7 +11,6 @@ export { default as indexBy } from './indexBy'; export { default as notUndefined } from './notUndefined'; export { default as calculatePercentage } from './calculatePercentage'; export { default as parseFunctionSignature } from './parseFunctionSignature'; -export { default as formatToProposal } from './formatToProposal'; export { default as compareBigNumbers } from './compareBigNumbers'; export { default as compareBooleans } from './compareBooleans'; export { default as compareNumbers } from './compareNumbers'; @@ -44,7 +43,7 @@ export * from './convertMantissaToTokens'; export * from './generatePseudoRandomRefetchInterval'; export * from './calculateYearlyEarnings'; export * from './calculateYearlyPercentageRate'; -export * from './generateChainExplorerUrl'; +export * from './generateExplorerUrl'; export * from './truncateAddress'; export * from './convertToDate'; export * from './formatToProposalDescription'; @@ -52,3 +51,7 @@ export * from './getSwapToTokenAmountReceived'; export * from './calculateDailyTokenRate'; export * from './safeLazyLoad'; export * from './extractEnumValues'; +export * from './getProposalType'; +export * from './getProposalState'; +export * from './getUserVoteSupport'; +export * from './getProposalStateLabel'; diff --git a/apps/landing/src/components/Benefits/Benefits.tsx b/apps/landing/src/components/Benefits/Benefits.tsx index 3359c4759e..7447c1f3fa 100644 --- a/apps/landing/src/components/Benefits/Benefits.tsx +++ b/apps/landing/src/components/Benefits/Benefits.tsx @@ -22,7 +22,7 @@ const content = [ }, { icon: , - title: 'Multichain', + title: 'Omnichain', text: 'Built on EVM-compatible chains for fast, secure, and low cost transactions.', }, ]; diff --git a/yarn.lock b/yarn.lock index 7a773bc048..5aa7518503 100644 --- a/yarn.lock +++ b/yarn.lock @@ -85,6 +85,26 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" +"@apollo/client@~3.2.5 || ~3.3.0 || ~3.4.0 || ~3.5.0 || ~3.6.0 || ~3.7.0 || ~3.8.0 || ~3.9.0 || ~3.10.0 || ~3.11.0": + version "3.11.10" + resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.11.10.tgz#e16ae82ea9b16536ffd109847d24f9293fab5c4d" + integrity sha512-IfGc+X4il0rDqVQBBWdxIKM+ciDCiDzBq9+Bg9z4tJMi87uF6po4v+ddiac1wP0ARgVPsFwEIGxK7jhN4pW8jg== + dependencies: + "@graphql-typed-document-node/core" "^3.1.1" + "@wry/caches" "^1.0.0" + "@wry/equality" "^0.5.6" + "@wry/trie" "^0.5.0" + graphql-tag "^2.12.6" + hoist-non-react-statics "^3.3.2" + optimism "^0.18.0" + prop-types "^15.7.2" + rehackt "^0.1.0" + response-iterator "^0.2.6" + symbol-observable "^4.0.0" + ts-invariant "^0.10.3" + tslib "^2.3.0" + zen-observable-ts "^1.2.5" + "@ardatan/relay-compiler@12.0.0": version "12.0.0" resolved "https://registry.yarnpkg.com/@ardatan/relay-compiler/-/relay-compiler-12.0.0.tgz#2e4cca43088e807adc63450e8cab037020e91106" @@ -1472,6 +1492,38 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz#5e13fac887f08c44f76b0ccaf3370eb00fec9bb6" integrity sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg== +"@envelop/core@^5.0.0", "@envelop/core@^5.0.1": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@envelop/core/-/core-5.0.2.tgz#f9649c72e66d78b55aafa0d2d2cfa5f9c3bfc127" + integrity sha512-tVL6OrMe6UjqLosiE+EH9uxh2TQC0469GwF4tE014ugRaDDKKVWwFwZe0TBMlcyHKh5MD4ZxktWo/1hqUxIuhw== + dependencies: + "@envelop/types" "5.0.0" + tslib "^2.5.0" + +"@envelop/extended-validation@^4.0.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@envelop/extended-validation/-/extended-validation-4.1.0.tgz#ec81b385ddb37457a977b62e1cb33a11db85ad3e" + integrity sha512-S90LQanW+xg3Lkp2sNiHa2KJnXXpKLucKys05Wk5zpiV0vL0SDX+/cuV+tnDhShWJucunAGi34n8xFCXsUUOkA== + dependencies: + "@graphql-tools/utils" "^10.0.0" + tslib "^2.5.0" + +"@envelop/graphql-jit@^8.0.0": + version "8.0.4" + resolved "https://registry.yarnpkg.com/@envelop/graphql-jit/-/graphql-jit-8.0.4.tgz#623344cf78ed2ffa491663ea1392d463edfda2df" + integrity sha512-3vchsMVsPyCmBMDkRPvjAqhJjyunQW7wZ5zXx6q+gfiEVcaetDJZwK+0ODo+IOxO5eNHqQ9u4Z2QiRTCCuvXgA== + dependencies: + graphql-jit "0.8.7" + tslib "^2.5.0" + value-or-promise "^1.0.12" + +"@envelop/types@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@envelop/types/-/types-5.0.0.tgz#3ae59b50ec31d4bdcc7bd0b47e9c8cf2ac44b0ff" + integrity sha512-IPjmgSc4KpQRlO4qbEDnBEixvtb06WDmjKfi/7fkZaryh5HuOmTtixe1EupQI5XfXO8joc3d27uUZ0QdC++euA== + dependencies: + tslib "^2.5.0" + "@esbuild/aix-ppc64@0.21.5": version "0.21.5" resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" @@ -2249,7 +2301,69 @@ resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.0.0.tgz#f22824caff3ae506b18207bad4126dbc6ccdb6b8" integrity sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ== -"@graphql-codegen/add@^5.0.0", "@graphql-codegen/add@^5.0.3": +"@fastify/merge-json-schemas@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@fastify/merge-json-schemas/-/merge-json-schemas-0.1.1.tgz#3551857b8a17a24e8c799e9f51795edb07baa0bc" + integrity sha512-fERDVz7topgNjtXsJTTW1JKLy0rhuLRcquYqNR9rF7OcVpCa2OVW49ZPDIhaRRCaUuvVxI+N416xUoF76HNSXA== + dependencies: + fast-deep-equal "^3.1.3" + +"@graphprotocol/client-add-source-name@^2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@graphprotocol/client-add-source-name/-/client-add-source-name-2.0.7.tgz#23e57b75589fe324b2d72cf61f783d57bb19e208" + integrity sha512-tAEBHwvpjq0bCRDrup8AW6mC8+rMulyrrZXp5xF0Eu924nl4XJOYklpzNp0B8oHs4HI+equHhXlXV6nqQ8jPcg== + dependencies: + lodash "^4.17.21" + tslib "^2.4.0" + +"@graphprotocol/client-auto-pagination@^2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@graphprotocol/client-auto-pagination/-/client-auto-pagination-2.0.7.tgz#eaaeacde5f2d65654a605608fd5d356ba9aaa5f2" + integrity sha512-GUvN7taIsOatCPc+kq1hFVk1+I3jIfRrZ5z6s4Nts//uxbZuMmWSHn62FYj/Uq1pG2kTJ/uPZDx2iWH2STZ6BQ== + dependencies: + lodash "^4.17.21" + tslib "^2.4.0" + +"@graphprotocol/client-auto-type-merging@^2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@graphprotocol/client-auto-type-merging/-/client-auto-type-merging-2.0.7.tgz#0c1d7555750ed585f21ad3794135066e98a5c10b" + integrity sha512-zRQYO85cU/eOwnpcc9gldL3za8gf4xaZrQVwPu/fN2PL/9yPKtkzsVSXPdd4TU+/hoQOOxdP0qvsO3bTljEhxA== + dependencies: + "@graphql-mesh/transform-type-merging" "^0.102.0" + tslib "^2.4.0" + +"@graphprotocol/client-block-tracking@^2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@graphprotocol/client-block-tracking/-/client-block-tracking-2.0.6.tgz#c83518b7853ce0710672f9e01262a46cc67b268a" + integrity sha512-OStIYKIBIGU1osueFtrzrgK/nXiUsnCr8ql/Medn7k+WRrJpcdY5N74Uxw7J5TTnXqBnJjq9OM3PhIZTjUY6wg== + dependencies: + "@graphql-mesh/fusion-runtime" "^0.8.0" + "@graphql-tools/utils" "^10.0.0" + tslib "^2.4.0" + +"@graphprotocol/client-cli@^3.0.7": + version "3.0.7" + resolved "https://registry.yarnpkg.com/@graphprotocol/client-cli/-/client-cli-3.0.7.tgz#f754934c5fcfe015968b9550ce4da79eb12e122c" + integrity sha512-Y+VRUGV1KOm4gmQyk2kROqvImyWC9o6VHzXxlzSTxAkxh1OsbKBeG8StjnscE/cjlUVJX8CmKkBwI5527pydAA== + dependencies: + "@graphprotocol/client-add-source-name" "^2.0.7" + "@graphprotocol/client-auto-pagination" "^2.0.7" + "@graphprotocol/client-auto-type-merging" "^2.0.7" + "@graphprotocol/client-block-tracking" "^2.0.6" + "@graphprotocol/client-polling-live" "^2.0.1" + "@graphql-mesh/cli" "^0.95.0" + "@graphql-mesh/graphql" "^0.102.0" + tslib "^2.4.0" + +"@graphprotocol/client-polling-live@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@graphprotocol/client-polling-live/-/client-polling-live-2.0.1.tgz#da0f56f6a26b943a8a9df7419586d5985f90c884" + integrity sha512-jE+9cOM5gAC18uMA7nC7w5X/ru4U4ZrZxWqh3N+gxoLIPpnNYerwzRfFJskPyzl0QQjMiUMua9agqKCyxNBlOA== + dependencies: + "@repeaterjs/repeater" "^3.0.4" + tslib "^2.4.0" + +"@graphql-codegen/add@^5.0.3": version "5.0.3" resolved "https://registry.yarnpkg.com/@graphql-codegen/add/-/add-5.0.3.tgz#1ede6bac9a93661ed7fa5808b203d079e1b1d215" integrity sha512-SxXPmramkth8XtBlAHu4H4jYcYXM/o3p01+psU+0NADQowA8jtYkK6MW5rV6T+CxkEaNZItfSmZRPgIuypcqnA== @@ -2298,7 +2412,7 @@ yaml "^2.3.1" yargs "^17.0.0" -"@graphql-codegen/client-preset@^4.1.0", "@graphql-codegen/client-preset@^4.4.0": +"@graphql-codegen/client-preset@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@graphql-codegen/client-preset/-/client-preset-4.4.0.tgz#f79d50ee2acb2d129072c1a080af90c30388fff7" integrity sha512-Q0NHFK7KXLhEaRC/k82ge0dHDfeHJEvvDeV0vV3+oSurHNa/lpxQtbK2BqknZe+JDfZ1YOOvYT93XsAkYD+SQg== @@ -2317,7 +2431,26 @@ "@graphql-typed-document-node/core" "3.2.0" tslib "~2.6.0" -"@graphql-codegen/core@^4.0.2": +"@graphql-codegen/client-preset@^4.5.1": + version "4.5.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/client-preset/-/client-preset-4.5.1.tgz#7cb6405e26a73f67e88aa1815e28dfd3e28f2fad" + integrity sha512-UE2/Kz2eaxv35HIXFwlm2QwoUH77am6+qp54aeEWYq+T+WPwmIc6+YzqtGiT/VcaXgoOUSgidREGm9R6jKcf9g== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/template" "^7.20.7" + "@graphql-codegen/add" "^5.0.3" + "@graphql-codegen/gql-tag-operations" "4.0.12" + "@graphql-codegen/plugin-helpers" "^5.1.0" + "@graphql-codegen/typed-document-node" "^5.0.12" + "@graphql-codegen/typescript" "^4.1.2" + "@graphql-codegen/typescript-operations" "^4.4.0" + "@graphql-codegen/visitor-plugin-common" "^5.6.0" + "@graphql-tools/documents" "^1.0.0" + "@graphql-tools/utils" "^10.0.0" + "@graphql-typed-document-node/core" "3.2.0" + tslib "~2.6.0" + +"@graphql-codegen/core@^4.0.0", "@graphql-codegen/core@^4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@graphql-codegen/core/-/core-4.0.2.tgz#7e6ec266276f54bbf02f60599d9e518f4a59d85e" integrity sha512-IZbpkhwVqgizcjNiaVzNAzm/xbWT6YnGgeOLwVjm4KbJn3V2jchVtuzHH09G5/WkkLSk2wgbXNdwjM41JxO6Eg== @@ -2338,6 +2471,41 @@ auto-bind "~4.0.0" tslib "~2.6.0" +"@graphql-codegen/gql-tag-operations@4.0.12": + version "4.0.12" + resolved "https://registry.yarnpkg.com/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.12.tgz#99d5231f0f21cc44c9ed5efb3cccfd193f7f884f" + integrity sha512-v279i49FJ5dMmQXIGUgm6FtnnkxtJjVJWDNYh9JK4ppvOixdHp+PmEzW227DkLN6avhVxNnYdp/1gdRBwdWypw== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.1.0" + "@graphql-codegen/visitor-plugin-common" "5.6.0" + "@graphql-tools/utils" "^10.0.0" + auto-bind "~4.0.0" + tslib "~2.6.0" + +"@graphql-codegen/plugin-helpers@^2.7.2": + version "2.7.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.7.2.tgz#6544f739d725441c826a8af6a49519f588ff9bed" + integrity sha512-kln2AZ12uii6U59OQXdjLk5nOlh1pHis1R98cDZGFnfaiAbX9V3fxcZ1MMJkB7qFUymTALzyjZoXXdyVmPMfRg== + dependencies: + "@graphql-tools/utils" "^8.8.0" + change-case-all "1.0.14" + common-tags "1.8.2" + import-from "4.0.0" + lodash "~4.17.0" + tslib "~2.4.0" + +"@graphql-codegen/plugin-helpers@^3.0.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-3.1.2.tgz#69a2e91178f478ea6849846ade0a59a844d34389" + integrity sha512-emOQiHyIliVOIjKVKdsI5MXj312zmRDwmHpyUTZMjfpvxq/UVAHUJIVdVf+lnjjrI+LXBTgMlTWTgHQfmICxjg== + dependencies: + "@graphql-tools/utils" "^9.0.0" + change-case-all "1.0.15" + common-tags "1.8.2" + import-from "4.0.0" + lodash "~4.17.0" + tslib "~2.4.0" + "@graphql-codegen/plugin-helpers@^5.0.3", "@graphql-codegen/plugin-helpers@^5.0.4", "@graphql-codegen/plugin-helpers@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.1.0.tgz#5c4ace748b9761d082ec1a0c19a82047bacce553" @@ -2359,7 +2527,7 @@ "@graphql-tools/utils" "^10.0.0" tslib "~2.6.0" -"@graphql-codegen/typed-document-node@^5.0.1", "@graphql-codegen/typed-document-node@^5.0.10": +"@graphql-codegen/typed-document-node@^5.0.0", "@graphql-codegen/typed-document-node@^5.0.10", "@graphql-codegen/typed-document-node@^5.0.12": version "5.0.12" resolved "https://registry.yarnpkg.com/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.12.tgz#d260586a9094066215fafa2bbc34fd1848665aaa" integrity sha512-Wsbc1AqC+MFp3maWPzrmmyHLuWCPB63qBBFLTKtO6KSsnn0KnLocBp475wkfBZnFISFvzwpJ0e6LV71gKfTofQ== @@ -2370,6 +2538,27 @@ change-case-all "1.0.15" tslib "~2.6.0" +"@graphql-codegen/typescript-generic-sdk@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-generic-sdk/-/typescript-generic-sdk-3.1.0.tgz#6380c19dd0fafc160cf80b859b50013217973499" + integrity sha512-nQZi/YGRI1+qCZZsh0V5nz6+hCHSN4OU9tKyOTDsEPyDFnGEukDuRdCH2IZasGn22a3Iu5TUDkgp5w9wEQwGmg== + dependencies: + "@graphql-codegen/plugin-helpers" "^3.0.0" + "@graphql-codegen/visitor-plugin-common" "2.13.1" + auto-bind "~4.0.0" + tslib "~2.4.0" + +"@graphql-codegen/typescript-operations@^4.0.0", "@graphql-codegen/typescript-operations@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-4.4.0.tgz#d614294760cda1955aff69063dcb2f466c63d248" + integrity sha512-oVlos2ySx8xIbbe8r5ZI6mOpI+OTeP14RmS2MchBJ6DL+S9G16O6+9V3Y8V22fTnmBTZkTfAAaBv4HYhhDGWVA== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.1.0" + "@graphql-codegen/typescript" "^4.1.2" + "@graphql-codegen/visitor-plugin-common" "5.6.0" + auto-bind "~4.0.0" + tslib "~2.6.0" + "@graphql-codegen/typescript-operations@^4.0.1", "@graphql-codegen/typescript-operations@^4.3.0": version "4.3.1" resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-4.3.1.tgz#05c19be1c99aa65b996895fc603f843ac97d7a92" @@ -2381,6 +2570,29 @@ auto-bind "~4.0.0" tslib "~2.6.0" +"@graphql-codegen/typescript-resolvers@^4.0.0": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-resolvers/-/typescript-resolvers-4.4.1.tgz#71dada476d1b24d58f621ea67b9a03491c722529" + integrity sha512-xN/co3NofnHxpOzu5qi2Lc55C0hQZi6jJeV5mn+EnESKZBedGK0yPlaIpsUvieC6DGzGdLFA74wuSgWYULb3LA== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.1.0" + "@graphql-codegen/typescript" "^4.1.2" + "@graphql-codegen/visitor-plugin-common" "5.6.0" + "@graphql-tools/utils" "^10.0.0" + auto-bind "~4.0.0" + tslib "~2.6.0" + +"@graphql-codegen/typescript@^4.0.0", "@graphql-codegen/typescript@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-4.1.2.tgz#c57d7e8f87b689deec516bd8021a347a98f4e4db" + integrity sha512-GhPgfxgWEkBrvKR2y77OThus3K8B6U3ESo68l7+sHH1XiL2WapK5DdClViblJWKQerJRjfJu8tcaxQ8Wpk6Ogw== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.1.0" + "@graphql-codegen/schema-ast" "^4.0.2" + "@graphql-codegen/visitor-plugin-common" "5.6.0" + auto-bind "~4.0.0" + tslib "~2.6.0" + "@graphql-codegen/typescript@^4.1.0", "@graphql-codegen/typescript@^4.1.1": version "4.1.1" resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-4.1.1.tgz#f82c8f6bb23557ecce20ec120153b72e93c09aef" @@ -2392,6 +2604,22 @@ auto-bind "~4.0.0" tslib "~2.6.0" +"@graphql-codegen/visitor-plugin-common@2.13.1": + version "2.13.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.13.1.tgz#2228660f6692bcdb96b1f6d91a0661624266b76b" + integrity sha512-mD9ufZhDGhyrSaWQGrU1Q1c5f01TeWtSWy/cDwXYjJcHIj1Y/DG2x0tOflEfCvh5WcnmHNIw4lzDsg1W7iFJEg== + dependencies: + "@graphql-codegen/plugin-helpers" "^2.7.2" + "@graphql-tools/optimize" "^1.3.0" + "@graphql-tools/relay-operation-optimizer" "^6.5.0" + "@graphql-tools/utils" "^8.8.0" + auto-bind "~4.0.0" + change-case-all "1.0.14" + dependency-graph "^0.11.0" + graphql-tag "^2.11.0" + parse-filepath "^1.0.2" + tslib "~2.4.0" + "@graphql-codegen/visitor-plugin-common@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.4.0.tgz#157846e433224b55f9a755e59d02508783977e27" @@ -2424,7 +2652,7 @@ parse-filepath "^1.0.2" tslib "~2.6.0" -"@graphql-codegen/visitor-plugin-common@5.6.0", "@graphql-codegen/visitor-plugin-common@^5.4.0": +"@graphql-codegen/visitor-plugin-common@5.6.0", "@graphql-codegen/visitor-plugin-common@^5.4.0", "@graphql-codegen/visitor-plugin-common@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.6.0.tgz#755395422761ad84192b7e6d98688ee9e9a57598" integrity sha512-PowcVPJbUqMC9xTJ/ZRX1p/fsdMZREc+69CM1YY+AlFng2lL0zsdBskFJSRoviQk2Ch9IPhKGyHxlJCy9X22tg== @@ -2440,15 +2668,259 @@ parse-filepath "^1.0.2" tslib "~2.6.0" +"@graphql-inspector/core@6.2.0": + version "6.2.0" + resolved "https://registry.yarnpkg.com/@graphql-inspector/core/-/core-6.2.0.tgz#f735c5f39a9a53fc3a3cc063954a7ceec3c132a3" + integrity sha512-pazUGHdMJQqEdxt+hXRyU/E2PUMvxjvTpjkTZdhuLiEgNn9RNZQjpvq2vqO1sifWujL+6C0mJH8zSnoldb5Jfg== + dependencies: + dependency-graph "1.0.0" + object-inspect "1.13.2" + tslib "2.6.2" + +"@graphql-mesh/cache-localforage@^0.102.11": + version "0.102.13" + resolved "https://registry.yarnpkg.com/@graphql-mesh/cache-localforage/-/cache-localforage-0.102.13.tgz#45b7cbfbe5c91efab836ac07c68ec56a07fd9c56" + integrity sha512-MPgJVMKXouPaeAwCyyzEn1DFeGtZ9I3i9EVIRVnuqb5FyxKdx2XIkzfkrSvHGSpfmn7MCSer1dDGKwAdo5elKQ== + dependencies: + localforage "1.10.0" + +"@graphql-mesh/cli@^0.95.0": + version "0.95.4" + resolved "https://registry.yarnpkg.com/@graphql-mesh/cli/-/cli-0.95.4.tgz#91bd8a27c24190c3c4d706caff96cf8745c9cc0f" + integrity sha512-NVVOQaszhR1aQCWR3oxuuMZvgyZMW+Zyd53GO8CA15RhPGcPVqaL/zz5cGXSKjIZ6HK0VThGuxzocsfq0AcsOw== + dependencies: + "@graphql-codegen/core" "^4.0.0" + "@graphql-codegen/typed-document-node" "^5.0.0" + "@graphql-codegen/typescript" "^4.0.0" + "@graphql-codegen/typescript-generic-sdk" "^3.1.0" + "@graphql-codegen/typescript-operations" "^4.0.0" + "@graphql-codegen/typescript-resolvers" "^4.0.0" + "@graphql-mesh/config" "^0.104.4" + "@graphql-mesh/cross-helpers" "^0.4.6" + "@graphql-mesh/http" "^0.103.4" + "@graphql-mesh/include" "^0.1.0" + "@graphql-mesh/runtime" "^0.103.4" + "@graphql-mesh/store" "^0.102.4" + "@graphql-mesh/types" "^0.102.4" + "@graphql-mesh/utils" "^0.102.4" + "@graphql-tools/utils" "^10.5.3" + ajv "^8.12.0" + change-case "^4.1.2" + cosmiconfig "^9.0.0" + dotenv "^16.0.3" + graphql-import-node "^0.0.5" + graphql-ws "^5.12.1" + json-bigint-patch "^0.0.8" + json5 "^2.2.3" + mkdirp "^3.0.0" + open "^7.4.2" + pascal-case "^3.1.2" + rimraf "^6.0.0" + tslib "^2.4.0" + typescript "^5.4.2" + ws "^8.17.0" + yargs "^17.7.1" + optionalDependencies: + node-libcurl "^4.0.0" + uWebSockets.js "uNetworking/uWebSockets.js#semver:^20" + +"@graphql-mesh/config@^0.104.4": + version "0.104.12" + resolved "https://registry.yarnpkg.com/@graphql-mesh/config/-/config-0.104.12.tgz#4e5a8c8c81adcc28ed522dddcb639fc2e0514eea" + integrity sha512-DFd6BccapWBlViBOlFeODqUdWv3sY4wxtwYyN+bEV8P2NC9h52sPhPm8tmAPRs5q7hB7suGRKuOpaV1/agDvbQ== + dependencies: + "@envelop/core" "^5.0.0" + "@graphql-mesh/cache-localforage" "^0.102.11" + "@graphql-mesh/merger-bare" "^0.102.11" + "@graphql-mesh/merger-stitching" "^0.102.11" + "@graphql-tools/code-file-loader" "^8.0.0" + "@graphql-tools/graphql-file-loader" "^8.0.0" + "@graphql-tools/load" "^8.0.0" + "@graphql-yoga/plugin-persisted-operations" "^3.0.0" + "@whatwg-node/fetch" "^0.9.0" + camel-case "^4.1.2" + param-case "^3.0.4" + pascal-case "^3.1.2" + +"@graphql-mesh/cross-helpers@^0.4.6": + version "0.4.8" + resolved "https://registry.yarnpkg.com/@graphql-mesh/cross-helpers/-/cross-helpers-0.4.8.tgz#3c35264c7a61f579437a67a5c8d09c704d0d3af7" + integrity sha512-r7FLCefoXBVriHbx2mU9QTmH7Hz1gw7LWGRKzTeKV0o2X7KNT2TMLgxq8dsz0vGUec9/i2eNE7EIafZbQVIr5Q== + dependencies: + path-browserify "1.0.1" + +"@graphql-mesh/fusion-runtime@^0.8.0": + version "0.8.14" + resolved "https://registry.yarnpkg.com/@graphql-mesh/fusion-runtime/-/fusion-runtime-0.8.14.tgz#44e336d51728cc2b9b4435efb295ad900f88c999" + integrity sha512-U0opLo4Q4TN4Bt4aFulN37qbncWy7c4cM1rHfKDt1taKtnmJBvU63Mcfe9XK3SKPwK6cI5s0yqxBBOAPkY8ryw== + dependencies: + "@envelop/core" "^5.0.1" + "@graphql-mesh/cross-helpers" "^0.4.6" + "@graphql-mesh/runtime" "^0.103.7" + "@graphql-mesh/transport-common" "^0.7.7" + "@graphql-mesh/types" "^0.102.6" + "@graphql-mesh/utils" "^0.102.6" + "@graphql-tools/delegate" "^10.0.21" + "@graphql-tools/executor" "^1.3.1" + "@graphql-tools/federation" "^2.2.10" + "@graphql-tools/stitch" "^9.2.10" + "@graphql-tools/stitching-directives" "^3.1.2" + "@graphql-tools/utils" "^10.5.3" + "@graphql-tools/wrap" "^10.0.5" + "@whatwg-node/disposablestack" "^0.0.5" + change-case "^4.1.2" + graphql-yoga "^5.7.0" + tslib "^2.4.0" + +"@graphql-mesh/graphql@^0.102.0": + version "0.102.16" + resolved "https://registry.yarnpkg.com/@graphql-mesh/graphql/-/graphql-0.102.16.tgz#91d691814818208d5c8ae54ab4e384199b3afe34" + integrity sha512-5wliptx6/jJQvNbRlwHZkOlMnBuhZa5U6A6dESelkbQxJEdHUjYYva5M7TJLIpigrxvM2hbUMOAfCLGwycrI+w== + dependencies: + "@graphql-mesh/string-interpolation" "^0.5.6" + "@graphql-tools/delegate" "^10.0.28" + "@graphql-tools/federation" "^2.2.21" + "@graphql-tools/url-loader" "^8.0.9" + lodash.get "^4.4.2" + +"@graphql-mesh/http@^0.103.4": + version "0.103.12" + resolved "https://registry.yarnpkg.com/@graphql-mesh/http/-/http-0.103.12.tgz#745920e72f3503daffee3bf883c7ac9e16fb2dfb" + integrity sha512-wqmefZfHxL+lHP1rh2htz9/cPHf+/WsYDpLkD6XI2KJhRvk7shyNCfwm8I3kT8Wwl/UzqbQv50aZtTFy5Clerw== + dependencies: + "@whatwg-node/server" "^0.9.46" + graphql-yoga "^5.7.0" + +"@graphql-mesh/include@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@graphql-mesh/include/-/include-0.1.0.tgz#76593234011494034124e0d80eaf32e81e59e717" + integrity sha512-CtuhmzwT4BRq2YoCW6RWESumcBn9ZTDj/loyf2HbwT9y2i4g7Rs5bvcfsFUb2MB3gCa9k+C9vv1Q9klH4fxGKQ== + dependencies: + dotenv "^16.3.1" + get-tsconfig "^4.7.6" + jiti "^1.21.6" + +"@graphql-mesh/merger-bare@^0.102.11": + version "0.102.11" + resolved "https://registry.yarnpkg.com/@graphql-mesh/merger-bare/-/merger-bare-0.102.11.tgz#cd45a722d80db0b4d74e495c57d35e3d10bd8693" + integrity sha512-fxgr27opO9AQdvqOm01iCVeGrZlJOfqLDgICY+uCpvzApVuI/r+yd/kpFsoIH/2UYVzcNugeach3mA3TXkoxtQ== + dependencies: + "@graphql-mesh/merger-stitching" "0.102.11" + "@graphql-tools/schema" "10.0.7" + +"@graphql-mesh/merger-stitching@0.102.11", "@graphql-mesh/merger-stitching@^0.102.11": + version "0.102.11" + resolved "https://registry.yarnpkg.com/@graphql-mesh/merger-stitching/-/merger-stitching-0.102.11.tgz#8a88e42ee65ad4c92be2bb0388431161152c7192" + integrity sha512-IW1Y7InALb/41T3PLQ/6Gj2/vOhPzcP3ik2Kc3qA9ikR+jesei/+oJzEKtUN/886M/CCjtxBeyQ4iq3K8J5Zmg== + dependencies: + "@graphql-tools/delegate" "^10.0.28" + "@graphql-tools/schema" "^10.0.5" + "@graphql-tools/stitch" "^9.2.17" + +"@graphql-mesh/runtime@^0.103.4", "@graphql-mesh/runtime@^0.103.7": + version "0.103.12" + resolved "https://registry.yarnpkg.com/@graphql-mesh/runtime/-/runtime-0.103.12.tgz#b6090cafcdb15f6a04e3a44a875df280bea63910" + integrity sha512-rHLo/gYNfbsfBGnl6+TmDz6bcNcTUpED0Wl/s1hcczgGPsNArwDMTqVJiy6LrRV1g1URNes7xq0IApxpwWS3Ag== + dependencies: + "@envelop/core" "^5.0.0" + "@envelop/extended-validation" "^4.0.0" + "@envelop/graphql-jit" "^8.0.0" + "@graphql-mesh/string-interpolation" "^0.5.6" + "@graphql-tools/batch-delegate" "^9.0.9" + "@graphql-tools/delegate" "^10.0.28" + "@graphql-tools/executor" "^1.3.2" + "@graphql-tools/wrap" "^10.0.12" + "@whatwg-node/fetch" "^0.9.0" + graphql-jit "^0.8.7" + +"@graphql-mesh/store@^0.102.4": + version "0.102.13" + resolved "https://registry.yarnpkg.com/@graphql-mesh/store/-/store-0.102.13.tgz#9becf2de7b34ef374198a99354d9411221a8a940" + integrity sha512-Mz4Sdy65ddNH5RDm9gyMaMZNhHMZiXx0PTjnu3DWDQW6HGsm97f5NECcqsyOwc9ycypEZxrKjEJns1RD3ikgpA== + dependencies: + "@graphql-inspector/core" "6.2.0" + +"@graphql-mesh/string-interpolation@^0.5.6": + version "0.5.6" + resolved "https://registry.yarnpkg.com/@graphql-mesh/string-interpolation/-/string-interpolation-0.5.6.tgz#80068a832642bebc6998f249aed4a91125438aff" + integrity sha512-zcBCc68lzNAqiccVhq/lCVtAQi6zHiyu0VdIPdfq48P7wd95J9nBqdJI21caOVKiR5giDpRQL/uMFMzRoQYkRA== + dependencies: + dayjs "1.11.13" + json-pointer "0.6.2" + lodash.get "4.4.2" + +"@graphql-mesh/transform-type-merging@^0.102.0": + version "0.102.13" + resolved "https://registry.yarnpkg.com/@graphql-mesh/transform-type-merging/-/transform-type-merging-0.102.13.tgz#348e051537824175fff56f6340dcc63f58ba65fd" + integrity sha512-xWdURCm1eFShZv2TYv6Jah2QmGlWeyKCASRjdYnS5hi/acwwAgF4nWl+KEL/lXoTWUcGv6zdE+An7nql38ymaw== + dependencies: + "@graphql-tools/delegate" "^10.0.28" + "@graphql-tools/stitching-directives" "^3.1.9" + +"@graphql-mesh/transport-common@^0.7.7": + version "0.7.18" + resolved "https://registry.yarnpkg.com/@graphql-mesh/transport-common/-/transport-common-0.7.18.tgz#83f848729132033db778cf57ea59e2358880474c" + integrity sha512-Bfcb3upW81AzeWN9m8VQZaZ3DiRUpArAMJd1I9RtTDKml73a1BA3mRtEgYAheQrOFJRBRYlGWI39OSgEpy2UEg== + dependencies: + "@envelop/core" "^5.0.1" + "@graphql-mesh/types" "^0.103.4" + "@graphql-tools/delegate" "^10.2.3" + "@graphql-tools/utils" "^10.6.0" + tslib "^2.4.0" + +"@graphql-mesh/types@^0.102.4", "@graphql-mesh/types@^0.102.6": + version "0.102.13" + resolved "https://registry.yarnpkg.com/@graphql-mesh/types/-/types-0.102.13.tgz#9e1274f660ebc8318bec913cc0fc77fae6a16221" + integrity sha512-2C/fN2dMd0XyNgZBzpv3F2FMPgtOu/aYZNLL6ne6RfTw5BqeYh7tNVJtO+tloHExmwBCSMeVOh27MQSZLtxq+w== + dependencies: + "@graphql-tools/batch-delegate" "^9.0.10" + "@graphql-tools/delegate" "^10.0.28" + "@graphql-typed-document-node/core" "^3.2.0" + +"@graphql-mesh/types@^0.103.4": + version "0.103.5" + resolved "https://registry.yarnpkg.com/@graphql-mesh/types/-/types-0.103.5.tgz#ec7382264d96638dfdfc61fa431c8b1d3e85ed0d" + integrity sha512-U0Y4zIJdhIW8ChNgYd9LsBDTF0qtUZykk+ioIvxRcKWLUbXG/sOW1wL1LgivBLLQYJM4w2vyv0H93iDqCZOBtg== + dependencies: + "@graphql-tools/batch-delegate" "^9.0.10" + "@graphql-tools/delegate" "^10.0.28" + "@graphql-typed-document-node/core" "^3.2.0" + +"@graphql-mesh/utils@^0.102.4", "@graphql-mesh/utils@^0.102.6": + version "0.102.13" + resolved "https://registry.yarnpkg.com/@graphql-mesh/utils/-/utils-0.102.13.tgz#3d3660d772a82a8b5091fe0de2eda31184448c86" + integrity sha512-Bj2t8FbeytZPz5Zce+Gs9p766wUyJP8uWp7uLEls4gGyTnhoGdppyzg6YbhPJFbY34JBwxlac/G7G8sWTtsKjA== + dependencies: + "@graphql-mesh/string-interpolation" "^0.5.6" + "@graphql-tools/delegate" "^10.0.28" + "@whatwg-node/disposablestack" "^0.0.5" + "@whatwg-node/fetch" "^0.10.0" + dset "^3.1.2" + js-yaml "^4.1.0" + lodash.get "^4.4.2" + lodash.topath "^4.5.2" + tiny-lru "^11.0.0" + "@graphql-tools/apollo-engine-loader@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-8.0.0.tgz#ac1f351cbe41508411784f25757f5557b0f27489" - integrity sha512-axQTbN5+Yxs1rJ6cWQBOfw3AEeC+fvIuZSfJLPLLvFJLj4pUm9fhxey/g6oQZAAQJqKPfw+tLDUQvnfvRK8Kmg== + version "8.0.6" + resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-8.0.6.tgz#4a280ec52e84d82c68ae92465839f4956633ee60" + integrity sha512-w6h5FrqUezUQ+RtC8rFbiaTatX4KnHB5pu9hMHzjo/9dJRC7JR9/6pn6KcpODLkTHLM1IrKpzjU5ZvLcoOqW/Q== dependencies: "@ardatan/sync-fetch" "^0.0.1" - "@graphql-tools/utils" "^10.0.0" - "@whatwg-node/fetch" "^0.9.0" + "@graphql-tools/utils" "^10.6.1" + "@whatwg-node/fetch" "^0.10.0" + tslib "^2.4.0" + +"@graphql-tools/batch-delegate@^9.0.10", "@graphql-tools/batch-delegate@^9.0.16", "@graphql-tools/batch-delegate@^9.0.9": + version "9.0.16" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-9.0.16.tgz#0e877762b2023615a2200b9d14840aa14ceaa250" + integrity sha512-jg4lFrCASfOMFCuFr0G7zdndhMJnn0Mw57Ju2YJWzgxulZ3tldCu5liQ9iuVIl5ZVoTk8kz3JpkBkHrXZJMwhw== + dependencies: + "@graphql-tools/delegate" "^10.2.0" + "@graphql-tools/utils" "^10.5.6" + dataloader "2.2.2" tslib "^2.4.0" + value-or-promise "^1.0.12" "@graphql-tools/batch-execute@^9.0.0": version "9.0.0" @@ -2460,6 +2932,25 @@ tslib "^2.4.0" value-or-promise "^1.0.12" +"@graphql-tools/batch-execute@^9.0.6": + version "9.0.6" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-9.0.6.tgz#0eee17ca7bd378f7313e963a32450e7b99ed955e" + integrity sha512-S0mLTUJQJuItGmwouYZyXeFaRWOVmVCAMLi33M5PuZbnsoTwKMB/YPPkAQ72ay3GfclnW66XcO4EClbVynw7eQ== + dependencies: + "@graphql-tools/utils" "^10.5.6" + dataloader "^2.2.2" + tslib "^2.4.0" + value-or-promise "^1.0.12" + +"@graphql-tools/batch-execute@^9.0.7": + version "9.0.7" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-9.0.7.tgz#d9022833451179e35c50705f1ae2813c1f8f6a11" + integrity sha512-0WriB4FNUClDJceGa7RQrbxwDzwrC/YqnYsXGnxOtpFS7F96SBO2HV3ycrSNEQC7ZDp4fHeevAAZfL6A2Nts7Q== + dependencies: + "@graphql-tools/utils" "^10.6.0" + dataloader "^2.2.2" + tslib "^2.4.0" + "@graphql-tools/code-file-loader@^8.0.0": version "8.0.1" resolved "https://registry.yarnpkg.com/@graphql-tools/code-file-loader/-/code-file-loader-8.0.1.tgz#86ab699cc8ed76010b2f0401e8a4a149338b759e" @@ -2484,6 +2975,34 @@ tslib "^2.5.0" value-or-promise "^1.0.12" +"@graphql-tools/delegate@^10.0.21", "@graphql-tools/delegate@^10.0.28", "@graphql-tools/delegate@^10.2.0": + version "10.2.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-10.2.0.tgz#a879feb454b6afe9ca1e04d5bd5c77e2b91e093b" + integrity sha512-poWeNz4tnZnENopYaXILfqJux8aG7YqfOn/QR1q6tp6Q8PYISgtGZlX02jUPKYySrUgR1zutUB+xsxvPyrUlog== + dependencies: + "@graphql-tools/batch-execute" "^9.0.6" + "@graphql-tools/executor" "^1.3.3" + "@graphql-tools/schema" "^10.0.8" + "@graphql-tools/utils" "^10.5.6" + "@repeaterjs/repeater" "^3.0.6" + dataloader "^2.2.2" + dset "^3.1.2" + tslib "^2.5.0" + +"@graphql-tools/delegate@^10.2.3": + version "10.2.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-10.2.3.tgz#6916d53f8e1a2a8035a4c553c246c39da6636ce2" + integrity sha512-gPf1mTlwkXGz5wDNpf5ldxz6ouitwoep7RNqh1Wt1BaDFJhilnt8zK4YypP24zNaCDIBijhc0GoL0Yvi6VFAAg== + dependencies: + "@graphql-tools/batch-execute" "^9.0.7" + "@graphql-tools/executor" "^1.3.3" + "@graphql-tools/schema" "^10.0.8" + "@graphql-tools/utils" "^10.6.0" + "@repeaterjs/repeater" "^3.0.6" + dataloader "^2.2.2" + dset "^3.1.2" + tslib "^2.5.0" + "@graphql-tools/documents@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@graphql-tools/documents/-/documents-1.0.0.tgz#e3ed97197cc22ec830ca227fd7d17e86d8424bdf" @@ -2505,6 +3024,18 @@ tslib "^2.4.0" ws "8.13.0" +"@graphql-tools/executor-graphql-ws@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/executor-graphql-ws/-/executor-graphql-ws-1.3.2.tgz#00a82a683b8be88bae859ee464cde4c342d9d167" + integrity sha512-m+7+g3dSyaomuJAgDoG/9RcZC5/hGEpDQjmKmbLf/WvGdv5fLJNsuoJ7pIjlT5r7wQJNjEPGoHeh9pD/YykRww== + dependencies: + "@graphql-tools/utils" "^10.5.6" + "@types/ws" "^8.0.0" + graphql-ws "^5.14.0" + isomorphic-ws "^5.0.0" + tslib "^2.4.0" + ws "^8.17.1" + "@graphql-tools/executor-http@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@graphql-tools/executor-http/-/executor-http-1.0.0.tgz#3d7f1ce70dcc40432fb92b970bd1ab4dd1c37b12" @@ -2519,6 +3050,19 @@ tslib "^2.4.0" value-or-promise "^1.0.12" +"@graphql-tools/executor-http@^1.1.9": + version "1.1.9" + resolved "https://registry.yarnpkg.com/@graphql-tools/executor-http/-/executor-http-1.1.9.tgz#9e672ccd88eeca2256c224adc0eda33a89c21af7" + integrity sha512-dJRj78QEGNNnlhkhqPUG9z+1uAr7znZ4dzabEVgY5uSXTmUIFcTKpOGYv2/QAuvyqGN40XxbcdVRJta6XHX2BQ== + dependencies: + "@graphql-tools/utils" "^10.5.6" + "@repeaterjs/repeater" "^3.0.4" + "@whatwg-node/fetch" "^0.10.0" + extract-files "^11.0.0" + meros "^1.2.1" + tslib "^2.4.0" + value-or-promise "^1.0.12" + "@graphql-tools/executor-legacy-ws@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@graphql-tools/executor-legacy-ws/-/executor-legacy-ws-1.0.1.tgz#49764812fc93f401cb3f3ef32b2d6db4a9cd8db5" @@ -2530,6 +3074,17 @@ tslib "^2.4.0" ws "8.13.0" +"@graphql-tools/executor-legacy-ws@^1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/executor-legacy-ws/-/executor-legacy-ws-1.1.3.tgz#7495e1db0799fb13cfb9f4a772385d1deb11388d" + integrity sha512-rMEMJoAEhDG9mBzphFYSaei3d3Bo1YfC0cW2+/jab9sFeMMslaSNhKCRMEv24SWOforPntFrqPfGl7T3hB0jYg== + dependencies: + "@graphql-tools/utils" "^10.6.0" + "@types/ws" "^8.0.0" + isomorphic-ws "^5.0.0" + tslib "^2.4.0" + ws "^8.17.1" + "@graphql-tools/executor@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@graphql-tools/executor/-/executor-1.1.0.tgz#bafddb7c56d8250c5eda83437c10664e702109a8" @@ -2541,6 +3096,35 @@ tslib "^2.4.0" value-or-promise "^1.0.12" +"@graphql-tools/executor@^1.3.1", "@graphql-tools/executor@^1.3.2", "@graphql-tools/executor@^1.3.3": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/executor/-/executor-1.3.4.tgz#0227a9ec0ba7cbdbc6de92e2c74d48749ed866e1" + integrity sha512-2XbOp1K8iQiDgExbBTrhjqQX1bh5lHbri3nEaL8pCiiirZTLs4C1a1mizGcQzkeciF41paWEfBu1M1mOewtFAQ== + dependencies: + "@graphql-tools/utils" "^10.6.0" + "@graphql-typed-document-node/core" "3.2.0" + "@repeaterjs/repeater" "^3.0.4" + tslib "^2.4.0" + value-or-promise "^1.0.12" + +"@graphql-tools/federation@^2.2.10", "@graphql-tools/federation@^2.2.21": + version "2.2.30" + resolved "https://registry.yarnpkg.com/@graphql-tools/federation/-/federation-2.2.30.tgz#2de60bfe35b23948c6c4e283e1241e785fd84e53" + integrity sha512-p5Nnrh6X6aRBDWQat7tP7XA8NFqTlGMu4n7+Jlu70rJQH3RRakARQ/4ho6SSPe3Ap8IVIwAAp6D0wLRHeF17KA== + dependencies: + "@graphql-tools/delegate" "^10.2.0" + "@graphql-tools/executor-http" "^1.1.9" + "@graphql-tools/merge" "^9.0.9" + "@graphql-tools/schema" "^10.0.8" + "@graphql-tools/stitch" "^9.4.1" + "@graphql-tools/utils" "^10.5.6" + "@graphql-tools/wrap" "^10.0.18" + "@whatwg-node/fetch" "^0.10.0" + tslib "^2.4.0" + value-or-promise "^1.0.12" + optionalDependencies: + "@apollo/client" "~3.2.5 || ~3.3.0 || ~3.4.0 || ~3.5.0 || ~3.6.0 || ~3.7.0 || ~3.8.0 || ~3.9.0 || ~3.10.0 || ~3.11.0" + "@graphql-tools/git-loader@^8.0.0": version "8.0.1" resolved "https://registry.yarnpkg.com/@graphql-tools/git-loader/-/git-loader-8.0.1.tgz#ca1aed6342d4f636f75aacced48713c5ebdde80d" @@ -2626,6 +3210,21 @@ "@graphql-tools/utils" "^10.0.0" tslib "^2.4.0" +"@graphql-tools/merge@^9.0.10", "@graphql-tools/merge@^9.0.8", "@graphql-tools/merge@^9.0.9": + version "9.0.10" + resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-9.0.10.tgz#cdf40ce75bfd36d4eddb1ece610c7a17e99314d4" + integrity sha512-sU+b6ZmKtGnqHq8S+VI5UmjZVHWzT+b+QtCsJUEXckCKdq1P3JmwIT8+8DVxSQlh1dzpiVq37EOcJrEYOBZtBA== + dependencies: + "@graphql-tools/utils" "^10.6.0" + tslib "^2.4.0" + +"@graphql-tools/optimize@^1.3.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-1.4.0.tgz#20d6a9efa185ef8fc4af4fd409963e0907c6e112" + integrity sha512-dJs/2XvZp+wgHH8T5J2TqptT9/6uVzIYvA6uFACha+ufvdMBedkfR4b4GbT8jAKLRARiqRTxy3dctnwkTM2tdw== + dependencies: + tslib "^2.4.0" + "@graphql-tools/optimize@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-2.0.0.tgz#7a9779d180824511248a50c5a241eff6e7a2d906" @@ -2657,6 +3256,15 @@ tslib "^2.4.0" yaml-ast-parser "^0.0.43" +"@graphql-tools/relay-operation-optimizer@^6.5.0": + version "6.5.18" + resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-6.5.18.tgz#a1b74a8e0a5d0c795b8a4d19629b654cf66aa5ab" + integrity sha512-mc5VPyTeV+LwiM+DNvoDQfPqwQYhPV/cl5jOBjTgSniyaq8/86aODfMkrE2OduhQ5E00hqrkuL2Fdrgk0w1QJg== + dependencies: + "@ardatan/relay-compiler" "12.0.0" + "@graphql-tools/utils" "^9.2.1" + tslib "^2.4.0" + "@graphql-tools/relay-operation-optimizer@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-7.0.0.tgz#24367666af87bc5a81748de5e8e9b3c523fd4207" @@ -2666,6 +3274,16 @@ "@graphql-tools/utils" "^10.0.0" tslib "^2.4.0" +"@graphql-tools/schema@10.0.7": + version "10.0.7" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-10.0.7.tgz#b90282f2446d160197282d4a90297a5f842dfb3f" + integrity sha512-Cz1o+rf9cd3uMgG+zI9HlM5mPlnHQUlk/UQRZyUlPDfT+944taLaokjvj7AI6GcOFVf4f2D11XthQp+0GY31jQ== + dependencies: + "@graphql-tools/merge" "^9.0.8" + "@graphql-tools/utils" "^10.5.5" + tslib "^2.4.0" + value-or-promise "^1.0.12" + "@graphql-tools/schema@^10.0.0": version "10.0.0" resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-10.0.0.tgz#7b5f6b6a59f51c927de8c9069bde4ebbfefc64b3" @@ -2676,6 +3294,40 @@ tslib "^2.4.0" value-or-promise "^1.0.12" +"@graphql-tools/schema@^10.0.4", "@graphql-tools/schema@^10.0.5", "@graphql-tools/schema@^10.0.7", "@graphql-tools/schema@^10.0.8": + version "10.0.9" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-10.0.9.tgz#923fd9abe0b5d57cbe235c0907a661b36e1a8e37" + integrity sha512-R/sPRLJnEHg/F7owvH1zLbfXxqrEgFyr/qSjsG1q+gWhCrxbo/+c2DVjeZEZ2/AKCLllDHTD5TOU2Y5sZGNxZg== + dependencies: + "@graphql-tools/merge" "^9.0.10" + "@graphql-tools/utils" "^10.6.0" + tslib "^2.4.0" + value-or-promise "^1.0.12" + +"@graphql-tools/stitch@^9.2.10", "@graphql-tools/stitch@^9.2.17", "@graphql-tools/stitch@^9.4.1": + version "9.4.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/stitch/-/stitch-9.4.1.tgz#6ac2835f540e4de86b9791ae3b98a94c8a700832" + integrity sha512-DwOgmtApr5siu5FNWbkFcFiA6oe3zfgNw6/S83+hF1xev7sHj6+fRcgw68DyrnIUhr9ThIUb0eD+Pt4mzaCDFg== + dependencies: + "@graphql-tools/batch-delegate" "^9.0.16" + "@graphql-tools/delegate" "^10.2.0" + "@graphql-tools/executor" "^1.3.3" + "@graphql-tools/merge" "^9.0.9" + "@graphql-tools/schema" "^10.0.8" + "@graphql-tools/utils" "^10.5.6" + "@graphql-tools/wrap" "^10.0.18" + tslib "^2.4.0" + value-or-promise "^1.0.11" + +"@graphql-tools/stitching-directives@^3.1.2", "@graphql-tools/stitching-directives@^3.1.9": + version "3.1.15" + resolved "https://registry.yarnpkg.com/@graphql-tools/stitching-directives/-/stitching-directives-3.1.15.tgz#dd45511805111b9f3320e52e5ed66c18f35f19ed" + integrity sha512-iw0kdtABMK0yVYmadH+fgqCjN+g2SDrvZuzLjke7XMRjqoscYjOM50RABjNAgDf8MDLONMFvDsAF/q2ylZf/ww== + dependencies: + "@graphql-tools/delegate" "^10.2.0" + "@graphql-tools/utils" "^10.5.6" + tslib "^2.4.0" + "@graphql-tools/url-loader@^8.0.0": version "8.0.0" resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-8.0.0.tgz#8d952d5ebb7325e587cb914aaebded3dbd078cf6" @@ -2695,6 +3347,24 @@ value-or-promise "^1.0.11" ws "^8.12.0" +"@graphql-tools/url-loader@^8.0.9": + version "8.0.16" + resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-8.0.16.tgz#c4d6d505269b50229725cc2d3a3ae85d0ad32776" + integrity sha512-2VhQBkW/nvKwKJ6xrngl2YLuHSsBYH/oEhp0w56ZkNHOiPkLzEYPj74QeGBpCokf61/LrVBWg1KTpGwVh+l0UQ== + dependencies: + "@ardatan/sync-fetch" "^0.0.1" + "@graphql-tools/executor-graphql-ws" "^1.3.2" + "@graphql-tools/executor-http" "^1.1.9" + "@graphql-tools/executor-legacy-ws" "^1.1.3" + "@graphql-tools/utils" "^10.6.0" + "@graphql-tools/wrap" "^10.0.16" + "@types/ws" "^8.0.0" + "@whatwg-node/fetch" "^0.10.0" + isomorphic-ws "^5.0.0" + tslib "^2.4.0" + value-or-promise "^1.0.11" + ws "^8.17.1" + "@graphql-tools/utils@^10.0.0": version "10.0.1" resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-10.0.1.tgz#52e6c0ce920b57473823e487184f5017974fe4c4" @@ -2703,6 +3373,41 @@ "@graphql-typed-document-node/core" "^3.1.1" tslib "^2.4.0" +"@graphql-tools/utils@^10.3.2", "@graphql-tools/utils@^10.5.3", "@graphql-tools/utils@^10.5.5", "@graphql-tools/utils@^10.5.6", "@graphql-tools/utils@^10.6.0": + version "10.6.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-10.6.0.tgz#7a37e725a65c4c8ed4075553f10bcf7910781c51" + integrity sha512-bqSn2ekSNwFVZprY6YsrHkqPA7cPLNKxiPlEzS1djhfvx4q9tx7Uwc5dnLp3SSnKinJ8dJk9FA5sxNcKjCM44w== + dependencies: + "@graphql-typed-document-node/core" "^3.1.1" + cross-inspect "1.0.1" + dset "^3.1.2" + tslib "^2.4.0" + +"@graphql-tools/utils@^10.6.1": + version "10.6.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-10.6.1.tgz#5d7477ad1f917c817184bb6a1bd1266dc4b354b2" + integrity sha512-XHl0/DWkMf/8Dmw1F3RRoMPt6ZwU4J707YWcbPjS+49WZNoTVz6f+prQ4GuwZT8RqTPtrRawnGU93AV73ZLTfQ== + dependencies: + "@graphql-typed-document-node/core" "^3.1.1" + cross-inspect "1.0.1" + dset "^3.1.2" + tslib "^2.4.0" + +"@graphql-tools/utils@^8.8.0": + version "8.13.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.13.1.tgz#b247607e400365c2cd87ff54654d4ad25a7ac491" + integrity sha512-qIh9yYpdUFmctVqovwMdheVNJqFh+DQNWIhX87FJStfXYnmweBUDATok9fWPleKeFwxnW8IapKmY8m8toJEkAw== + dependencies: + tslib "^2.4.0" + +"@graphql-tools/utils@^9.0.0", "@graphql-tools/utils@^9.2.1": + version "9.2.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-9.2.1.tgz#1b3df0ef166cfa3eae706e3518b17d5922721c57" + integrity sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A== + dependencies: + "@graphql-typed-document-node/core" "^3.1.1" + tslib "^2.4.0" + "@graphql-tools/wrap@^10.0.0": version "10.0.0" resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-10.0.0.tgz#573ab111482387d4acf4757d5fb7f9553a504bc1" @@ -2714,11 +3419,52 @@ tslib "^2.4.0" value-or-promise "^1.0.12" +"@graphql-tools/wrap@^10.0.12", "@graphql-tools/wrap@^10.0.16", "@graphql-tools/wrap@^10.0.18", "@graphql-tools/wrap@^10.0.5": + version "10.0.18" + resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-10.0.18.tgz#d268bedb001bc1d75392d18f9224cbdef078833e" + integrity sha512-wK/v8CjmXz9AnbPPC/nMI6jqn5j7Ht3R4wqGWNZSSbqrf8E7EUZAvTWUZbe9dh0nIjUne87I6ndllJCTQ+C3mA== + dependencies: + "@graphql-tools/delegate" "^10.2.0" + "@graphql-tools/schema" "^10.0.7" + "@graphql-tools/utils" "^10.5.6" + tslib "^2.4.0" + value-or-promise "^1.0.12" + "@graphql-typed-document-node/core@3.2.0", "@graphql-typed-document-node/core@^3.1.1", "@graphql-typed-document-node/core@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861" integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== +"@graphql-yoga/logger@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@graphql-yoga/logger/-/logger-2.0.0.tgz#51c91cf07fc42b0d100d887315a20a4c9cac342e" + integrity sha512-Mg8psdkAp+YTG1OGmvU+xa6xpsAmSir0hhr3yFYPyLNwzUj95DdIwsMpKadDj9xDpYgJcH3Hp/4JMal9DhQimA== + dependencies: + tslib "^2.5.2" + +"@graphql-yoga/plugin-persisted-operations@^3.0.0": + version "3.10.3" + resolved "https://registry.yarnpkg.com/@graphql-yoga/plugin-persisted-operations/-/plugin-persisted-operations-3.10.3.tgz#e53e9abe38ad28269a095f18e03a391ee0e067a6" + integrity sha512-KC0X1rI4d07/DFd8OMvAfzB5UIt51N7JcgXdvR9lXSTgs2ivy/bQx+HJ+GXDYRSSXYD/2betbwF93nMg1vq1pA== + +"@graphql-yoga/subscription@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@graphql-yoga/subscription/-/subscription-5.0.1.tgz#affe9b4bca4303300cc9492d30dfbe9f089fe0e8" + integrity sha512-1wCB1DfAnaLzS+IdoOzELGGnx1ODEg9nzQXFh4u2j02vAnne6d+v4A7HIH9EqzVdPLoAaMKXCZUUdKs+j3z1fg== + dependencies: + "@graphql-yoga/typed-event-target" "^3.0.0" + "@repeaterjs/repeater" "^3.0.4" + "@whatwg-node/events" "^0.1.0" + tslib "^2.5.2" + +"@graphql-yoga/typed-event-target@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@graphql-yoga/typed-event-target/-/typed-event-target-3.0.0.tgz#57dc42e052d8294555d26ee61854d72a0236fee0" + integrity sha512-w+liuBySifrstuHbFrHoHAEyVnDFVib+073q8AeAJ/qqJfvFvAwUPLLtNohR/WDVRgSasfXtl3dcNuVJWN+rjg== + dependencies: + "@repeaterjs/repeater" "^3.0.4" + tslib "^2.5.2" + "@gulpjs/to-absolute-glob@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@gulpjs/to-absolute-glob/-/to-absolute-glob-4.0.0.tgz#1fc2460d3953e1d9b9f2dfdb4bcc99da4710c021" @@ -3032,6 +3778,21 @@ globby "^11.0.0" read-yaml-file "^1.1.0" +"@mapbox/node-pre-gyp@1.0.11": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa" + integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ== + dependencies: + detect-libc "^2.0.0" + https-proxy-agent "^5.0.0" + make-dir "^3.1.0" + node-fetch "^2.6.7" + nopt "^5.0.0" + npmlog "^5.0.1" + rimraf "^3.0.2" + semver "^7.3.5" + tar "^6.1.11" + "@mdx-js/react@^3.0.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-3.1.0.tgz#c4522e335b3897b9a845db1dbdd2f966ae8fb0ed" @@ -3832,6 +4593,24 @@ resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz#b41053e360c31a32c2640c9a45ee981a7e603fe0" integrity sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg== +"@npmcli/agent@^2.0.0": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@npmcli/agent/-/agent-2.2.2.tgz#967604918e62f620a648c7975461c9c9e74fc5d5" + integrity sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og== + dependencies: + agent-base "^7.1.0" + http-proxy-agent "^7.0.0" + https-proxy-agent "^7.0.1" + lru-cache "^10.0.1" + socks-proxy-agent "^8.0.3" + +"@npmcli/fs@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-3.1.1.tgz#59cdaa5adca95d135fc00f2bb53f5771575ce726" + integrity sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg== + dependencies: + semver "^7.3.5" + "@oozcitak/dom@1.15.10": version "1.15.10" resolved "https://registry.yarnpkg.com/@oozcitak/dom/-/dom-1.15.10.tgz#dca7289f2b292cff2a901ea4fbbcc0a1ab0b05c2" @@ -3861,7 +4640,7 @@ resolved "https://registry.yarnpkg.com/@oozcitak/util/-/util-8.3.8.tgz#10f65fe1891fd8cde4957360835e78fd1936bfdd" integrity sha512-T8TbSnGsxo6TDBJx/Sgv/BlVJL3tshxZP7Aq5R1mSnM5OcHY2dQaxLMu2+E8u3gN0MLOzdjurqN4ZRVuzQycOQ== -"@openzeppelin-3/contracts@npm:@openzeppelin/contracts@^3.4.2-solc-0.7": +"@openzeppelin-3/contracts@npm:@openzeppelin/contracts@^3.4.2-solc-0.7", "@openzeppelin/contracts-v0.7@npm:@openzeppelin/contracts@v3.4.2": version "3.4.2" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.2.tgz#d81f786fda2871d1eb8a8c5a73e455753ba53527" integrity sha512-z0zMCjyhhp4y7XKAcDAi3Vgms4T2PstwBdahiO0+9NaGICQKjynK3wduSRplTgk4LXmoO1yfDGO5RbjKYxtuxA== @@ -3876,11 +4655,6 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.5.tgz#572b5da102fc9be1d73f34968e0ca56765969812" integrity sha512-f7L1//4sLlflAN7fVzJLoRedrf5Na3Oal5PZfIq55NFcVZ90EpV1q5xOvL4lFvg3MNICSDr2hH0JUBxwlxcoPg== -"@openzeppelin/contracts-v0.7@npm:@openzeppelin/contracts@v3.4.2": - version "3.4.2" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.2.tgz#d81f786fda2871d1eb8a8c5a73e455753ba53527" - integrity sha512-z0zMCjyhhp4y7XKAcDAi3Vgms4T2PstwBdahiO0+9NaGICQKjynK3wduSRplTgk4LXmoO1yfDGO5RbjKYxtuxA== - "@openzeppelin/contracts@3.4.2-solc-0.7": version "3.4.2-solc-0.7" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.2-solc-0.7.tgz#38f4dbab672631034076ccdf2f3201fab1726635" @@ -4088,6 +4862,11 @@ resolved "https://registry.yarnpkg.com/@repeaterjs/repeater/-/repeater-3.0.4.tgz#a04d63f4d1bf5540a41b01a921c9a7fddc3bd1ca" integrity sha512-AW8PKd6iX3vAZ0vA43nOUOnbq/X5ihgU+mSXXqunMkeQADGiqw/PY0JNeYtD5sr0PAy51YPgAPbDoeapv9r8WA== +"@repeaterjs/repeater@^3.0.6": + version "3.0.6" + resolved "https://registry.yarnpkg.com/@repeaterjs/repeater/-/repeater-3.0.6.tgz#be23df0143ceec3c69f8b6c2517971a5578fdaa2" + integrity sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA== + "@rollup/plugin-inject@^5.0.3": version "5.0.5" resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz#616f3a73fe075765f91c5bec90176608bed277a3" @@ -5829,7 +6608,16 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@venusprotocol/governance-contracts@2.4.0", "@venusprotocol/governance-contracts@^2.4.0": +"@venusprotocol/governance-contracts@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@venusprotocol/governance-contracts/-/governance-contracts-2.3.0.tgz#caa729f28a36df066ff02a799ac7394fae3ef996" + integrity sha512-xMmjWUe8sMHEFcl1EGHMTD8UCSKtFCW6JsC6P9kELTSRTMrRFVAUWqhdv0wxHl3iHygyP9dpT+wR3/nUrAiA1w== + dependencies: + "@venusprotocol/solidity-utilities" "2.0.0" + hardhat-deploy-ethers "^0.3.0-beta.13" + module-alias "^2.2.2" + +"@venusprotocol/governance-contracts@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@venusprotocol/governance-contracts/-/governance-contracts-2.4.0.tgz#196b18cf93c1b4b73331d74ebae7e4a9d85ee983" integrity sha512-lM73qD/7fgCfwavD3+FWPTEd/AiMy9NK9Hqfo5nesE5UUxupFvihnt88M6UwAn1gx/PWvueRWSSA2yhBVEtstQ== @@ -5838,10 +6626,10 @@ hardhat-deploy-ethers "^0.3.0-beta.13" module-alias "^2.2.2" -"@venusprotocol/governance-contracts@^2.3.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@venusprotocol/governance-contracts/-/governance-contracts-2.3.0.tgz#caa729f28a36df066ff02a799ac7394fae3ef996" - integrity sha512-xMmjWUe8sMHEFcl1EGHMTD8UCSKtFCW6JsC6P9kELTSRTMrRFVAUWqhdv0wxHl3iHygyP9dpT+wR3/nUrAiA1w== +"@venusprotocol/governance-contracts@^2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@venusprotocol/governance-contracts/-/governance-contracts-2.5.0.tgz#abf26966720aa246ea2450f29347161b7ca1ce94" + integrity sha512-0JcNFdqxTny0jrFHab1xX+wlSsPZctDhtmxfsxwAhK7ME6b/A+6/KYQWoXYNrldlogrwEQOeXM96x3y6uigsyQ== dependencies: "@venusprotocol/solidity-utilities" "2.0.0" hardhat-deploy-ethers "^0.3.0-beta.13" @@ -6414,6 +7202,28 @@ "@walletconnect/window-getters" "^1.0.1" tslib "1.14.1" +"@whatwg-node/disposablestack@^0.0.5": + version "0.0.5" + resolved "https://registry.yarnpkg.com/@whatwg-node/disposablestack/-/disposablestack-0.0.5.tgz#cd646b1ef60a36972e018ab21f412a3539c6deec" + integrity sha512-9lXugdknoIequO4OYvIjhygvfSEgnO8oASLqLelnDhkRjgBZhc39shC3QSlZuyDO9bgYSIVa2cHAiN+St3ty4w== + dependencies: + tslib "^2.6.3" + +"@whatwg-node/events@^0.1.0": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@whatwg-node/events/-/events-0.1.2.tgz#23f7c7ad887d7fd448e9ce3261eac9ef319ddd7c" + integrity sha512-ApcWxkrs1WmEMS2CaLLFUEem/49erT3sxIVjpzU5f6zmVcnijtDSrhoK2zVobOIikZJdH63jdAXOrvjf6eOUNQ== + dependencies: + tslib "^2.6.3" + +"@whatwg-node/fetch@^0.10.0", "@whatwg-node/fetch@^0.10.1": + version "0.10.1" + resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.10.1.tgz#ca08b2b9928a465f6e562d6cc460840340c15d14" + integrity sha512-gmPOLrsjSZWEZlr9Oe5+wWFBq3CG6fN13rGlM91Jsj/vZ95G9CCvrORGBAxMXy0AJGiC83aYiHXn3JzTzXQmbA== + dependencies: + "@whatwg-node/node-fetch" "^0.7.1" + urlpattern-polyfill "^10.0.0" + "@whatwg-node/fetch@^0.9.0", "@whatwg-node/fetch@^0.9.20": version "0.9.21" resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.9.21.tgz#24a08c441126ae2d0f94544e718bdb4a8c2b5ad0" @@ -6432,6 +7242,54 @@ fast-querystring "^1.1.1" tslib "^2.6.3" +"@whatwg-node/node-fetch@^0.7.1": + version "0.7.4" + resolved "https://registry.yarnpkg.com/@whatwg-node/node-fetch/-/node-fetch-0.7.4.tgz#2ad4bb3788e50bbc2b545de03fe5e77afe435a7d" + integrity sha512-rvUtU/xKKl/av5EIwyqfw7w0R+hx+tQrlhpIyFr27MwJRlUb+xcYv97kOmp7FE/WmQ8s+Tb6bcD6W8o/s2pGWw== + dependencies: + "@kamilkisiela/fast-url-parser" "^1.1.4" + "@whatwg-node/disposablestack" "^0.0.5" + busboy "^1.6.0" + fast-querystring "^1.1.1" + tslib "^2.6.3" + +"@whatwg-node/server@^0.9.46", "@whatwg-node/server@^0.9.55": + version "0.9.60" + resolved "https://registry.yarnpkg.com/@whatwg-node/server/-/server-0.9.60.tgz#3bae2aa7304a4d8c18a0c5d064aa3735cbad0ea7" + integrity sha512-JH3eK3aGnBwTT2qQwFrmx6RPXxsjrk99kDWOM98H1aayFMV70nsHIltmyuKRnPmf/avuVRe53bkiu2wsc5Eykw== + dependencies: + "@whatwg-node/disposablestack" "^0.0.5" + "@whatwg-node/fetch" "^0.10.0" + tslib "^2.6.3" + +"@wry/caches@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@wry/caches/-/caches-1.0.1.tgz#8641fd3b6e09230b86ce8b93558d44cf1ece7e52" + integrity sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA== + dependencies: + tslib "^2.3.0" + +"@wry/context@^0.7.0": + version "0.7.4" + resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.7.4.tgz#e32d750fa075955c4ab2cfb8c48095e1d42d5990" + integrity sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ== + dependencies: + tslib "^2.3.0" + +"@wry/equality@^0.5.6": + version "0.5.7" + resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.5.7.tgz#72ec1a73760943d439d56b7b1e9985aec5d497bb" + integrity sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw== + dependencies: + tslib "^2.3.0" + +"@wry/trie@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.5.0.tgz#11e783f3a53f6e4cd1d42d2d1323f5bc3fa99c94" + integrity sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA== + dependencies: + tslib "^2.3.0" + JSONStream@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -6440,6 +7298,16 @@ JSONStream@^1.3.5: jsonparse "^1.2.0" through ">=2.2.7 <3" +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +abbrev@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-2.0.0.tgz#cf59829b8b4f03f89dda2771cb7f3653828c89bf" + integrity sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ== + abitype@1.0.6, abitype@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.6.tgz#76410903e1d88e34f1362746e2d407513c38565b" @@ -6494,6 +7362,13 @@ agent-base@^7.0.2, agent-base@^7.1.0: dependencies: debug "^4.3.4" +agent-base@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317" + integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA== + dependencies: + debug "^4.3.4" + aggregate-error@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" @@ -6502,6 +7377,23 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" +ajv-formats@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-3.0.1.tgz#3d5dc762bca17679c3c2ea7e90ad6b7532309578" + integrity sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ== + dependencies: + ajv "^8.0.0" + +ajv@^8.0.0, ajv@^8.10.0, ajv@^8.12.0: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + ajv@^8.0.1, ajv@^8.11.0: version "8.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" @@ -6609,11 +7501,29 @@ anymatch@^3.1.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +"aproba@^1.0.3 || ^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== + arch@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== +are-we-there-yet@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz#372e0e7bd279d8e94c653aaa1f67200884bf3e1c" + integrity sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw== + dependencies: + delegates "^1.0.0" + readable-stream "^3.6.0" + +are-we-there-yet@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-4.0.2.tgz#aed25dd0eae514660d49ac2b2366b175c614785a" + integrity sha512-ncSWAawFhKMJDTdoAeOV+jyW1VCMj5QIAwULIBV0SSR7B/RLPPEQiknKcg/RIIZlUQrxELpsxMiTUoAQ4sIUyg== + arg@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c" @@ -7239,6 +8149,24 @@ cac@^6.7.14: resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== +cacache@^18.0.0: + version "18.0.4" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-18.0.4.tgz#4601d7578dadb59c66044e157d02a3314682d6a5" + integrity sha512-B+L5iIa9mgcjLbliir2th36yEwPftrzteHYujzsx3dFP/31GCHcIeS8f5MGd80odLOjaOvSpU3EEAmRQptkxLQ== + dependencies: + "@npmcli/fs" "^3.1.0" + fs-minipass "^3.0.0" + glob "^10.2.2" + lru-cache "^10.0.1" + minipass "^7.0.3" + minipass-collect "^2.0.1" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + p-map "^4.0.0" + ssri "^10.0.0" + tar "^6.1.11" + unique-filename "^3.0.0" + call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.4, call-bind@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" @@ -7421,6 +8349,22 @@ chalk@^5.3.0: resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== +change-case-all@1.0.14: + version "1.0.14" + resolved "https://registry.yarnpkg.com/change-case-all/-/change-case-all-1.0.14.tgz#bac04da08ad143278d0ac3dda7eccd39280bfba1" + integrity sha512-CWVm2uT7dmSHdO/z1CXT/n47mWonyypzBbuCy5tN7uMg22BsfkhwT6oHmFCAk+gL1LOOxhdbB9SZz3J1KTY3gA== + dependencies: + change-case "^4.1.2" + is-lower-case "^2.0.2" + is-upper-case "^2.0.2" + lower-case "^2.0.2" + lower-case-first "^2.0.2" + sponge-case "^1.0.1" + swap-case "^2.0.2" + title-case "^3.0.3" + upper-case "^2.0.2" + upper-case-first "^2.0.2" + change-case-all@1.0.15: version "1.0.15" resolved "https://registry.yarnpkg.com/change-case-all/-/change-case-all-1.0.15.tgz#de29393167fc101d646cd76b0ef23e27d09756ad" @@ -7548,6 +8492,11 @@ chokidar@^4.0.0: dependencies: readdirp "^4.0.1" +chownr@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" + integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== + chrome-remote-interface@^0.32.1: version "0.32.2" resolved "https://registry.yarnpkg.com/chrome-remote-interface/-/chrome-remote-interface-0.32.2.tgz#4c494b9d074997b45d49137232df48a355189278" @@ -7753,6 +8702,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-support@^1.1.2, color-support@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" + integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== + colord@^2.9.3: version "2.9.3" resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.3.tgz#4f8ce919de456f1d5c1c368c307fe20f3e59fb43" @@ -7900,6 +8854,11 @@ consola@^3.2.3: resolved "https://registry.yarnpkg.com/consola/-/consola-3.2.3.tgz#0741857aa88cfa0d6fd53f1cff0375136e98502f" integrity sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ== +console-control-strings@^1.0.0, console-control-strings@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== + constant-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-3.0.4.tgz#3b84a9aeaf4cf31ec45e6bf5de91bdfb0589faf1" @@ -8062,6 +9021,13 @@ cross-fetch@^4.0.0: dependencies: node-fetch "^2.6.12" +cross-inspect@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cross-inspect/-/cross-inspect-1.0.1.tgz#15f6f65e4ca963cf4cc1a2b5fef18f6ca328712b" + integrity sha512-Pcw1JTvZLSJH83iiGWt6fRcT+BjZlCDRVwYLbUcHzv/CRpB7r0MlSrGbIyQvVSNyGnbt7G4AXuyCiDR3POvZ1A== + dependencies: + tslib "^2.4.0" + cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -8256,7 +9222,7 @@ data-urls@^5.0.0: whatwg-mimetype "^4.0.0" whatwg-url "^14.0.0" -dataloader@^2.2.2: +dataloader@2.2.2, dataloader@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-2.2.2.tgz#216dc509b5abe39d43a9b9d97e6e5e473dfbe3e0" integrity sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g== @@ -8273,6 +9239,11 @@ date-fns@^4.1.0: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-4.1.0.tgz#64b3d83fff5aa80438f5b1a633c2e83b8a1c2d14" integrity sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg== +dayjs@1.11.13: + version "1.11.13" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c" + integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg== + debounce@^1.2.0, debounce@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.1.tgz#38881d8f4166a5c5848020c11827b834bcb3e0a5" @@ -8434,6 +9405,11 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== + denque@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/denque/-/denque-2.1.0.tgz#e93e1a6569fb5e66f16a3c2a2964617d349d6ab1" @@ -8444,6 +9420,11 @@ depd@2.0.0: resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== +dependency-graph@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-1.0.0.tgz#bb5e85aec1310bc13b22dbd76e3196c4ee4c10d2" + integrity sha512-cW3gggJ28HZ/LExwxP2B++aiKxhJXMSIt9K48FOXQkm+vuG5gyatXnLsONRJdzO/7VfjDIiaOOa/bs4l464Lwg== + dependency-graph@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27" @@ -8474,6 +9455,11 @@ detect-libc@^1.0.3: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== +detect-libc@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700" + integrity sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw== + devlop@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018" @@ -8612,7 +9598,12 @@ dotenv@^16.0.0, dotenv@^16.0.1, dotenv@^16.3.1: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== -dset@^3.1.2: +dotenv@^16.0.3: + version "16.4.5" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" + integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== + +dset@^3.1.1, dset@^3.1.2: version "3.1.4" resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.4.tgz#f8eaf5f023f068a036d08cd07dc9ffb7d0065248" integrity sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA== @@ -8708,6 +9699,13 @@ encoding-sniffer@^0.2.0: iconv-lite "^0.6.3" whatwg-encoding "^3.1.1" +encoding@^0.1.13: + version "0.1.13" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" + integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== + dependencies: + iconv-lite "^0.6.2" + end-of-stream@^1.1.0, end-of-stream@^1.4.0, end-of-stream@^1.4.1: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -8748,6 +9746,11 @@ entities@^4.2.0, entities@^4.4.0, entities@^4.5.0: resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== +env-paths@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" + integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== + env-paths@^2.2.0, env-paths@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" @@ -8763,6 +9766,11 @@ erc721a@^4.2.3: resolved "https://registry.yarnpkg.com/erc721a/-/erc721a-4.2.3.tgz#ca6469b0e54afb0f614272c2147dc4cb49ff223f" integrity sha512-0deF0hOOK1XI1Vxv3NKDh2E9sgzRlENuOoexjXRJIRfYCsLlqi9ejl2RF6Wcd9HfH0ldqC03wleQ2WDjxoOUvA== +err-code@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" + integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -9273,6 +10281,11 @@ expect@^29.0.0: jest-message-util "^29.7.0" jest-util "^29.7.0" +exponential-backoff@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" + integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw== + extend@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -9341,6 +10354,19 @@ fast-glob@^3.2.9, fast-glob@^3.3.1, fast-glob@^3.3.2: merge2 "^1.3.0" micromatch "^4.0.4" +fast-json-stringify@^5.16.1: + version "5.16.1" + resolved "https://registry.yarnpkg.com/fast-json-stringify/-/fast-json-stringify-5.16.1.tgz#a6d0c575231a3a08c376a00171d757372f2ca46e" + integrity sha512-KAdnLvy1yu/XrRtP+LJnxbBGrhN+xXu+gt3EUvZhYGKCr3lFHq/7UFJHHFgmJKoqlh6B40bZLEv7w46B0mqn1g== + dependencies: + "@fastify/merge-json-schemas" "^0.1.0" + ajv "^8.10.0" + ajv-formats "^3.0.1" + fast-deep-equal "^3.1.3" + fast-uri "^2.1.0" + json-schema-ref-resolver "^1.0.1" + rfdc "^1.2.0" + fast-querystring@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/fast-querystring/-/fast-querystring-1.1.2.tgz#a6d24937b4fc6f791b4ee31dcb6f53aeafb89f53" @@ -9358,6 +10384,16 @@ fast-safe-stringify@^2.0.6: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== +fast-uri@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-2.4.0.tgz#67eae6fbbe9f25339d5d3f4c4234787b65d7d55e" + integrity sha512-ypuAmmMKInk5q7XcepxlnUWDLWv4GFtaJqAzWKqn62IpQ3pejtr5dTVbt3vwqVaMKmkNR55sTT+CqUKIaT21BA== + +fast-uri@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.3.tgz#892a1c91802d5d7860de728f18608a0573142241" + integrity sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw== + fastest-levenshtein@^1.0.16: version "1.0.16" resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" @@ -9555,6 +10591,11 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +foreach@^2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.6.tgz#87bcc8a1a0e74000ff2bf9802110708cfb02eb6e" + integrity sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg== + foreground-child@^3.1.0, foreground-child@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" @@ -9703,6 +10744,20 @@ fs-merger@^3.2.1: fs-tree-diff "^2.0.1" walk-sync "^2.2.0" +fs-minipass@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" + integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== + dependencies: + minipass "^3.0.0" + +fs-minipass@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-3.0.3.tgz#79a85981c4dc120065e96f62086bf6f9dc26cc54" + integrity sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw== + dependencies: + minipass "^7.0.3" + fs-mkdirp-stream@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-2.0.1.tgz#1e82575c4023929ad35cf69269f84f1a8c973aa7" @@ -9767,6 +10822,42 @@ functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== +gauge@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" + integrity sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q== + dependencies: + aproba "^1.0.3 || ^2.0.0" + color-support "^1.1.2" + console-control-strings "^1.0.0" + has-unicode "^2.0.1" + object-assign "^4.1.1" + signal-exit "^3.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + wide-align "^1.1.2" + +gauge@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-5.0.2.tgz#7ab44c11181da9766333f10db8cd1e4b17fd6c46" + integrity sha512-pMaFftXPtiGIHCJHdcUUx9Rby/rFT/Kkt3fIIGCs+9PMDIljSyRiqraTlxNtBReJRDfUefpa263RQ3vnp5G/LQ== + dependencies: + aproba "^1.0.3 || ^2.0.0" + color-support "^1.1.3" + console-control-strings "^1.1.0" + has-unicode "^2.0.1" + signal-exit "^4.0.1" + string-width "^4.2.3" + strip-ansi "^6.0.1" + wide-align "^1.1.5" + +generate-function@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" + integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ== + dependencies: + is-property "^1.0.2" + gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -9847,6 +10938,13 @@ get-tsconfig@^4.7.5: dependencies: resolve-pkg-maps "^1.0.0" +get-tsconfig@^4.7.6: + version "4.8.1" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.8.1.tgz#8995eb391ae6e1638d251118c7b56de7eb425471" + integrity sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg== + dependencies: + resolve-pkg-maps "^1.0.0" + gifwrap@^0.9.2: version "0.9.4" resolved "https://registry.yarnpkg.com/gifwrap/-/gifwrap-0.9.4.tgz#f4eb6169ba027d61df64aafbdcb1f8ae58ccc0c5" @@ -9935,7 +11033,7 @@ glob@7.2.3, glob@^7.1.1, glob@^7.1.3, glob@^7.1.6, glob@^7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^10.3.10: +glob@^10.2.2, glob@^10.3.10: version "10.4.5" resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== @@ -10052,7 +11150,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.10, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.8, graceful-fs@^4.2.9: +graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.10, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.8, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -10079,6 +11177,23 @@ graphql-config@^5.1.1: string-env-interpolation "^1.0.1" tslib "^2.4.0" +graphql-import-node@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/graphql-import-node/-/graphql-import-node-0.0.5.tgz#caf76a6cece10858b14f27cce935655398fc1bf0" + integrity sha512-OXbou9fqh9/Lm7vwXT0XoRN9J5+WCYKnbiTalgFDvkQERITRmcfncZs6aVABedd5B85yQU5EULS4a5pnbpuI0Q== + +graphql-jit@0.8.7, graphql-jit@^0.8.7: + version "0.8.7" + resolved "https://registry.yarnpkg.com/graphql-jit/-/graphql-jit-0.8.7.tgz#831b1a4c16b1e29cc8ed9d171f33a7da4bce2821" + integrity sha512-KGzCrsxQPfEiXOUIJCexWKiWF6ycjO89kAO6SdO8OWRGwYXbG0hsLuTnbFfMq0gj7d7/ib/Gh7jtst7FHZEEjw== + dependencies: + "@graphql-typed-document-node/core" "^3.2.0" + fast-json-stringify "^5.16.1" + generate-function "^2.3.1" + lodash.memoize "^4.1.2" + lodash.merge "4.6.2" + lodash.mergewith "4.6.2" + graphql-request@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-6.1.0.tgz#f4eb2107967af3c7a5907eb3131c671eac89be4f" @@ -10094,7 +11209,7 @@ graphql-request@^7.0.1: dependencies: "@graphql-typed-document-node/core" "^3.2.0" -graphql-tag@2.12.6, graphql-tag@^2.11.0: +graphql-tag@2.12.6, graphql-tag@^2.11.0, graphql-tag@^2.12.6: version "2.12.6" resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1" integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg== @@ -10106,6 +11221,28 @@ graphql-ws@5.14.0: resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.0.tgz#766f249f3974fc2c48fae0d1fb20c2c4c79cd591" integrity sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g== +graphql-ws@^5.12.1, graphql-ws@^5.14.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.16.0.tgz#849efe02f384b4332109329be01d74c345842729" + integrity sha512-Ju2RCU2dQMgSKtArPbEtsK5gNLnsQyTNIo/T7cZNp96niC1x0KdJNZV0TIoilceBPQwfb5itrGl8pkFeOUMl4A== + +graphql-yoga@^5.7.0: + version "5.10.3" + resolved "https://registry.yarnpkg.com/graphql-yoga/-/graphql-yoga-5.10.3.tgz#bc51b32730b6f033e45707cbc6460b53cc5b8576" + integrity sha512-TE6tFvWvD6LHy1v0hleEnftla5Oo2plgat/r8yHcUSS0Qqb+5fb/eHlthNAi+81gFziHc1mUE5w8PqMjBL5/eA== + dependencies: + "@envelop/core" "^5.0.1" + "@graphql-tools/executor" "^1.3.3" + "@graphql-tools/schema" "^10.0.4" + "@graphql-tools/utils" "^10.3.2" + "@graphql-yoga/logger" "^2.0.0" + "@graphql-yoga/subscription" "^5.0.1" + "@whatwg-node/fetch" "^0.10.1" + "@whatwg-node/server" "^0.9.55" + dset "^3.1.1" + lru-cache "^10.0.0" + tslib "^2.5.2" + graphql@16.9.0: version "16.9.0" resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.9.0.tgz#1c310e63f16a49ce1fbb230bd0a000e99f6f115f" @@ -10415,6 +11552,11 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" +has-unicode@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== + has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -10585,6 +11727,11 @@ http-basic@^8.1.1: http-response-object "^3.0.1" parse-cache-control "^1.0.1" +http-cache-semantics@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" + integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== + http-errors@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" @@ -10624,7 +11771,7 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -https-proxy-agent@^7.0.0, https-proxy-agent@^7.0.5: +https-proxy-agent@^7.0.0, https-proxy-agent@^7.0.1, https-proxy-agent@^7.0.5: version "7.0.5" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz#9e8b5013873299e11fab6fd548405da2d6c602b2" integrity sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw== @@ -10684,7 +11831,7 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@0.6.3, iconv-lite@^0.6.3: +iconv-lite@0.6.3, iconv-lite@^0.6.2, iconv-lite@^0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== @@ -10729,6 +11876,11 @@ img-diff-js@0.5.4: pixelmatch "^5.2.1" pngjs "^7.0.0" +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== + immutable@^4.0.0-rc.12: version "4.3.4" resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f" @@ -10884,6 +12036,14 @@ ioredis@^5.3.2: redis-parser "^3.0.0" standard-as-callback "^2.1.0" +ip-address@^9.0.5: + version "9.0.5" + resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a" + integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g== + dependencies: + jsbn "1.1.0" + sprintf-js "^1.1.3" + iron-webcrypto@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/iron-webcrypto/-/iron-webcrypto-1.0.0.tgz#e3b689c0c61b434a0a4cb82d0aeabbc8b672a867" @@ -11022,6 +12182,11 @@ is-interactive@^1.0.0: resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== +is-lambda@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" + integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== + is-lower-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-lower-case/-/is-lower-case-2.0.2.tgz#1c0884d3012c841556243483aa5d522f47396d2a" @@ -11091,6 +12256,11 @@ is-potential-custom-element-name@^1.0.1: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== +is-property@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + integrity sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g== + is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -11194,7 +12364,7 @@ is-windows@^1.0.0, is-windows@^1.0.1: resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -is-wsl@^2.2.0: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== @@ -11433,6 +12603,11 @@ jsbi@^3.1.4: resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ== +jsbn@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" + integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A== + jsdoc-type-pratt-parser@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz#ff6b4a3f339c34a6c188cbf50a16087858d22113" @@ -11470,6 +12645,11 @@ jsesc@^3.0.2: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== +json-bigint-patch@^0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/json-bigint-patch/-/json-bigint-patch-0.0.8.tgz#45d954da1f21c6d4f3ae9ef64c9ac227cd0ab0fe" + integrity sha512-xa0LTQsyaq8awYyZyuUsporWisZFiyqzxGW8CKM3t7oouf0GFAKYJnqAm6e9NLNBQOCtOLvy614DEiRX/rPbnA== + json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" @@ -11485,6 +12665,13 @@ json-parse-even-better-errors@^4.0.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-4.0.0.tgz#d3f67bd5925e81d3e31aa466acc821c8375cec43" integrity sha512-lR4MXjGNgkJc7tkQ97kb2nuEMnNCyU//XYVH0MKTGcXEiSudQ5MKGKen3C5QubYy0vmq+JGitUg92uuywGEwIA== +json-pointer@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/json-pointer/-/json-pointer-0.6.2.tgz#f97bd7550be5e9ea901f8c9264c9d436a22a93cd" + integrity sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw== + dependencies: + foreach "^2.0.4" + json-rpc-engine@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-6.1.0.tgz#bf5ff7d029e1c1bf20cb6c0e9f348dcd8be5a393" @@ -11498,6 +12685,13 @@ json-rpc-random-id@^1.0.0, json-rpc-random-id@^1.0.1: resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" integrity sha512-RJ9YYNCkhVDBuP4zN5BBtYAzEl03yq/jIIsyif0JY9qyJuQQZNeDK7anAPKKlyEtLSj2s8h6hNh2F8zO5q7ScA== +json-schema-ref-resolver@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-schema-ref-resolver/-/json-schema-ref-resolver-1.0.1.tgz#6586f483b76254784fc1d2120f717bdc9f0a99bf" + integrity sha512-EJAj1pgHc1hxF6vo2Z3s69fMjO1INq6eGHXZ8Z6wCQeldCuwxGK9Sxf4/cScGn3FZubCVUehfWtcDM/PLteCQw== + dependencies: + fast-deep-equal "^3.1.3" + json-schema-traverse@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" @@ -11639,6 +12833,13 @@ level@^8.0.0: browser-level "^1.0.1" classic-level "^1.2.0" +lie@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw== + dependencies: + immediate "~3.0.5" + lilconfig@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" @@ -11730,6 +12931,13 @@ load-bmfont@^1.3.1: xhr "^2.0.1" xtend "^4.0.0" +localforage@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" + integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== + dependencies: + lie "3.1.1" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -11774,6 +12982,11 @@ lodash.defaults@^4.2.0: resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" integrity sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ== +lodash.get@4.4.2, lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + lodash.invoke@^4.5.2: version "4.5.2" resolved "https://registry.yarnpkg.com/lodash.invoke/-/lodash.invoke-4.5.2.tgz#01ca07e470903affa3ffec7ad2ed22723d2f697c" @@ -11804,12 +13017,17 @@ lodash.kebabcase@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" integrity sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g== -lodash.merge@^4.6.2: +lodash.memoize@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" + integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== + +lodash.merge@4.6.2, lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.mergewith@^4.6.2: +lodash.mergewith@4.6.2, lodash.mergewith@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== @@ -11829,6 +13047,11 @@ lodash.startcase@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" integrity sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg== +lodash.topath@^4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/lodash.topath/-/lodash.topath-4.5.2.tgz#3616351f3bba61994a0931989660bd03254fd009" + integrity sha512-1/W4dM+35DwvE/iEd1M9ekewOSTlpFekhw9mhAtrwjVqUr83/ilQiyAvmg4tVX7Unkcfl1KC+i9WdaT4B6aQcg== + lodash.truncate@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" @@ -11900,6 +13123,11 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" +lru-cache@^10.0.0, lru-cache@^10.0.1: + version "10.4.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + lru-cache@^10.0.2, "lru-cache@^9.1.1 || ^10.0.0": version "10.1.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" @@ -11977,7 +13205,7 @@ magicast@^0.3.5: "@babel/types" "^7.25.4" source-map-js "^1.2.0" -make-dir@3.1.0, make-dir@^3.0.0: +make-dir@3.1.0, make-dir@^3.0.0, make-dir@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== @@ -11991,6 +13219,24 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" +make-fetch-happen@^13.0.0: + version "13.0.1" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-13.0.1.tgz#273ba2f78f45e1f3a6dca91cede87d9fa4821e36" + integrity sha512-cKTUFc/rbKUd/9meOvgrpJ2WrNzymt6jfRDdwg5UCnVzv9dTpEj9JS5m3wtziXVCjluIXyL8pcaukYqezIzZQA== + dependencies: + "@npmcli/agent" "^2.0.0" + cacache "^18.0.0" + http-cache-semantics "^4.1.1" + is-lambda "^1.0.1" + minipass "^7.0.2" + minipass-fetch "^3.0.0" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + negotiator "^0.6.3" + proc-log "^4.2.0" + promise-retry "^2.0.1" + ssri "^10.0.0" + map-cache@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -12501,21 +13747,80 @@ minimist@^1.2.5, minimist@^1.2.6, minimist@^1.2.7, minimist@^1.2.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +minipass-collect@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-2.0.1.tgz#1621bc77e12258a12c60d34e2276ec5c20680863" + integrity sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw== + dependencies: + minipass "^7.0.3" + +minipass-fetch@^3.0.0: + version "3.0.5" + resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-3.0.5.tgz#f0f97e40580affc4a35cc4a1349f05ae36cb1e4c" + integrity sha512-2N8elDQAtSnFV0Dk7gt15KHsS0Fyz6CbYZ360h0WTYV1Ty46li3rAXVOQj1THMNLdmrD9Vt5pBPtWtVkpwGBqg== + dependencies: + minipass "^7.0.3" + minipass-sized "^1.0.3" + minizlib "^2.1.2" + optionalDependencies: + encoding "^0.1.13" + +minipass-flush@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" + integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== + dependencies: + minipass "^3.0.0" + +minipass-pipeline@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" + integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== + dependencies: + minipass "^3.0.0" + +minipass-sized@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/minipass-sized/-/minipass-sized-1.0.3.tgz#70ee5a7c5052070afacfbc22977ea79def353b70" + integrity sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g== + dependencies: + minipass "^3.0.0" + +minipass@^3.0.0: + version "3.3.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" + integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== + dependencies: + yallist "^4.0.0" + minipass@^4.2.4: version "4.2.8" resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.8.tgz#f0010f64393ecfc1d1ccb5f582bcaf45f48e1a3a" integrity sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ== +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + "minipass@^5.0.0 || ^6.0.2 || ^7.0.0": version "7.0.2" resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.2.tgz#58a82b7d81c7010da5bd4b2c0c85ac4b4ec5131e" integrity sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA== -minipass@^7.1.2: +minipass@^7.0.2, minipass@^7.0.3, minipass@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== +minizlib@^2.1.1, minizlib@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" + integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== + dependencies: + minipass "^3.0.0" + yallist "^4.0.0" + mipd@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mipd/-/mipd-0.0.7.tgz#bb5559e21fa18dc3d9fe1c08902ef14b7ce32fd9" @@ -12528,11 +13833,16 @@ mkdirp@^0.5.1: dependencies: minimist "^1.2.6" -mkdirp@^1.0.4: +mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mkdirp@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" + integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== + mktemp@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/mktemp/-/mktemp-0.4.0.tgz#6d0515611c8a8c84e484aa2000129b98e981ff0b" @@ -12657,6 +13967,11 @@ mz@^2.7.0: object-assign "^4.0.1" thenify-all "^1.0.0" +nan@2.18.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" + integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== + nanoid@3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" @@ -12682,6 +13997,11 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== +negotiator@^0.6.3: + version "0.6.4" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.4.tgz#777948e2452651c570b712dd01c23e262713fff7" + integrity sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w== + neo-async@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" @@ -12760,11 +14080,40 @@ node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.4.0.tgz#42e99687ce87ddeaf3a10b99dc06abc11021f3f4" integrity sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ== +node-gyp@10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-10.0.1.tgz#205514fc19e5830fa991e4a689f9e81af377a966" + integrity sha512-gg3/bHehQfZivQVfqIyy8wTdSymF9yTyP4CJifK73imyNMU8AIGQE2pUa7dNWfmMeG9cDVF2eehiRMv0LC1iAg== + dependencies: + env-paths "^2.2.0" + exponential-backoff "^3.1.1" + glob "^10.3.10" + graceful-fs "^4.2.6" + make-fetch-happen "^13.0.0" + nopt "^7.0.0" + proc-log "^3.0.0" + semver "^7.3.5" + tar "^6.1.2" + which "^4.0.0" + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== +node-libcurl@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/node-libcurl/-/node-libcurl-4.0.0.tgz#57568c3f7c08a76e822994d2b674d4dd56752127" + integrity sha512-v+u+OgSq6ldvf8MrdjieAy/mv8WeTN94nrTomh62zhItF2HH0Ckin/QEqs8+35DWyYrE5nBM2480UtWVXktzbQ== + dependencies: + "@mapbox/node-pre-gyp" "1.0.11" + env-paths "2.2.0" + nan "2.18.0" + node-gyp "10.0.1" + npmlog "7.0.1" + rimraf "5.0.5" + tslib "2.6.2" + node-releases@^2.0.18: version "2.0.18" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" @@ -12793,6 +14142,20 @@ noop-ts@^1.0.6: resolved "https://registry.yarnpkg.com/noop-ts/-/noop-ts-1.0.7.tgz#e2fc3a9ef4285de429c36157b33f1248d41257f4" integrity sha512-V+WINJ3emVSmNk8InTpOv7uAmCH5b/0ZGApMLncnh0hdBBFTDC11ZyisOat0FHK89QlFn1Ycb6Uz9sLI/wqf1g== +nopt@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" + integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ== + dependencies: + abbrev "1" + +nopt@^7.0.0: + version "7.2.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-7.2.1.tgz#1cac0eab9b8e97c9093338446eddd40b2c8ca1e7" + integrity sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w== + dependencies: + abbrev "^2.0.0" + normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -12875,6 +14238,26 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +npmlog@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-7.0.1.tgz#7372151a01ccb095c47d8bf1d0771a4ff1f53ac8" + integrity sha512-uJ0YFk/mCQpLBt+bxN88AKd+gyqZvZDbtiNxk6Waqcj2aPRyfVx8ITawkyQynxUagInjdYT1+qj4NfA5KJJUxg== + dependencies: + are-we-there-yet "^4.0.0" + console-control-strings "^1.1.0" + gauge "^5.0.0" + set-blocking "^2.0.0" + +npmlog@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-5.0.1.tgz#f06678e80e29419ad67ab964e0fa69959c1eb8b0" + integrity sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw== + dependencies: + are-we-there-yet "^2.0.0" + console-control-strings "^1.1.0" + gauge "^3.0.0" + set-blocking "^2.0.0" + nth-check@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" @@ -12911,6 +14294,11 @@ object-hash@^3.0.0: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== +object-inspect@1.13.2: + version "1.13.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" + integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== + object-inspect@^1.13.1, object-inspect@^1.9.0: version "1.13.1" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" @@ -12979,6 +14367,14 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" +open@^7.4.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + open@^8.0.0, open@^8.0.4, open@^8.4.0: version "8.4.2" resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" @@ -12988,6 +14384,16 @@ open@^8.0.0, open@^8.0.4, open@^8.4.0: is-docker "^2.1.1" is-wsl "^2.2.0" +optimism@^0.18.0: + version "0.18.1" + resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.18.1.tgz#5cf16847921413dbb0ac809907370388b9c6335f" + integrity sha512-mLXNwWPa9dgFyDqkNi54sjDyNJ9/fTI6WGBLgnXku1vdKY/jovHfZT5r+aiVeFFLOz+foPNOm5YJ4mqgld2GBQ== + dependencies: + "@wry/caches" "^1.0.0" + "@wry/context" "^0.7.0" + "@wry/trie" "^0.5.0" + tslib "^2.3.0" + ora@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" @@ -13244,6 +14650,11 @@ pascal-case@^3.1.2: no-case "^3.0.4" tslib "^2.0.3" +path-browserify@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== + path-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/path-case/-/path-case-3.0.4.tgz#9168645334eb942658375c56f80b4c0cb5f82c6f" @@ -13686,6 +15097,16 @@ pretty-format@^29.0.0, pretty-format@^29.7.0: ansi-styles "^5.0.0" react-is "^18.0.0" +proc-log@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-3.0.0.tgz#fb05ef83ccd64fd7b20bbe9c8c1070fc08338dd8" + integrity sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A== + +proc-log@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-4.2.0.tgz#b6f461e4026e75fdfe228b265e9f7a00779d7034" + integrity sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA== + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -13711,6 +15132,14 @@ promise-map-series@^0.3.0: resolved "https://registry.yarnpkg.com/promise-map-series/-/promise-map-series-0.3.0.tgz#41873ca3652bb7a042b387d538552da9b576f8a1" integrity sha512-3npG2NGhTc8BWBolLLf8l/92OxMGaRLbqvIh9wjCHhDXNvk4zsxaTaCpiCunW09qWPrN2zeNSNwRLVBrQQtutA== +promise-retry@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" + integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== + dependencies: + err-code "^2.0.2" + retry "^0.12.0" + promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" @@ -14440,6 +15869,11 @@ regexp.prototype.flags@^1.5.1: define-properties "^1.2.0" set-function-name "^2.0.0" +rehackt@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/rehackt/-/rehackt-0.1.0.tgz#a7c5e289c87345f70da8728a7eb878e5d03c696b" + integrity sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw== + relay-runtime@12.0.0: version "12.0.0" resolved "https://registry.yarnpkg.com/relay-runtime/-/relay-runtime-12.0.0.tgz#1e039282bdb5e0c1b9a7dc7f6b9a09d4f4ff8237" @@ -14567,6 +16001,11 @@ resolve@^1.1.7, resolve@^1.10.0, resolve@^1.19.0, resolve@^1.22.1, resolve@^1.22 path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +response-iterator@^0.2.6: + version "0.2.6" + resolved "https://registry.yarnpkg.com/response-iterator/-/response-iterator-0.2.6.tgz#249005fb14d2e4eeb478a3f735a28fd8b4c9f3da" + integrity sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw== + restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -14590,11 +16029,23 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +rfdc@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca" + integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== + rfdc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== +rimraf@5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.5.tgz#9be65d2d6e683447d2e9013da2bf451139a61ccf" + integrity sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A== + dependencies: + glob "^10.3.7" + rimraf@^2.2.8, rimraf@^2.5.4: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -14616,7 +16067,7 @@ rimraf@^5.0.1, rimraf@^5.0.5: dependencies: glob "^10.3.7" -rimraf@^6.0.1: +rimraf@^6.0.0, rimraf@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-6.0.1.tgz#ffb8ad8844dd60332ab15f52bc104bc3ed71ea4e" integrity sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A== @@ -15012,6 +16463,11 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +smart-buffer@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" + integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== + snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" @@ -15038,6 +16494,23 @@ socket.io-parser@~4.2.4: "@socket.io/component-emitter" "~3.1.0" debug "~4.3.1" +socks-proxy-agent@^8.0.3: + version "8.0.4" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz#9071dca17af95f483300316f4b063578fa0db08c" + integrity sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw== + dependencies: + agent-base "^7.1.1" + debug "^4.3.4" + socks "^2.8.3" + +socks@^2.8.3: + version "2.8.3" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.8.3.tgz#1ebd0f09c52ba95a09750afe3f3f9f724a800cb5" + integrity sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw== + dependencies: + ip-address "^9.0.5" + smart-buffer "^4.2.0" + solc@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" @@ -15169,11 +16642,23 @@ sprintf-js@^1.1.1: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673" integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug== +sprintf-js@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a" + integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== +ssri@^10.0.0: + version "10.0.6" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-10.0.6.tgz#a8aade2de60ba2bce8688e3fa349bad05c7dc1e5" + integrity sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ== + dependencies: + minipass "^7.0.3" + stack-utils@^2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" @@ -15260,7 +16745,7 @@ string-format@^2.0.0: resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: 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== @@ -15277,15 +16762,6 @@ string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: - 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-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -15336,7 +16812,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", 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== @@ -15350,13 +16826,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.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-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -15639,6 +17108,11 @@ swap-case@^2.0.2: dependencies: tslib "^2.0.3" +symbol-observable@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-4.0.0.tgz#5b425f192279e87f2f9b937ac8540d1984b39205" + integrity sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ== + symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -15719,6 +17193,18 @@ tailwindcss@^3.3.3: resolve "^1.22.8" sucrase "^3.35.0" +tar@^6.1.11, tar@^6.1.2: + version "6.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" + integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^5.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + teex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/teex/-/teex-1.0.1.tgz#b8fa7245ef8e8effa8078281946c85ab780a0b12" @@ -15824,6 +17310,11 @@ tiny-invariant@^1.3.3: resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.3.tgz#46680b7a873a0d5d10005995eb90a70d74d60127" integrity sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg== +tiny-lru@^11.0.0: + version "11.2.11" + resolved "https://registry.yarnpkg.com/tiny-lru/-/tiny-lru-11.2.11.tgz#5089a6a4a157f5a97b82aa930b44d550ac5c4778" + integrity sha512-27BIW0dIWTYYoWNnqSmoNMKe5WIbkXsc0xaCQHd3/3xT2XMuMJrzHdrO9QBFR14emBz1Bu0dOAs2sCBBrvgPQA== + tiny-warning@^1.0.2, tiny-warning@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" @@ -16007,6 +17498,13 @@ ts-interface-checker@^0.1.9: resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== +ts-invariant@^0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.10.3.tgz#3e048ff96e91459ffca01304dbc7f61c1f642f6c" + integrity sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ== + dependencies: + tslib "^2.1.0" + ts-log@^2.2.3: version "2.2.5" resolved "https://registry.yarnpkg.com/ts-log/-/ts-log-2.2.5.tgz#aef3252f1143d11047e2cb6f7cfaac7408d96623" @@ -16031,20 +17529,25 @@ tslib@1.14.1, tslib@^1.11.1, tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@2.6.2, tslib@~2.6.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.3: version "2.7.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== -tslib@^2.6.0: +tslib@^2.3.0, tslib@^2.5.2, tslib@^2.6.0: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== -tslib@~2.6.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== +tslib@~2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" + integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== tsort@0.0.1: version "0.0.1" @@ -16223,6 +17726,11 @@ typescript@^5.0.4, typescript@^5.1.6, typescript@^5.4.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== +typescript@^5.4.2: + version "5.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6" + integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg== + typical@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" @@ -16233,6 +17741,10 @@ typical@^5.2.0: resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== +"uWebSockets.js@uNetworking/uWebSockets.js#semver:^20": + version "20.51.0" + resolved "https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/6609a88ffa9a16ac5158046761356ce03250a0df" + ua-parser-js@^0.7.30: version "0.7.35" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.35.tgz#8bda4827be4f0b1dda91699a29499575a1f1d307" @@ -16346,6 +17858,20 @@ unified@^11.0.0: trough "^2.0.0" vfile "^6.0.0" +unique-filename@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-3.0.0.tgz#48ba7a5a16849f5080d26c760c86cf5cf05770ea" + integrity sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g== + dependencies: + unique-slug "^4.0.0" + +unique-slug@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-4.0.0.tgz#6bae6bb16be91351badd24cdce741f892a6532e3" + integrity sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ== + dependencies: + imurmurhash "^0.1.4" + unist-util-is@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-6.0.0.tgz#b775956486aff107a9ded971d996c173374be424" @@ -16972,6 +18498,13 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" +which@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/which/-/which-4.0.0.tgz#cd60b5e74503a3fbcfbf6cd6b4138a8bae644c1a" + integrity sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg== + dependencies: + isexe "^3.1.1" + which@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/which/-/which-5.0.0.tgz#d93f2d93f79834d4363c7d0c23e00d07c466c8d6" @@ -16987,6 +18520,13 @@ why-is-node-running@^2.3.0: siginfo "^2.0.0" stackback "0.0.2" +wide-align@^1.1.2, wide-align@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" + integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== + dependencies: + string-width "^1.0.2 || 2 || 3 || 4" + widest-line@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" @@ -17012,7 +18552,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -17030,15 +18570,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -17071,7 +18602,7 @@ ws@8.13.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== -ws@8.18.0, ws@^8.12.0, ws@^8.18.0, ws@^8.2.3: +ws@8.18.0, ws@^8.12.0, ws@^8.17.0, ws@^8.17.1, ws@^8.18.0, ws@^8.2.3: version "8.18.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== @@ -17288,7 +18819,7 @@ yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^17.0.0, yargs@^17.5.1, yargs@^17.7.2: +yargs@^17.0.0, yargs@^17.5.1, yargs@^17.7.1, yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== @@ -17321,6 +18852,18 @@ yup@^1.2.0: toposort "^2.0.2" type-fest "^2.19.0" +zen-observable-ts@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz#6c6d9ea3d3a842812c6e9519209365a122ba8b58" + integrity sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg== + dependencies: + zen-observable "0.8.15" + +zen-observable@0.8.15: + version "0.8.15" + resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" + integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== + zksync-ethers@^5.0.0: version "5.9.2" resolved "https://registry.yarnpkg.com/zksync-ethers/-/zksync-ethers-5.9.2.tgz#1c5f34cb25ac0b040fd1a6118f2ba1c2c3bda090"