From 9611a4b552da77b7fb806a233cc319abb8328d9b Mon Sep 17 00:00:00 2001 From: Nicolas Brugneaux Date: Tue, 11 Jul 2023 14:55:22 +0200 Subject: [PATCH] Stcelo front-end V2 (#133) * Components for New Features (#105) * Add LinkOut Component Add Purple Caret Icon * Add Pill Component * Add Row Component (list item) * temp create a library page to view Components on --------- Co-authored-by: Aaron * Dependency Upgrades (#106) * upgrade to latest versions of react celo Adds support for wallet connect v2 and drops support for v1 * add "dark" to body so react-celo modal is also in dark mode note theme is set in a provider below the CeloProvider so this seemed simpler than moving components around --------- Co-authored-by: Aaron * chore: ran npx update-browserslist-db@latest * refactor: navigation (#108) * refactor: navigation * fix: remove unused mode * refactor: make pages routing clearer * fix: slug could be undefined * fix: remove unecessary ga interactions * Validator Selection Feature part 1 (#109) * add validatorGroupRow component * remove margin from row as spacing should be handled by parent padding and gap lists should be lists --------- Co-authored-by: Aaron * Refactor onModeChange to be non duplicated (#110) * remove duplicated interfaces and methods relating to changing the current mode * remove duplicated mode change code * clean up path * removed to much --------- Co-authored-by: Aaron * use StakedCelo as the app name everywhere (#107) Co-authored-by: Aaron * feat: add governance layout and detail page (#111) * feat: add governance layout and detail page * fix: governanceProps * feat: styling * feat: show past proposals * chore: PR review feedback * Fetch Validator Groups (#113) * Fetch Validator Groups (no filtering yet) * add info about exactly what will be filtered * add graph request for querying block explorer for validators * fetech validators groups for correct chain add celo explorer graphql endpoints * removing as React celo now does switch the network even after changing chain 10 times. * move to components directory and fix issue when name is undefined * clean url means celo main * remove commented out code * prepare for merge * review suggestion: name is falsey unless its at least once char * chainId in query across all pages so links work nicer * fix infinite loop now that its on multiple pages --------- Co-authored-by: Aaron * Validator Group Page (#114) * fetch validator group name from chain. Details => Show page Validators => List Page Move ValidatorGroupRow to components folder * Add Validator Show Page / Selection respond 404 if address is invalid move components shared between features to top components directory getGroupName returns Default Strategy for address 0 add react-use-async-callback for better dev-ex * change language * Fix links * fix overflows on long group names remove background where its not needed dont display zeros * fix back link * show the back button even while loading or erroring. * abstract out reusable connect button allow Valdiator Group and Proposal Detail pages to be viewed without being logged in. name Show Page back to Details Page for consistency * more detail to show row / group is currently highlighted link address to explorer show more of address when it is used as name * rename useQueryStringFor chain to a less confusing name * fix typo --------- Co-authored-by: Aaron * Contracts + Contract Types + Blockchain Context (#115) * add status label to governance proposals and center spinner * refactor: make useBlockchain reference to a Context so contracts are only created once in the app rather than once per component. add typechain so StCelo contracts are properly typed add early returns when things are not loaded yet * constants dont need to be prefixed with `NEXT_PUBLIC` that is for secrets kept in .env files that you want to be viewale on browser. having it here jut adds noise add ABIs for GroupHealth, Vote and SpecificGroupStategy * Manger Contract v2 beta * comment out useWithdrawal for now as managr.getGroups is no longer a method --------- Co-authored-by: Aaron * add in transitions between pages (good for waiting for serverside data) (#119) update Names of featues Co-authored-by: Aaron * Select Group + Current Selected Group First (#116) * get current strategy, + sort so its on top select strategy, (including toast message) dont use hooks directly use thru accountContext default to dark mode in css (already defaults to this anyway but only after first render) * reload strategy when its changed --------- Co-authored-by: Aaron * add/update alfajores contract addresses (#120) Co-authored-by: Aaron * trying out gathering proposals serverside (like validator groups) (#118) * trying out gathering proposals serverside (like validator groups) * fix dup proposal types * remove hook as all fetching and processing has been moved to backend * ensure proposals dont have any Bignumbers and can be jsonified * only get markdown for proposals we actually use * sort proposals so most recent are first * dont use upvotes so why send em * fix type --------- Co-authored-by: Aaron * Group filtering (#121) * WIP Nfilter groups by health and block status. & get actually addresses for contracts. Adds multicall to reduce number of requests to blockchain. * block parameter for multicall is the one we are looking up data for not the one the contract was created. --------- Co-authored-by: Aaron * parsed yaml was missing from individual page json (#122) Co-authored-by: Aaron * Feat/governance voting (#124) * perf: optimize getting all proposals * feat: vote for proposal * chore: address feedback * feat: remove unused code * fix: type * fix: use proper vote weight * Voter History (#130) * fixes incorrect contract address and infinite router issue on page load * show st celo holders how they voted for proposals --------- Co-authored-by: Aaron * Mainfest.json for safe app support (#131) * follows https://docs.safe.global/learn/safe-apps/releasing-your-safe-app to make stcelo safe compatible. fixes https://github.com/celo-org/staked-celo-web-app/issues/128 * setup cors for mainfest.json * typo --------- Co-authored-by: Aaron Co-authored-by: Nicolas Brugneaux * chore: add bundle analyzer in gh actions (#132) * Rainbowkit+viem migration (#129) * wip: rainbowkit * feat: use @celo/rainbowkit beta * refactor: chain imports * chore: update rainbowkit-celo to 1.0.0 * feat: multicalls with viem * chore: remove ts-expect-errors * test * feat: add tx modal to governance and fix validators not closing it * types * fix all types * follows https://docs.safe.global/learn/safe-apps/releasing-your-safe-app to make stcelo safe compatible. fixes https://github.com/celo-org/staked-celo-web-app/issues/128 * setup cors for mainfest.json * fix get logs * ignore ts error * fix redirection * typo * chore: remove web3 * chore: review feedback * chore: remove unused types * chore: bundle analyzer * refactor: wagmi hooks! * refactor: use useblockchain properly * refactor: remove big file * fix: possible undefined pendingWithdrawals * refactor: use `enabled` pattern * fix: possible undefined loadPendingWithdrawals * fix: type * fix: wrong args * chore: attempt at speeding up liting * fix: possibly undefined variable * chore: attempt at speeding up liting * fix: use cp instead of ln * fix: bit safer * fix: handle errors better * chore: remove unused consts * refactor: pr review * refactor: use walletconnect project id * chore: remove unused type * feat: add placeholder plage in case contracts aren't deployed * feat: copy changes * fix: remove unused variable * chore: upgrade deps * feat: upgrade to rainbowkit 1.0.3 and celo/abis 9.0.6 * chore: upgrade rainbowkit-celo * chore: upgrade rainbowkit and deps * chore: upgrade rainbowkit-celo * chore: projectid??? * chore: idk what is happening at this stage * fix: 100% cpu * fix: use import Router * fix: reverse mainnet and testnet due to a bug in wagmi+wcv2 * chore: force @wagmi/connectors to be ^2.6.4 * fix: attempt yet again a new project id * fix: remove minimization * Revert "fix: attempt yet again a new project id" This reverts commit 6d63eff27a0f3d8b2395f874029790922470eaea. * fix: reenable minification without swc --------- Co-authored-by: Aaron * fix: merge conflict * feat: add back the withdrawal bot (#142) * feat: add back the withdrawal bot * fix: useState deps * fix: PR review * refactor: clearer naming * feat: wording * fix: borken layout --------- Co-authored-by: Aaron DeRuvo Co-authored-by: Aaron Co-authored-by: Aaron DeRuvo --- .gitignore | 1 + .vscode/settings.json | 3 + next.config.js | 5 +- package.json | 30 +- public/site.webmanifest | 30 +- src/blockchain/ABIs/Account.ts | 893 +++++++++ src/blockchain/ABIs/DefaultGroupStrategy.json | 880 +++++++++ src/blockchain/ABIs/DefaultGroupStrategy.ts | 882 +++++++++ src/blockchain/ABIs/GroupHealth.json | 298 +++ src/blockchain/ABIs/GroupHealth.ts | 300 +++ src/blockchain/ABIs/Manager.json | 436 ++++- src/blockchain/ABIs/Manager.ts | 758 ++++++++ .../ABIs/SpecificGroupStrategy.json | 782 ++++++++ src/blockchain/ABIs/SpecificGroupStrategy.ts | 784 ++++++++ src/blockchain/ABIs/StakedCelo.ts | 535 ++++++ src/blockchain/ABIs/Vote.json | 714 +++++++ src/blockchain/ABIs/Vote.ts | 716 +++++++ src/blockchain/ABIs/legacy/v1/Manager.json | 432 +++++ src/blockchain/ABIs/legacy/v1/Manager.ts | 434 +++++ .../components/TransactionCalloutModal.tsx | 0 src/components/buttons/BackToListButton.tsx | 34 + src/components/buttons/RadioButton.tsx | 34 + .../buttons}/SubmitButton.tsx | 16 +- .../containers/ContainerSecondaryBG.tsx | 9 + src/components/icons/ThemedIcon.tsx | 8 +- src/components/list/row.tsx | 40 + src/components/modals/InfoModal.tsx | 4 +- src/components/pills/Pill.tsx | 13 + .../switcher}/Switcher.tsx | 18 +- src/components/text/LinkOut.tsx | 22 + src/components/text/TertiaryCallout.tsx | 13 + src/config/consts.ts | 50 +- src/config/contracts.ts | 65 +- src/config/externalUrls.ts | 20 +- src/config/services.ts | 6 +- src/contexts/account/AccountContext.tsx | 38 +- src/contexts/account/useAddress.ts | 8 - src/contexts/account/useBalances.ts | 60 +- src/contexts/account/useDefaultGroups.ts | 68 + src/contexts/account/useProposalVotes.ts | 71 + src/contexts/account/useStrategy.ts | 21 + src/contexts/account/useWithdrawals.ts | 114 +- src/contexts/blockchain/BlockchainContext.tsx | 154 ++ src/contexts/blockchain/useBlockchain.ts | 7 + src/contexts/protocol/ProtocolContext.tsx | 9 +- .../protocol/useAnnualProjectedRate.ts | 58 +- src/contexts/protocol/useExchangeRates.ts | 80 +- src/contexts/protocol/useGasPrices.ts | 55 +- src/contexts/protocol/useTokenBalances.ts | 16 +- src/contexts/theme/ThemeContext.tsx | 7 +- .../governance/components/Choices.tsx | 28 + .../governance/components/Details.tsx | 144 ++ .../governance/components/Governance.tsx | 85 + .../governance/components/StagePill.tsx | 41 + .../governance/components/VoteButton.tsx | 33 + src/features/governance/data/Proposal.ts | 19 + src/features/governance/data/getProposals.ts | 169 ++ src/features/governance/hooks/useVote.ts | 129 ++ src/features/swap/components/BalanceTools.tsx | 2 +- src/features/swap/components/Details.tsx | 36 +- .../swap/components/ReceiveSummary.tsx | 21 +- src/features/swap/components/Swap.tsx | 15 +- src/features/swap/components/SwapForm.tsx | 37 +- src/features/swap/hooks/useStaking.ts | 115 +- src/features/swap/hooks/useSwap.ts | 32 +- src/features/swap/hooks/useUnstaking.ts | 119 +- src/features/swap/types/index.ts | 1 - src/features/swap/utils/toast.tsx | 22 + src/features/swap/utils/validation.ts | 6 +- .../validators/components/Details.tsx | 123 ++ src/features/validators/components/List.tsx | 65 + .../components/ValidatorGroupRow.tsx | 29 + .../validators/data/fetchValidGroups.ts | 60 + .../validators/data/getGoodAddresses.ts | 13 + src/features/validators/data/getGroupName.ts | 22 + .../validators/data/healthyGroupsOnly.ts | 36 + .../validators/data/nonBlockedGroupsOnly.ts | 38 + .../validators/hooks/useChangeStrategy.ts | 57 + .../validators/removeAddressMiddle.tsx | 5 + .../wallet/components/WalletButton.tsx | 27 +- .../wallet/components/WalletModal.tsx | 82 - src/features/wallet/hooks/useWallet.ts | 65 - src/hooks/useAPI.ts | 10 +- src/hooks/useAddresses.ts | 15 + src/hooks/useBlockchain.ts | 110 -- src/hooks/useCeloRegistryAddress.ts | 16 + src/hooks/useIsTransitioning.ts | 25 + src/hooks/useModeChange.tsx | 21 + .../useRedirectToConnectedChainIfNeeded.tsx | 29 + src/images/icons/caret-purple-dark.svg | 3 + src/images/icons/caret-purple-light.svg | 3 + src/layout/AppLayout/Header.tsx | 2 +- src/layout/AppLayout/index.tsx | 9 +- src/pages/[...slug].tsx | 111 ++ src/pages/_app.tsx | 139 +- src/pages/_document.tsx | 4 +- src/pages/connect.tsx | 45 +- src/pages/governance/[...slug].tsx | 66 + src/pages/index.tsx | 24 - src/pages/library.tsx | 35 + src/pages/validators/[...slug].tsx | 74 + src/types/index.ts | 14 + src/utils/appendChainIdToLink.tsx | 8 + src/utils/celoRegistry.ts | 7 + src/utils/chainIdToChain.ts | 14 + src/utils/chainIdToRPC.ts | 12 + src/utils/clients.ts | 15 + src/utils/localSave.ts | 10 + src/utils/proposals.ts | 44 + src/utils/sanctioned.ts | 12 +- src/utils/tokens.ts | 14 +- tailwind.config.js | 4 + yarn.lock | 1680 ++++++++++------- 113 files changed, 12781 insertions(+), 1501 deletions(-) create mode 100644 src/blockchain/ABIs/Account.ts create mode 100644 src/blockchain/ABIs/DefaultGroupStrategy.json create mode 100644 src/blockchain/ABIs/DefaultGroupStrategy.ts create mode 100644 src/blockchain/ABIs/GroupHealth.json create mode 100644 src/blockchain/ABIs/GroupHealth.ts create mode 100644 src/blockchain/ABIs/Manager.ts create mode 100644 src/blockchain/ABIs/SpecificGroupStrategy.json create mode 100644 src/blockchain/ABIs/SpecificGroupStrategy.ts create mode 100644 src/blockchain/ABIs/StakedCelo.ts create mode 100644 src/blockchain/ABIs/Vote.json create mode 100644 src/blockchain/ABIs/Vote.ts create mode 100644 src/blockchain/ABIs/legacy/v1/Manager.json create mode 100644 src/blockchain/ABIs/legacy/v1/Manager.ts rename src/{features/swap => }/components/TransactionCalloutModal.tsx (100%) create mode 100644 src/components/buttons/BackToListButton.tsx create mode 100644 src/components/buttons/RadioButton.tsx rename src/{features/swap/components => components/buttons}/SubmitButton.tsx (80%) create mode 100644 src/components/containers/ContainerSecondaryBG.tsx create mode 100644 src/components/list/row.tsx create mode 100644 src/components/pills/Pill.tsx rename src/{features/swap/components => components/switcher}/Switcher.tsx (76%) create mode 100644 src/components/text/LinkOut.tsx create mode 100644 src/components/text/TertiaryCallout.tsx delete mode 100644 src/contexts/account/useAddress.ts create mode 100644 src/contexts/account/useDefaultGroups.ts create mode 100644 src/contexts/account/useProposalVotes.ts create mode 100644 src/contexts/account/useStrategy.ts create mode 100644 src/contexts/blockchain/BlockchainContext.tsx create mode 100644 src/contexts/blockchain/useBlockchain.ts create mode 100644 src/features/governance/components/Choices.tsx create mode 100644 src/features/governance/components/Details.tsx create mode 100644 src/features/governance/components/Governance.tsx create mode 100644 src/features/governance/components/StagePill.tsx create mode 100644 src/features/governance/components/VoteButton.tsx create mode 100644 src/features/governance/data/Proposal.ts create mode 100644 src/features/governance/data/getProposals.ts create mode 100644 src/features/governance/hooks/useVote.ts delete mode 100644 src/features/swap/types/index.ts create mode 100644 src/features/validators/components/Details.tsx create mode 100644 src/features/validators/components/List.tsx create mode 100644 src/features/validators/components/ValidatorGroupRow.tsx create mode 100644 src/features/validators/data/fetchValidGroups.ts create mode 100644 src/features/validators/data/getGoodAddresses.ts create mode 100644 src/features/validators/data/getGroupName.ts create mode 100644 src/features/validators/data/healthyGroupsOnly.ts create mode 100644 src/features/validators/data/nonBlockedGroupsOnly.ts create mode 100644 src/features/validators/hooks/useChangeStrategy.ts create mode 100644 src/features/validators/removeAddressMiddle.tsx delete mode 100644 src/features/wallet/components/WalletModal.tsx delete mode 100644 src/features/wallet/hooks/useWallet.ts create mode 100644 src/hooks/useAddresses.ts delete mode 100644 src/hooks/useBlockchain.ts create mode 100644 src/hooks/useCeloRegistryAddress.ts create mode 100644 src/hooks/useIsTransitioning.ts create mode 100644 src/hooks/useModeChange.tsx create mode 100644 src/hooks/useRedirectToConnectedChainIfNeeded.tsx create mode 100644 src/images/icons/caret-purple-dark.svg create mode 100644 src/images/icons/caret-purple-light.svg create mode 100644 src/pages/[...slug].tsx create mode 100644 src/pages/governance/[...slug].tsx delete mode 100755 src/pages/index.tsx create mode 100644 src/pages/library.tsx create mode 100644 src/pages/validators/[...slug].tsx create mode 100644 src/types/index.ts create mode 100644 src/utils/appendChainIdToLink.tsx create mode 100644 src/utils/celoRegistry.ts create mode 100644 src/utils/chainIdToChain.ts create mode 100644 src/utils/chainIdToRPC.ts create mode 100644 src/utils/clients.ts create mode 100644 src/utils/localSave.ts create mode 100644 src/utils/proposals.ts diff --git a/.gitignore b/.gitignore index c7a861fa..83bb8b6f 100755 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ public/THIRD_PARTY_LICENSES.txt # env .env +src/blockchain/types diff --git a/.vscode/settings.json b/.vscode/settings.json index 22b65df3..99931683 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -48,4 +48,7 @@ "editor.tabSize": 2, "editor.detectIndentation": false, "typescript.tsdk": "node_modules/typescript/lib", + "cSpell.words": [ + "unstake" + ], } diff --git a/next.config.js b/next.config.js index 00153a24..ea0ac83e 100755 --- a/next.config.js +++ b/next.config.js @@ -45,4 +45,7 @@ const nextConfig = { }, }; -module.exports = nextConfig; +const withBundleAnalyzer = require('@next/bundle-analyzer')({ + enabled: process.env.ANALYZE === 'true', +}); +module.exports = withBundleAnalyzer(nextConfig); diff --git a/package.json b/package.json index 1d098fa1..05e7b9e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "liquid-staking", - "version": "1.1.0", + "name": "staked-celo-app", + "version": "2.0.0", "private": false, "scripts": { "dev": "next dev", @@ -10,14 +10,19 @@ "generate-disclaimer": "yarn licenses generate-disclaimer --production > ./public/THIRD_PARTY_LICENSES.txt" }, "dependencies": { - "@celo/contractkit": "^3.2.0", - "@celo/react-celo": "^5.0.4", + "@celo/abis": "^9.0.6", + "@celo/rainbowkit-celo": "1.0.2-beta.2", + "@rainbow-me/rainbowkit": "^1.0.4", "@types/react-modal": "^3.13.1", "@types/react-transition-group": "^4.4.5", + "@wagmi/chains": "^1.4.0", "axios": "^0.27.2", "bignumber.js": "^9.0.2", "compliance-sdk": "^1.0.5", + "date-fns": "^2.29.3", "dayjs": "^1.11.4", + "graphql": "^16.6.0", + "graphql-request": "^5.2.0", "next": "12.2.1", "react": "18.2.0", "react-dom": "18.2.0", @@ -25,17 +30,22 @@ "react-number-format": "^4.9.3", "react-toastify": "^9.0.5", "react-transition-group": "^4.4.5", - "web3": "^1.3.6", - "web3-core": "1.3.6", - "web3-utils": "^1.7.4" + "react-use-async-callback": "^2.1.2", + "viem": "^1.2.9", + "wagmi": "^1.3.4" + }, + "resolutions": { + "@wagmi/connectors": "^2.6.4" }, "devDependencies": { + "@celo/contractkit": "^3.2.0", + "@next/bundle-analyzer": "^13.4.3", "@types/gtag.js": "^0.0.11", "@types/node": "18.0.3", "@types/react": "18.0.15", "@types/react-dom": "18.0.6", - "@typescript-eslint/eslint-plugin": "^5.30.5", - "@typescript-eslint/parser": "^5.30.5", + "@typescript-eslint/eslint-plugin": "^5.59.6", + "@typescript-eslint/parser": "^5.59.6", "autoprefixer": "^10.4.7", "eslint": "8.19.0", "eslint-config-next": "12.2.1", @@ -44,7 +54,7 @@ "prettier": "^2.7.1", "sass": "^1.54.3", "tailwindcss": "^3.1.5", - "typescript": "4.7.4", + "typescript": "5.0.4", "webpack": "^5.76.0" }, "nextBundleAnalysis": { diff --git a/public/site.webmanifest b/public/site.webmanifest index 7f84e1c4..97b19af3 100644 --- a/public/site.webmanifest +++ b/public/site.webmanifest @@ -1,16 +1,18 @@ { - "name": "Liquid Staking", - "icons": [ - { - "src": "/public/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/public/android-chrome-512x512.png", - "sizes": "512x512", - "type": "image/png" - } - ], - "display": "standalone" + "name": "StakedCelo", + "iconPath": "android-chrome-512x512.png", + "description": "A simple DApp for Celo liquid staking. Stake your CELO and vote on governance proposals while maintaining liquidity.", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "display": "standalone" } diff --git a/src/blockchain/ABIs/Account.ts b/src/blockchain/ABIs/Account.ts new file mode 100644 index 00000000..81122863 --- /dev/null +++ b/src/blockchain/ABIs/Account.ts @@ -0,0 +1,893 @@ +const AccountABI = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + stateMutability: 'payable', + type: 'receive', + }, + { + inputs: [], + name: 'AccountCreationFailed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'ActivatePendingVotesFailed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + ], + name: 'CallerNotManager', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'CeloTransferFailed', + type: 'error', + }, + { + inputs: [], + name: 'GroupsAndVotesArrayLengthsMismatch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'localPendingWithdrawalTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lockedGoldPendingWithdrawalTimestamp', + type: 'uint256', + }, + ], + name: 'InconsistentPendingWithdrawalTimestamps', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'localPendingWithdrawalValue', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lockedGoldPendingWithdrawalValue', + type: 'uint256', + }, + ], + name: 'InconsistentPendingWithdrawalValues', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'InsufficientRevokableVotes', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'NoScheduledWithdrawal', + type: 'error', + }, + { + inputs: [], + name: 'NullAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'pendingWithdrawalIndex', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'pendingWithdrawalsLength', + type: 'uint256', + }, + ], + name: 'PendingWithdrawalIndexTooHigh', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'RevokeActiveFailed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'RevokePendingFailed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'sentValue', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expectedValue', + type: 'uint256', + }, + ], + name: 'TotalVotesMismatch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'VoteFailed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'celoAvailable', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'celoToWindraw', + type: 'uint256', + }, + ], + name: 'WithdrawalAmountTooHigh', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + name: 'CeloWithdrawalFinished', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'group', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'withdrawalAmount', + type: 'uint256', + }, + ], + name: 'CeloWithdrawalScheduled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'group', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'withdrawalAmount', + type: 'uint256', + }, + ], + name: 'CeloWithdrawalStarted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'manager', + type: 'address', + }, + ], + name: 'ManagerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'group', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'VotesScheduled', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'address', + name: 'voteLesser', + type: 'address', + }, + { + internalType: 'address', + name: 'voteGreater', + type: 'address', + }, + ], + name: 'activateAndVote', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + internalType: 'uint256', + name: 'localPendingWithdrawalIndex', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lockedGoldPendingWithdrawalIndex', + type: 'uint256', + }, + ], + name: 'finishPendingWithdrawal', + outputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'getCeloForGroup', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + ], + name: 'getNumberPendingWithdrawals', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'getPendingWithdrawal', + outputs: [ + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + ], + name: 'getPendingWithdrawals', + outputs: [ + { + internalType: 'uint256[]', + name: 'values', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'timestamps', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getTotalCelo', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_registry', + type: 'address', + }, + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'manager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'pendingWithdrawals', + outputs: [ + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'registry', + outputs: [ + { + internalType: 'contract IRegistry', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'groups', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'votes', + type: 'uint256[]', + }, + ], + name: 'scheduleVotes', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + internalType: 'address[]', + name: 'groups', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'withdrawals', + type: 'uint256[]', + }, + ], + name: 'scheduleWithdrawals', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'scheduledVotesForGroup', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'scheduledWithdrawalsForGroup', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + ], + name: 'scheduledWithdrawalsForGroupAndBeneficiary', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + ], + name: 'setManager', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'totalScheduledWithdrawals', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'address', + name: 'lesserAfterPendingRevoke', + type: 'address', + }, + { + internalType: 'address', + name: 'greaterAfterPendingRevoke', + type: 'address', + }, + { + internalType: 'address', + name: 'lesserAfterActiveRevoke', + type: 'address', + }, + { + internalType: 'address', + name: 'greaterAfterActiveRevoke', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, +] as const; + +export default AccountABI; diff --git a/src/blockchain/ABIs/DefaultGroupStrategy.json b/src/blockchain/ABIs/DefaultGroupStrategy.json new file mode 100644 index 00000000..d7fc3eec --- /dev/null +++ b/src/blockchain/ABIs/DefaultGroupStrategy.json @@ -0,0 +1,880 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AddressZeroNotAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "CallerNotManager", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "CallerNotManagerNorStrategy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupAlreadyAdded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupNotActive", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupNotEligible", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "HealthyGroup", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "InvalidFromGroup", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "InvalidToGroup", + "type": "error" + }, + { + "inputs": [], + "name": "NoActiveGroups", + "type": "error" + }, + { + "inputs": [], + "name": "NotAbleToDistributeVotes", + "type": "error" + }, + { + "inputs": [], + "name": "NotUnsortedGroup", + "type": "error" + }, + { + "inputs": [], + "name": "NullAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualCelo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedCelo", + "type": "uint256" + } + ], + "name": "RebalanceEnoughStCelo", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualCelo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedCelo", + "type": "uint256" + } + ], + "name": "RebalanceNoExtraStCelo", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "ManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "update", + "type": "bool" + } + ], + "name": "SortedFlagUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "account", + "outputs": [ + { + "internalType": "contract IAccount", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "internalType": "address", + "name": "lesser", + "type": "address" + }, + { + "internalType": "address", + "name": "greater", + "type": "address" + } + ], + "name": "activateGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "deactivateGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "deactivateUnhealthyGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "celoAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "depositGroupToIgnore", + "type": "address" + } + ], + "name": "generateDepositVoteDistribution", + "outputs": [ + { + "internalType": "address[]", + "name": "finalGroups", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "finalVotes", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "celoAmount", + "type": "uint256" + } + ], + "name": "generateWithdrawalVoteDistribution", + "outputs": [ + { + "internalType": "address[]", + "name": "finalGroups", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "finalVotes", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "getExpectedAndActualStCeloForGroup", + "outputs": [ + { + "internalType": "uint256", + "name": "expectedStCelo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualStCelo", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "getGroupPreviousAndNext", + "outputs": [ + { + "internalType": "address", + "name": "previousAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "nextAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGroupsHead", + "outputs": [ + { + "internalType": "address", + "name": "head", + "type": "address" + }, + { + "internalType": "address", + "name": "previousAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGroupsTail", + "outputs": [ + { + "internalType": "address", + "name": "tail", + "type": "address" + }, + { + "internalType": "address", + "name": "nextAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNumberOfGroups", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNumberOfUnsortedGroups", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getUnsortedGroupAt", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "groupHealth", + "outputs": [ + { + "internalType": "contract IGroupHealth", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_manager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "isActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxGroupsToDistributeTo", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxGroupsToWithdrawFrom", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "fromGroup", + "type": "address" + }, + { + "internalType": "address", + "name": "toGroup", + "type": "address" + } + ], + "name": "rebalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_groupHealth", + "type": "address" + }, + { + "internalType": "address", + "name": "_specificGroupStrategy", + "type": "address" + } + ], + "name": "setDependencies", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "distributeTo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawFrom", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loopLimit", + "type": "uint256" + } + ], + "name": "setSortingParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sorted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "specificGroupStrategy", + "outputs": [ + { + "internalType": "contract ISpecificGroupStrategy", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "stCeloInGroup", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStCeloInStrategy", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "internalType": "address", + "name": "lesserKey", + "type": "address" + }, + { + "internalType": "address", + "name": "greaterKey", + "type": "address" + } + ], + "name": "updateActiveGroupOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } +] diff --git a/src/blockchain/ABIs/DefaultGroupStrategy.ts b/src/blockchain/ABIs/DefaultGroupStrategy.ts new file mode 100644 index 00000000..310d7600 --- /dev/null +++ b/src/blockchain/ABIs/DefaultGroupStrategy.ts @@ -0,0 +1,882 @@ +const DefaultGroupStrategyABI = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + stateMutability: 'payable', + type: 'receive', + }, + { + inputs: [], + name: 'AddressZeroNotAllowed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + ], + name: 'CallerNotManager', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + ], + name: 'CallerNotManagerNorStrategy', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupAlreadyAdded', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupNotActive', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupNotEligible', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'HealthyGroup', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'InvalidFromGroup', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'InvalidToGroup', + type: 'error', + }, + { + inputs: [], + name: 'NoActiveGroups', + type: 'error', + }, + { + inputs: [], + name: 'NotAbleToDistributeVotes', + type: 'error', + }, + { + inputs: [], + name: 'NotUnsortedGroup', + type: 'error', + }, + { + inputs: [], + name: 'NullAddress', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'actualCelo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expectedCelo', + type: 'uint256', + }, + ], + name: 'RebalanceEnoughStCelo', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'actualCelo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expectedCelo', + type: 'uint256', + }, + ], + name: 'RebalanceNoExtraStCelo', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupActivated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'manager', + type: 'address', + }, + ], + name: 'ManagerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'update', + type: 'bool', + }, + ], + name: 'SortedFlagUpdated', + type: 'event', + }, + { + inputs: [], + name: 'account', + outputs: [ + { + internalType: 'contract IAccount', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'address', + name: 'lesser', + type: 'address', + }, + { + internalType: 'address', + name: 'greater', + type: 'address', + }, + ], + name: 'activateGroup', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'deactivateGroup', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'deactivateUnhealthyGroup', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'celoAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'depositGroupToIgnore', + type: 'address', + }, + ], + name: 'generateDepositVoteDistribution', + outputs: [ + { + internalType: 'address[]', + name: 'finalGroups', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'finalVotes', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'celoAmount', + type: 'uint256', + }, + ], + name: 'generateWithdrawalVoteDistribution', + outputs: [ + { + internalType: 'address[]', + name: 'finalGroups', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'finalVotes', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'getExpectedAndActualStCeloForGroup', + outputs: [ + { + internalType: 'uint256', + name: 'expectedStCelo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'actualStCelo', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'getGroupPreviousAndNext', + outputs: [ + { + internalType: 'address', + name: 'previousAddress', + type: 'address', + }, + { + internalType: 'address', + name: 'nextAddress', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getGroupsHead', + outputs: [ + { + internalType: 'address', + name: 'head', + type: 'address', + }, + { + internalType: 'address', + name: 'previousAddress', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getGroupsTail', + outputs: [ + { + internalType: 'address', + name: 'tail', + type: 'address', + }, + { + internalType: 'address', + name: 'nextAddress', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNumberOfGroups', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNumberOfUnsortedGroups', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'getUnsortedGroupAt', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getVersionNumber', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'groupHealth', + outputs: [ + { + internalType: 'contract IGroupHealth', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'isActive', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'manager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxGroupsToDistributeTo', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxGroupsToWithdrawFrom', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'fromGroup', + type: 'address', + }, + { + internalType: 'address', + name: 'toGroup', + type: 'address', + }, + ], + name: 'rebalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_account', + type: 'address', + }, + { + internalType: 'address', + name: '_groupHealth', + type: 'address', + }, + { + internalType: 'address', + name: '_specificGroupStrategy', + type: 'address', + }, + ], + name: 'setDependencies', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + ], + name: 'setManager', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'distributeTo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'withdrawFrom', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'loopLimit', + type: 'uint256', + }, + ], + name: 'setSortingParams', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'sorted', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'specificGroupStrategy', + outputs: [ + { + internalType: 'contract ISpecificGroupStrategy', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'stCeloInGroup', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalStCeloInStrategy', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'address', + name: 'lesserKey', + type: 'address', + }, + { + internalType: 'address', + name: 'greaterKey', + type: 'address', + }, + ], + name: 'updateActiveGroupOrder', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, +] as const; + +export default DefaultGroupStrategyABI; diff --git a/src/blockchain/ABIs/GroupHealth.json b/src/blockchain/ABIs/GroupHealth.json new file mode 100644 index 00000000..509f5322 --- /dev/null +++ b/src/blockchain/ABIs/GroupHealth.json @@ -0,0 +1,298 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupHealthy", + "type": "error" + }, + { + "inputs": [], + "name": "MembersLengthMismatch", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "healthy", + "type": "bool" + } + ], + "name": "GroupHealthUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_registry", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isGroupValid", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "membersElectedIndex", + "type": "uint256[]" + } + ], + "name": "markGroupHealthy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "registry", + "outputs": [ + { + "internalType": "contract IRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "updateGroupHealth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } +] diff --git a/src/blockchain/ABIs/GroupHealth.ts b/src/blockchain/ABIs/GroupHealth.ts new file mode 100644 index 00000000..63c32d91 --- /dev/null +++ b/src/blockchain/ABIs/GroupHealth.ts @@ -0,0 +1,300 @@ +const GroupHealthABI = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + stateMutability: 'payable', + type: 'receive', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupHealthy', + type: 'error', + }, + { + inputs: [], + name: 'MembersLengthMismatch', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'group', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'healthy', + type: 'bool', + }, + ], + name: 'GroupHealthUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'getVersionNumber', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_registry', + type: 'address', + }, + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'isGroupValid', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'membersElectedIndex', + type: 'uint256[]', + }, + ], + name: 'markGroupHealthy', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'registry', + outputs: [ + { + internalType: 'contract IRegistry', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'updateGroupHealth', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, +] as const; + +export default GroupHealthABI; diff --git a/src/blockchain/ABIs/Manager.json b/src/blockchain/ABIs/Manager.json index cd0370c5..91860020 100644 --- a/src/blockchain/ABIs/Manager.json +++ b/src/blockchain/ABIs/Manager.json @@ -52,26 +52,31 @@ "stateMutability": "payable", "type": "receive" }, + { + "inputs": [], + "name": "AddressZeroNotAllowed", + "type": "error" + }, { "inputs": [ { "internalType": "address", - "name": "group", + "name": "caller", "type": "address" } ], - "name": "FailedToAddActiveGroup", + "name": "CallerNotStakedCelo", "type": "error" }, { "inputs": [ { "internalType": "address", - "name": "group", + "name": "caller", "type": "address" } ], - "name": "FailedToAddDeprecatedGroup", + "name": "CallerNotStrategy", "type": "error" }, { @@ -82,7 +87,7 @@ "type": "address" } ], - "name": "FailedToRemoveDeprecatedGroup", + "name": "FromGroupNotOverflowing", "type": "error" }, { @@ -93,7 +98,7 @@ "type": "address" } ], - "name": "GroupAlreadyAdded", + "name": "GroupNotEligible", "type": "error" }, { @@ -104,27 +109,60 @@ "type": "address" } ], - "name": "GroupNotActive", + "name": "InvalidToGroup", "type": "error" }, { - "inputs": [], - "name": "MaxGroupsVotedForReached", - "type": "error" - }, - { - "inputs": [], - "name": "NoActiveGroups", + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualCelo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedCelo", + "type": "uint256" + } + ], + "name": "RebalanceEnoughCelo", "type": "error" }, { - "inputs": [], - "name": "NoGroups", + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualCelo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedCelo", + "type": "uint256" + } + ], + "name": "RebalanceNoExtraCelo", "type": "error" }, { - "inputs": [], - "name": "NoVotableGroups", + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "ToGroupOverflowing", "type": "error" }, { @@ -138,11 +176,17 @@ { "indexed": true, "internalType": "address", - "name": "group", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", "type": "address" } ], - "name": "GroupActivated", + "name": "OwnershipTransferred", "type": "event" }, { @@ -151,44 +195,64 @@ { "indexed": true, "internalType": "address", - "name": "group", + "name": "voteContract", "type": "address" } ], - "name": "GroupDeprecated", + "name": "VoteContractSet", "type": "event" }, { - "anonymous": false, "inputs": [ { - "indexed": true, "internalType": "address", - "name": "group", + "name": "newStrategy", "type": "address" } ], - "name": "GroupRemoved", - "type": "event" + "name": "changeStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "defaultStrategy", + "outputs": [ + { + "internalType": "contract IDefaultStrategy", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": true, "internalType": "address", - "name": "previousOwner", + "name": "accountAddress", "type": "address" - }, + } + ], + "name": "getAddressStrategy", + "outputs": [ { - "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "", "type": "address" } ], - "name": "OwnershipTransferred", - "type": "event" + "stateMutability": "view", + "type": "function" }, { "inputs": [ @@ -198,16 +262,20 @@ "type": "address" } ], - "name": "activateGroup", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "deposit", - "outputs": [], - "stateMutability": "payable", + "name": "getExpectedAndActualCeloForGroup", + "outputs": [ + { + "internalType": "uint256", + "name": "expectedCelo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualCelo", + "type": "uint256" + } + ], + "stateMutability": "view", "type": "function" }, { @@ -218,32 +286,53 @@ "type": "address" } ], - "name": "deprecateGroup", - "outputs": [], - "stateMutability": "nonpayable", + "name": "getReceivableVotesForGroup", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "getDeprecatedGroups", + "name": "getVersionNumber", "outputs": [ { - "internalType": "address[]", + "internalType": "uint256", "name": "", - "type": "address[]" + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { "inputs": [], - "name": "getGroups", + "name": "groupHealth", "outputs": [ { - "internalType": "address[]", + "internalType": "contract IGroupHealth", "name": "", - "type": "address[]" + "type": "address" } ], "stateMutability": "view", @@ -280,6 +369,42 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "fromGroup", + "type": "address" + }, + { + "internalType": "address", + "name": "toGroup", + "type": "address" + } + ], + "name": "rebalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "fromGroup", + "type": "address" + }, + { + "internalType": "address", + "name": "toGroup", + "type": "address" + } + ], + "name": "rebalanceOverflow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "registry", @@ -300,6 +425,52 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "revokeVotes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "fromGroups", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "toGroups", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "fromVotes", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "toVotes", + "type": "uint256[]" + } + ], + "name": "scheduleTransferWithinStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -311,6 +482,26 @@ "internalType": "address", "name": "_account", "type": "address" + }, + { + "internalType": "address", + "name": "_vote", + "type": "address" + }, + { + "internalType": "address", + "name": "_groupHealth", + "type": "address" + }, + { + "internalType": "address", + "name": "_specificGroupStrategy", + "type": "address" + }, + { + "internalType": "address", + "name": "_defaultStrategy", + "type": "address" } ], "name": "setDependencies", @@ -318,6 +509,38 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "specificGroupStrategy", + "outputs": [ + { + "internalType": "contract ISpecificGroupStrategy", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "strategies", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -356,6 +579,29 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "stCeloAmount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -369,6 +615,38 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "accountAddress", + "type": "address" + } + ], + "name": "unlockBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "updateHistoryAndReturnLockedStCeloInVoting", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -400,11 +678,57 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [], + "name": "voteContract", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint256", - "name": "stakedCeloAmount", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + } + ], + "name": "voteProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stCeloAmount", "type": "uint256" } ], diff --git a/src/blockchain/ABIs/Manager.ts b/src/blockchain/ABIs/Manager.ts new file mode 100644 index 00000000..5e519195 --- /dev/null +++ b/src/blockchain/ABIs/Manager.ts @@ -0,0 +1,758 @@ +const ManagerABI = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + stateMutability: 'payable', + type: 'receive', + }, + { + inputs: [], + name: 'AddressZeroNotAllowed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + ], + name: 'CallerNotStakedCelo', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + ], + name: 'CallerNotStrategy', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'FromGroupNotOverflowing', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupNotEligible', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'InvalidToGroup', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'actualCelo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expectedCelo', + type: 'uint256', + }, + ], + name: 'RebalanceEnoughCelo', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'actualCelo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'expectedCelo', + type: 'uint256', + }, + ], + name: 'RebalanceNoExtraCelo', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'ToGroupOverflowing', + type: 'error', + }, + { + inputs: [], + name: 'ZeroWithdrawal', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'voteContract', + type: 'address', + }, + ], + name: 'VoteContractSet', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newStrategy', + type: 'address', + }, + ], + name: 'changeStrategy', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'defaultStrategy', + outputs: [ + { + internalType: 'contract IDefaultStrategy', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'deposit', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'accountAddress', + type: 'address', + }, + ], + name: 'getAddressStrategy', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'getExpectedAndActualCeloForGroup', + outputs: [ + { + internalType: 'uint256', + name: 'expectedCelo', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'actualCelo', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'getReceivableVotesForGroup', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getVersionNumber', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'groupHealth', + outputs: [ + { + internalType: 'contract IGroupHealth', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_registry', + type: 'address', + }, + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'fromGroup', + type: 'address', + }, + { + internalType: 'address', + name: 'toGroup', + type: 'address', + }, + ], + name: 'rebalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'fromGroup', + type: 'address', + }, + { + internalType: 'address', + name: 'toGroup', + type: 'address', + }, + ], + name: 'rebalanceOverflow', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'registry', + outputs: [ + { + internalType: 'contract IRegistry', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'revokeVotes', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'fromGroups', + type: 'address[]', + }, + { + internalType: 'address[]', + name: 'toGroups', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'fromVotes', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'toVotes', + type: 'uint256[]', + }, + ], + name: 'scheduleTransferWithinStrategy', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_stakedCelo', + type: 'address', + }, + { + internalType: 'address', + name: '_account', + type: 'address', + }, + { + internalType: 'address', + name: '_vote', + type: 'address', + }, + { + internalType: 'address', + name: '_groupHealth', + type: 'address', + }, + { + internalType: 'address', + name: '_specificGroupStrategy', + type: 'address', + }, + { + internalType: 'address', + name: '_defaultStrategy', + type: 'address', + }, + ], + name: 'setDependencies', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'specificGroupStrategy', + outputs: [ + { + internalType: 'contract ISpecificGroupStrategy', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'strategies', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'stCeloAmount', + type: 'uint256', + }, + ], + name: 'toCelo', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'celoAmount', + type: 'uint256', + }, + ], + name: 'toStakedCelo', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stCeloAmount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'accountAddress', + type: 'address', + }, + ], + name: 'unlockBalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + ], + name: 'updateHistoryAndReturnLockedStCeloInVoting', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'voteContract', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yesVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'noVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'abstainVotes', + type: 'uint256', + }, + ], + name: 'voteProposal', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'stCeloAmount', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, +] as const; + +export default ManagerABI; diff --git a/src/blockchain/ABIs/SpecificGroupStrategy.json b/src/blockchain/ABIs/SpecificGroupStrategy.json new file mode 100644 index 00000000..4c7a7b9f --- /dev/null +++ b/src/blockchain/ABIs/SpecificGroupStrategy.json @@ -0,0 +1,782 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AddressZeroNotAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "CallerNotManager", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "CantWithdrawAccordingToStrategy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "FailedToAddGroup", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "FailedToBlockGroup", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "FailedToUnblockGroup", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupAlreadyBlocked", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupBalanced", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupNotBalanced", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupNotEligible", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupNotOverflowing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupStillOverflowing", + "type": "error" + }, + { + "inputs": [], + "name": "NoActiveGroups", + "type": "error" + }, + { + "inputs": [], + "name": "NoGroups", + "type": "error" + }, + { + "inputs": [], + "name": "NullAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupBlocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupUnblocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "ManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "account", + "outputs": [ + { + "internalType": "contract IAccount", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "blockGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "defaultStrategy", + "outputs": [ + { + "internalType": "contract IDefaultStrategy", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "internalType": "uint256", + "name": "celoAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stCeloAmount", + "type": "uint256" + } + ], + "name": "generateDepositVoteDistribution", + "outputs": [ + { + "internalType": "address[]", + "name": "finalGroups", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "finalVotes", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + }, + { + "internalType": "uint256", + "name": "celoWithdrawalAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stCeloWithdrawalAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isTransfer", + "type": "bool" + } + ], + "name": "generateWithdrawalVoteDistribution", + "outputs": [ + { + "internalType": "address[]", + "name": "groups", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "votes", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getBlockedGroup", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNumberOfBlockedGroups", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNumberOfVotedGroups", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "getStCeloInGroup", + "outputs": [ + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "overflow", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "unhealthy", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getVotedGroup", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "groupHealth", + "outputs": [ + { + "internalType": "contract IGroupHealth", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_manager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "isBlockedGroup", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "isVotedGroup", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "rebalanceOverflowedGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "rebalanceWhenHealthChanged", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_groupHealth", + "type": "address" + }, + { + "internalType": "address", + "name": "_defaultStrategy", + "type": "address" + } + ], + "name": "setDependencies", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "stCeloInGroup", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStCeloLocked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStCeloOverflow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStCeloUnhealthy", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "unblockGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } +] diff --git a/src/blockchain/ABIs/SpecificGroupStrategy.ts b/src/blockchain/ABIs/SpecificGroupStrategy.ts new file mode 100644 index 00000000..49acf6bc --- /dev/null +++ b/src/blockchain/ABIs/SpecificGroupStrategy.ts @@ -0,0 +1,784 @@ +const SpecificGroupStrategyABI = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + stateMutability: 'payable', + type: 'receive', + }, + { + inputs: [], + name: 'AddressZeroNotAllowed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + ], + name: 'CallerNotManager', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'CantWithdrawAccordingToStrategy', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'FailedToAddGroup', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'FailedToBlockGroup', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'FailedToUnblockGroup', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupAlreadyBlocked', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupBalanced', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupNotBalanced', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupNotEligible', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupNotOverflowing', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupStillOverflowing', + type: 'error', + }, + { + inputs: [], + name: 'NoActiveGroups', + type: 'error', + }, + { + inputs: [], + name: 'NoGroups', + type: 'error', + }, + { + inputs: [], + name: 'NullAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupBlocked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupUnblocked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'manager', + type: 'address', + }, + ], + name: 'ManagerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'account', + outputs: [ + { + internalType: 'contract IAccount', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'blockGroup', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'defaultStrategy', + outputs: [ + { + internalType: 'contract IDefaultStrategy', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'celoAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'stCeloAmount', + type: 'uint256', + }, + ], + name: 'generateDepositVoteDistribution', + outputs: [ + { + internalType: 'address[]', + name: 'finalGroups', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'finalVotes', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + { + internalType: 'uint256', + name: 'celoWithdrawalAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'stCeloWithdrawalAmount', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'isTransfer', + type: 'bool', + }, + ], + name: 'generateWithdrawalVoteDistribution', + outputs: [ + { + internalType: 'address[]', + name: 'groups', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'votes', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'getBlockedGroup', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNumberOfBlockedGroups', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNumberOfVotedGroups', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'getStCeloInGroup', + outputs: [ + { + internalType: 'uint256', + name: 'total', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'overflow', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'unhealthy', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getVersionNumber', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'getVotedGroup', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'groupHealth', + outputs: [ + { + internalType: 'contract IGroupHealth', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'isBlockedGroup', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'isVotedGroup', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'manager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'rebalanceOverflowedGroup', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'rebalanceWhenHealthChanged', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_account', + type: 'address', + }, + { + internalType: 'address', + name: '_groupHealth', + type: 'address', + }, + { + internalType: 'address', + name: '_defaultStrategy', + type: 'address', + }, + ], + name: 'setDependencies', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + ], + name: 'setManager', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'stCeloInGroup', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalStCeloLocked', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalStCeloOverflow', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalStCeloUnhealthy', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'unblockGroup', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, +] as const; + +export default SpecificGroupStrategyABI; diff --git a/src/blockchain/ABIs/StakedCelo.ts b/src/blockchain/ABIs/StakedCelo.ts new file mode 100644 index 00000000..b672acb7 --- /dev/null +++ b/src/blockchain/ABIs/StakedCelo.ts @@ -0,0 +1,535 @@ +const StakedCeloABI = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + stateMutability: 'payable', + type: 'receive', + }, + { + inputs: [ + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + ], + name: 'CallerNotManager', + type: 'error', + }, + { + inputs: [], + name: 'NullAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'manager', + type: 'address', + }, + ], + name: 'ManagerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'manager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + ], + name: 'setManager', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, +] as const; + +export default StakedCeloABI; diff --git a/src/blockchain/ABIs/Vote.json b/src/blockchain/ABIs/Vote.json new file mode 100644 index 00000000..ad9fb31a --- /dev/null +++ b/src/blockchain/ABIs/Vote.json @@ -0,0 +1,714 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AddressZeroNotAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "CallerNotManager", + "type": "error" + }, + { + "inputs": [], + "name": "IncorrectIndex", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "NoStakedCelo", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "NotEnoughStakedCelo", + "type": "error" + }, + { + "inputs": [], + "name": "NullAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ProposalNotExpired", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockedCelo", + "type": "uint256" + } + ], + "name": "LockedStCeloInVoting", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "ManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + } + ], + "name": "ProposalVoted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "deleteExpiredProposalTimestamp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "deleteExpiredVoterProposalId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "getLockedStCeloInVoting", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "getProposalTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReferendumDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "getVoteRecord", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + } + ], + "internalType": "struct Vote.ProposalVoteRecord", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "getVoteWeight", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + } + ], + "name": "getVotedStillRelevantProposals", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_registry", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_manager", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposalTimestamps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "registry", + "outputs": [ + { + "internalType": "contract IRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accountVoter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "revokeVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "totalYesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalNoVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalAbstainVotes", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakedCelo", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setDependencies", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stCeloAmount", + "type": "uint256" + } + ], + "name": "toCelo", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "celoAmount", + "type": "uint256" + } + ], + "name": "toStakedCelo", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "updateHistoryAndReturnLockedStCeloInVoting", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accountVoter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + } + ], + "name": "voteProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalYesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalNoVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalAbstainVotes", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } +] diff --git a/src/blockchain/ABIs/Vote.ts b/src/blockchain/ABIs/Vote.ts new file mode 100644 index 00000000..a6c07cb6 --- /dev/null +++ b/src/blockchain/ABIs/Vote.ts @@ -0,0 +1,716 @@ +const VoteABI = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + stateMutability: 'payable', + type: 'receive', + }, + { + inputs: [], + name: 'AddressZeroNotAllowed', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'caller', + type: 'address', + }, + ], + name: 'CallerNotManager', + type: 'error', + }, + { + inputs: [], + name: 'IncorrectIndex', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'NoStakedCelo', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'NotEnoughStakedCelo', + type: 'error', + }, + { + inputs: [], + name: 'NullAddress', + type: 'error', + }, + { + inputs: [], + name: 'ProposalNotExpired', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'lockedCelo', + type: 'uint256', + }, + ], + name: 'LockedStCeloInVoting', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'manager', + type: 'address', + }, + ], + name: 'ManagerSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'voter', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'yesVotes', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'noVotes', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'abstainVotes', + type: 'uint256', + }, + ], + name: 'ProposalVoted', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'deleteExpiredProposalTimestamp', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'voter', + type: 'address', + }, + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'deleteExpiredVoterProposalId', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + ], + name: 'getLockedStCeloInVoting', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'getProposalTimestamp', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getReferendumDuration', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getVersionNumber', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'getVoteRecord', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yesVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'noVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'abstainVotes', + type: 'uint256', + }, + ], + internalType: 'struct Vote.ProposalVoteRecord', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + ], + name: 'getVoteWeight', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'voter', + type: 'address', + }, + ], + name: 'getVotedStillRelevantProposals', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_registry', + type: 'address', + }, + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'manager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'proposalTimestamps', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'registry', + outputs: [ + { + internalType: 'contract IRegistry', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'accountVoter', + type: 'address', + }, + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + ], + name: 'revokeVotes', + outputs: [ + { + internalType: 'uint256', + name: 'totalYesVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalNoVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalAbstainVotes', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_stakedCelo', + type: 'address', + }, + { + internalType: 'address', + name: '_account', + type: 'address', + }, + ], + name: 'setDependencies', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_manager', + type: 'address', + }, + ], + name: 'setManager', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'stCeloAmount', + type: 'uint256', + }, + ], + name: 'toCelo', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'celoAmount', + type: 'uint256', + }, + ], + name: 'toStakedCelo', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'beneficiary', + type: 'address', + }, + ], + name: 'updateHistoryAndReturnLockedStCeloInVoting', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'accountVoter', + type: 'address', + }, + { + internalType: 'uint256', + name: 'proposalId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yesVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'noVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'abstainVotes', + type: 'uint256', + }, + ], + name: 'voteProposal', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalYesVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalNoVotes', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalAbstainVotes', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, +] as const; + +export default VoteABI; diff --git a/src/blockchain/ABIs/legacy/v1/Manager.json b/src/blockchain/ABIs/legacy/v1/Manager.json new file mode 100644 index 00000000..cd0370c5 --- /dev/null +++ b/src/blockchain/ABIs/legacy/v1/Manager.json @@ -0,0 +1,432 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "FailedToAddActiveGroup", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "FailedToAddDeprecatedGroup", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "FailedToRemoveDeprecatedGroup", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupAlreadyAdded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupNotActive", + "type": "error" + }, + { + "inputs": [], + "name": "MaxGroupsVotedForReached", + "type": "error" + }, + { + "inputs": [], + "name": "NoActiveGroups", + "type": "error" + }, + { + "inputs": [], + "name": "NoGroups", + "type": "error" + }, + { + "inputs": [], + "name": "NoVotableGroups", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroWithdrawal", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupDeprecated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "GroupRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "activateGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "group", + "type": "address" + } + ], + "name": "deprecateGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDeprecatedGroups", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGroups", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_registry", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "registry", + "outputs": [ + { + "internalType": "contract IRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_stakedCelo", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setDependencies", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stCeloAmount", + "type": "uint256" + } + ], + "name": "toCelo", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "celoAmount", + "type": "uint256" + } + ], + "name": "toStakedCelo", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stakedCeloAmount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } +] diff --git a/src/blockchain/ABIs/legacy/v1/Manager.ts b/src/blockchain/ABIs/legacy/v1/Manager.ts new file mode 100644 index 00000000..a0afae5d --- /dev/null +++ b/src/blockchain/ABIs/legacy/v1/Manager.ts @@ -0,0 +1,434 @@ +const ManagerABIV1 = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + stateMutability: 'payable', + type: 'receive', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'FailedToAddActiveGroup', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'FailedToAddDeprecatedGroup', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'FailedToRemoveDeprecatedGroup', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupAlreadyAdded', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupNotActive', + type: 'error', + }, + { + inputs: [], + name: 'MaxGroupsVotedForReached', + type: 'error', + }, + { + inputs: [], + name: 'NoActiveGroups', + type: 'error', + }, + { + inputs: [], + name: 'NoGroups', + type: 'error', + }, + { + inputs: [], + name: 'NoVotableGroups', + type: 'error', + }, + { + inputs: [], + name: 'ZeroWithdrawal', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupActivated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupDeprecated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'GroupRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'activateGroup', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'deposit', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'group', + type: 'address', + }, + ], + name: 'deprecateGroup', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getDeprecatedGroups', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getGroups', + outputs: [ + { + internalType: 'address[]', + name: '', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_registry', + type: 'address', + }, + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'registry', + outputs: [ + { + internalType: 'contract IRegistry', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_stakedCelo', + type: 'address', + }, + { + internalType: 'address', + name: '_account', + type: 'address', + }, + ], + name: 'setDependencies', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'stCeloAmount', + type: 'uint256', + }, + ], + name: 'toCelo', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'celoAmount', + type: 'uint256', + }, + ], + name: 'toStakedCelo', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'stakedCeloAmount', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, +] as const; + +export default ManagerABIV1; diff --git a/src/features/swap/components/TransactionCalloutModal.tsx b/src/components/TransactionCalloutModal.tsx similarity index 100% rename from src/features/swap/components/TransactionCalloutModal.tsx rename to src/components/TransactionCalloutModal.tsx diff --git a/src/components/buttons/BackToListButton.tsx b/src/components/buttons/BackToListButton.tsx new file mode 100644 index 00000000..71aaa8da --- /dev/null +++ b/src/components/buttons/BackToListButton.tsx @@ -0,0 +1,34 @@ +import Link from 'next/link'; +import { ThemedIcon } from 'src/components/icons/ThemedIcon'; +import { Mode } from 'src/types'; +import { appendChainIdToLink } from 'src/utils/appendChainIdToLink'; +import { useChainId } from 'wagmi'; + +function modeToCollectionName(mode: Mode) { + switch (mode) { + case Mode.governance: + return 'proposals'; + case Mode.validators: + return 'validator groups'; + default: + return 'list'; + } +} +interface Props { + mode: Mode; +} + +export const BackToListButton = ({ mode }: Props) => { + const chainId = useChainId(); + const href = appendChainIdToLink(`/${mode}`, chainId); + return ( + +
+ + + return to {modeToCollectionName(mode)} + +
+ + ); +}; diff --git a/src/components/buttons/RadioButton.tsx b/src/components/buttons/RadioButton.tsx new file mode 100644 index 00000000..f022b98c --- /dev/null +++ b/src/components/buttons/RadioButton.tsx @@ -0,0 +1,34 @@ +import { PropsWithChildren, useId } from 'react'; + +interface RadioButtonProps { + checked?: boolean; + disabled?: boolean; + onChange?: () => void; + classes?: string; +} + +export const RadioButton = (props: PropsWithChildren) => { + const id = useId(); + const containerClasses = 'flex items-center mb-4'; + const radioClasses = + 'w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600'; + const textClasses = 'ml-2 text-sm font-medium text-color-primary'; + + return ( +
+ + +
+ ); +}; diff --git a/src/features/swap/components/SubmitButton.tsx b/src/components/buttons/SubmitButton.tsx similarity index 80% rename from src/features/swap/components/SubmitButton.tsx rename to src/components/buttons/SubmitButton.tsx index fae00595..5e92f181 100644 --- a/src/features/swap/components/SubmitButton.tsx +++ b/src/components/buttons/SubmitButton.tsx @@ -1,7 +1,7 @@ import { Button } from 'src/components/buttons/Button'; import { ThemedIcon } from 'src/components/icons/ThemedIcon'; import { OpacityTransition } from 'src/components/transitions/OpacityTransition'; -import { Mode } from '../types'; +import { Mode } from 'src/types'; interface SubmitButtonProps { mode: Mode; @@ -19,7 +19,9 @@ export const SubmitButton = ({ mode, pending, disabled }: SubmitButtonProps) => return ( + ); +}; diff --git a/src/features/governance/data/Proposal.ts b/src/features/governance/data/Proposal.ts new file mode 100644 index 00000000..94f030a7 --- /dev/null +++ b/src/features/governance/data/Proposal.ts @@ -0,0 +1,19 @@ +import type { ProposalRecord } from '@celo/contractkit/lib/wrappers/Governance'; +import BigNumber from 'bignumber.js'; +import { ParsedYAML } from 'src/utils/proposals'; + +export type MiniProposal = { + proposalID: string; + stage: ProposalRecord['stage']; + metadata: { + descriptionURL: string; + timestamp: BigNumber | string | number; + }; +}; + +export type Proposal = MiniProposal & { + parsedYAML: ParsedYAML | null; + approvals?: ProposalRecord['approvals']; + votes?: ProposalRecord['votes']; + passed: ProposalRecord['passed']; +}; diff --git a/src/features/governance/data/getProposals.ts b/src/features/governance/data/getProposals.ts new file mode 100644 index 00000000..0092dc10 --- /dev/null +++ b/src/features/governance/data/getProposals.ts @@ -0,0 +1,169 @@ +import { governanceABI } from '@celo/abis/types/wagmi'; +import { ProposalStage } from 'src/features/governance/components/Details'; +import celoRegistry from 'src/utils/celoRegistry'; +import clients from 'src/utils/clients'; +import { getRawGithubUrl, ParsedYAML, parsedYAMLFromMarkdown } from 'src/utils/proposals'; +import { getContract } from 'viem'; +import { MiniProposal, Proposal } from './Proposal'; + +const PROPOSAL_STAGE_KEYS = Object.keys(ProposalStage); + +type MetadataResult = [string, bigint, bigint, bigint, string]; + +export const getProposals = async (chainId: number) => { + const publicClient = clients[chainId]; + const registryContract = getContract({ ...celoRegistry, publicClient }); + const governanceAddress = await registryContract.read.getAddressForString(['Governance']); + const governanceContract = getContract({ + address: governanceAddress, + abi: governanceABI, + publicClient, + }); + + const _dequeue = await governanceContract.read.getDequeue(); + const stageCalls = _dequeue.map((proposalId) => ({ + address: governanceAddress, + abi: governanceABI, + functionName: 'getProposalStage', + args: [proposalId], + })); + + const stages = (await publicClient.multicall({ contracts: stageCalls })).map( + (x) => x.result as unknown as number + ); + + const proposals = _dequeue.map( + (proposalID, i) => + ({ + proposalID: proposalID.toString(), + stage: PROPOSAL_STAGE_KEYS[stages[i]], + } as MiniProposal) + ); + + const current = proposals.filter((x) => runningProposalStages.has(x.stage)); + const passed = proposals + .filter((x) => pastProposalStages.has(x.stage)) + .sort((a, b) => (parseInt(a.proposalID, 10) < parseInt(b.proposalID, 10) ? 1 : -1)) + .slice(0, 5); + + const relevantProposals = [...current, ...passed]; + const metadataCalls = relevantProposals.map((proposal) => ({ + address: governanceAddress, + abi: governanceABI, + functionName: 'getProposal', + args: [proposal.proposalID], + })); + + const metadatas = (await publicClient.multicall({ contracts: metadataCalls })).map( + (x) => x.result as MetadataResult + ); + + metadatas.forEach((metadata, i) => { + relevantProposals[i].metadata = { + timestamp: metadata[2].toString(), + descriptionURL: metadata[4], + }; + }); + + const [currentWithYaml, passedWithYaml] = await Promise.all( + [current, passed].map(async (list) => { + return await Promise.all( + list.map(async (proposal) => { + const parsedYAML = await getYamlForProposal(proposal); + return { + ...proposal, + proposalID: proposal.proposalID.toString(), + parsedYAML, + }; + }) + ); + }) + ); + + return { + proposals: currentWithYaml, + pastProposals: passedWithYaml, + }; +}; + +const runningProposalStages = new Set([ProposalStage.Queued, ProposalStage.Referendum]); +const pastProposalStages = new Set([ProposalStage.Expiration, ProposalStage.Execution]); + +export const getProposalRecord = async ( + chainId: number, + proposalID: string +): Promise => { + const publicClient = clients[chainId]; + const registryContract = getContract({ ...celoRegistry, publicClient }); + const governanceAddress = await registryContract.read.getAddressForString(['Governance']); + + const [_dequeue, _stage, _metadata] = ( + await publicClient.multicall({ + contracts: [ + { + address: governanceAddress, + abi: governanceABI, + functionName: 'getDequeue', + }, + { + address: governanceAddress, + abi: governanceABI, + functionName: 'getProposalStage', + args: [BigInt(proposalID)], + }, + { + address: governanceAddress, + abi: governanceABI, + functionName: 'getProposal', + args: [BigInt(proposalID)], + }, + ], + }) + ).map((x) => x.result as bigint[] | number | MetadataResult); + + const dequeue = _dequeue as bigint[]; + const stage = _stage as number; + const metadata = _metadata as unknown as MetadataResult; + + return { + proposalID, + stage: PROPOSAL_STAGE_KEYS[stage as number] as ProposalStage, + metadata: { + timestamp: metadata[2].toString(), + descriptionURL: metadata[4], + }, + index: (dequeue as bigint[]).findIndex((id) => proposalID === id.toString()), + } as unknown as SerializedProposal; +}; + +export async function getYamlForProposal(proposal: MiniProposal) { + try { + const md = await fetch(getRawGithubUrl(proposal.metadata.descriptionURL)).then((x) => x.text()); + const parsed = parsedYAMLFromMarkdown(md); + if (!parsed) { + throw new Error("Couldn't parse markdown"); + } + return parsed; + } catch { + console.warn(`Failed to fetch proposal markdown at url ${proposal.metadata.descriptionURL}`); + + return { + cgp: proposal.proposalID.toString(), + title: `Proposal ${proposal.proposalID}`, + dateCreated: proposal.metadata.timestamp.toString(), + author: '', + status: proposal.stage, + discussionsTo: '', + governanceProposalId: proposal.proposalID.toString(), + dateExecuted: '', + } as ParsedYAML; + } +} + +export type SerializedProposal = { + proposalID: Proposal['proposalID']; + parsedYAML: Proposal['parsedYAML']; + stage: Proposal['stage']; + metadata: Proposal['metadata']; + index?: number; +}; diff --git a/src/features/governance/hooks/useVote.ts b/src/features/governance/hooks/useVote.ts new file mode 100644 index 00000000..cb1134a3 --- /dev/null +++ b/src/features/governance/hooks/useVote.ts @@ -0,0 +1,129 @@ +import { useCallback } from 'react'; +import { useAsyncCallback } from 'react-use-async-callback'; +import { useAccountContext } from 'src/contexts/account/AccountContext'; +import { TxCallbacks, useBlockchain } from 'src/contexts/blockchain/useBlockchain'; +import { useGasPrices } from 'src/contexts/protocol/useGasPrices'; +import { ProposalStage } from 'src/features/governance/components/Details'; +import { SerializedProposal } from 'src/features/governance/data/getProposals'; +import { showErrorToast, showVoteToast } from 'src/features/swap/utils/toast'; +import { VoteType } from 'src/types'; +import chainIdToChain from 'src/utils/chainIdToChain'; +import { transactionEvent } from 'src/utils/ga'; +import { readFromCache, writeToCache } from 'src/utils/localSave'; +import { useAccount, useChainId, useContractRead, useContractWrite } from 'wagmi'; + +export const useVote = () => { + const { managerContract, voteContract } = useBlockchain(); + const { suggestedGasPrice } = useGasPrices(); + const { stCeloBalance, votes } = useAccountContext(); + const { address } = useAccount(); + const chainId = useChainId(); + const network = chainIdToChain(chainId); + + const getVoteCacheKey = useCallback( + (id: string) => { + return `${network.name}:voteProposal:${id}`; + }, + [network.name] + ); + + const { data: voteWeight } = useContractRead({ + ...managerContract, + functionName: 'toCelo', + args: [stCeloBalance.toBigInt()], + }); + const { writeAsync: _voteProposal } = useContractWrite({ + ...managerContract, + functionName: 'voteProposal', + }); + + /* + * @param proposal - full serialized proposal + * @param vote - yes | no | abstain + */ + const [voteProposal, voteProposalStatus] = useAsyncCallback( + async (proposal: SerializedProposal, vote: VoteType, callbacks?: TxCallbacks) => { + if (!address || !managerContract || !proposal.index) { + throw new Error('vote called before loading completed'); + } + if (proposal.stage !== ProposalStage.Referendum) { + throw new Error('vote called on proposal that is not in Referendum stage'); + } + if (!voteWeight) { + throw new Error('Unsufficient balance'); + } + transactionEvent({ + action: 'voteProposal', + status: 'initiated_transaction', + value: vote, + }); + try { + await _voteProposal?.({ + args: [ + BigInt(proposal.proposalID), + BigInt(proposal.index), + vote === VoteType.yes ? voteWeight : 0n, + vote === VoteType.no ? voteWeight : 0n, + vote === VoteType.abstain ? voteWeight : 0n, + ], + }); + transactionEvent({ + action: 'voteProposal', + status: 'signed_transaction', + value: voteWeight.toString(), + }); + writeToCache(getVoteCacheKey(proposal.proposalID.toString()), [ + vote, + stCeloBalance.toString(), + ]); + showVoteToast({ vote, proposalID: proposal.proposalID.toString() }); + } catch (e: unknown) { + console.error(e); + showErrorToast( + (e as Error).message.includes('rejected') + ? 'User rejected the request' + : (e as Error).message + ); + } finally { + callbacks?.onSent?.(); + } + }, + [address, suggestedGasPrice, voteWeight, _voteProposal] + ); + + const getProposalVote = useCallback( + (proposalId: string) => { + const nodeData = votes[proposalId]; + const localData = readFromCache(getVoteCacheKey(proposalId)); + + if (!nodeData && !localData?.data) { + return null; + } + + return { + vote: nodeData?.vote || localData?.data[0], + weight: nodeData?.weight || localData?.data[1], + }; + }, + [votes, getVoteCacheKey] + ); + + const { data: proposalIds } = useContractRead({ + ...voteContract, + functionName: 'getVotedStillRelevantProposals', + args: [address!], + enabled: !!address, + }); + + const [getHasVoted, getHasVotedStatus] = useAsyncCallback( + async (proposal: SerializedProposal): Promise => { + if (!proposalIds) { + throw new Error('vote called before loading completed'); + } + return proposalIds.includes(BigInt(proposal.proposalID)); + }, + [proposalIds] + ); + + return { voteProposal, voteProposalStatus, getHasVoted, getHasVotedStatus, getProposalVote }; +}; diff --git a/src/features/swap/components/BalanceTools.tsx b/src/features/swap/components/BalanceTools.tsx index 7c541737..18c7534b 100644 --- a/src/features/swap/components/BalanceTools.tsx +++ b/src/features/swap/components/BalanceTools.tsx @@ -1,6 +1,6 @@ import { WidthTransition } from 'src/components/transitions/WidthTransition'; import { Token } from 'src/utils/tokens'; -import { Mode } from '../types'; +import { Mode } from 'src/types'; interface BalanceToolsProps { mode: Mode; diff --git a/src/features/swap/components/Details.tsx b/src/features/swap/components/Details.tsx index 5e8290a7..2d98dc5b 100644 --- a/src/features/swap/components/Details.tsx +++ b/src/features/swap/components/Details.tsx @@ -2,8 +2,8 @@ import { useState } from 'react'; import { ThemedIcon } from 'src/components/icons/ThemedIcon'; import { InfoModal } from 'src/components/modals/InfoModal'; import { DISPLAY_DECIMALS } from 'src/config/consts'; +import { Mode } from 'src/types'; import { CeloUSD } from 'src/utils/tokens'; -import { Mode } from '../types'; interface DetailsProps { mode: Mode; @@ -25,9 +25,10 @@ export const Details = ({ mode, swapRate, gasFee }: DetailsProps) => { const getDetails = (mode: Mode, swapRate: number, gasFee: CeloUSD) => { switch (mode) { - case 'unstake': + case Mode.unstake: return [exchangeDetail(swapRate), gasDetail(gasFee), feeDetail]; - case 'stake': + default: + case Mode.stake: return [exchangeDetail(swapRate), gasDetail(gasFee), feeDetail, periodDetail]; } }; @@ -57,7 +58,7 @@ const Detail = ({ title, value, tooltip }: DetailProps) => { - {value} + {value === freePriceValue ? : value} setIsOpen(false)}> {tooltip} @@ -68,6 +69,33 @@ const Detail = ({ title, value, tooltip }: DetailProps) => { const freePriceValue = 'Free*'; +const FreePriceValue = () => { + const [isOpen, setIsOpen] = useState(false); + return ( + <> + + Free + + setIsOpen(true)} + /> + + + + setIsOpen(false)}> + All the epoch rewards accrued by the underlying CELO are shared with stCELO holders and the + StakedCelo protocol is earning no fees. Blockchain transaction fees and/or other fees may + apply. + + + ); +}; + const exchangeDetail = (swapRate: number): DetailProps => ({ title: 'Exchange Rate', value: swapRate ? swapRate.toFixed(DISPLAY_DECIMALS) : '...', diff --git a/src/features/swap/components/ReceiveSummary.tsx b/src/features/swap/components/ReceiveSummary.tsx index 1bf1b6fc..120b7efd 100644 --- a/src/features/swap/components/ReceiveSummary.tsx +++ b/src/features/swap/components/ReceiveSummary.tsx @@ -3,8 +3,8 @@ import { ThemedIcon } from 'src/components/icons/ThemedIcon'; import { InfoModal } from 'src/components/modals/InfoModal'; import { OpacityTransition } from 'src/components/transitions/OpacityTransition'; import { useProtocolContext } from 'src/contexts/protocol/ProtocolContext'; +import { Mode } from 'src/types'; import { Token } from 'src/utils/tokens'; -import { Mode } from '../types'; import { TokenCard } from './TokenCard'; interface ReceiveSummaryProps { @@ -18,7 +18,7 @@ export const ReceiveSummary = ({ mode, value }: ReceiveSummaryProps) => { return ( { const { annualProjectedRate } = useProtocolContext(); switch (mode) { - case 'stake': - return ( - - {annualProjectedRate ? `${annualProjectedRate}%` : '-'} projected APR - - ); - case 'unstake': + case Mode.unstake: return (
3-day unstake period
); + default: + case Mode.stake: + return ( + + Earn projected {annualProjectedRate ? `${annualProjectedRate}%` : '-'} annually + + ); } }; @@ -63,7 +64,7 @@ const UnstakeInfo = () => { <> void; } -export const Swap = ({ mode, onModeChange }: SwapProps) => { +export const Swap = ({ mode }: SwapProps) => { const { pendingWithdrawals } = useAccountContext(); const { amount, setAmount, swap, balance, receiveAmount, swapRate, gasFee, setMaxAmount } = useSwap(mode); const error = validateAmount(amount, balance, mode); return ( - - + <> { setMaxAmount={setMaxAmount} onSubmit={swap} onChange={setAmount} - onModeChange={onModeChange} />
{!error && gasFee &&
} - {mode === 'unstake' && pendingWithdrawals.length !== 0 ? ( + {mode === Mode.unstake && pendingWithdrawals.length !== 0 ? ( ) : null}
-
+ ); }; diff --git a/src/features/swap/components/SwapForm.tsx b/src/features/swap/components/SwapForm.tsx index dc8e865f..6393b883 100644 --- a/src/features/swap/components/SwapForm.tsx +++ b/src/features/swap/components/SwapForm.tsx @@ -1,17 +1,18 @@ import { FormEventHandler, useCallback, useState } from 'react'; import NumberFormat, { NumberFormatValues } from 'react-number-format'; +import { SubmitButton } from 'src/components/buttons/SubmitButton'; import { ThemedIcon } from 'src/components/icons/ThemedIcon'; +import { TransactionCalloutModal } from 'src/components/TransactionCalloutModal'; import { OpacityTransition } from 'src/components/transitions/OpacityTransition'; import { DISPLAY_DECIMALS } from 'src/config/consts'; +import { TxCallbacks } from 'src/contexts/blockchain/useBlockchain'; import { useProtocolContext } from 'src/contexts/protocol/ProtocolContext'; -import { TxCallbacks } from 'src/hooks/useBlockchain'; +import useModeChange from 'src/hooks/useModeChange'; +import { Mode } from 'src/types'; import { Token, toToken } from 'src/utils/tokens'; -import { Mode } from '../types'; import { BalanceTools } from './BalanceTools'; import { ReceiveSummary } from './ReceiveSummary'; -import { SubmitButton } from './SubmitButton'; import { TokenCard } from './TokenCard'; -import { TransactionCalloutModal } from './TransactionCalloutModal'; interface SwapFormProps { mode: Mode; @@ -22,7 +23,6 @@ interface SwapFormProps { setMaxAmount: () => void; onSubmit: (callbacks: TxCallbacks) => void; onChange: (amount?: Token) => void; - onModeChange: (mode: Mode) => void; } export const SwapForm = ({ @@ -34,7 +34,6 @@ export const SwapForm = ({ setMaxAmount, onSubmit, onChange, - onModeChange, }: SwapFormProps) => { const [isLoading, setIsLoading] = useState(false); const [isCalloutModalOpened, setIsCalloutModalOpened] = useState(false); @@ -46,17 +45,18 @@ export const SwapForm = ({ e.preventDefault(); setIsCalloutModalOpened(true); setIsLoading(true); - try { - await onSubmit({ onSent: () => setIsCalloutModalOpened(false) }); - await reloadProtocolContext(); - } finally { - setIsLoading(false); - setIsCalloutModalOpened(false); - } + onSubmit({ + onSent: () => { + setIsCalloutModalOpened(false); + setIsLoading(false); + void reloadProtocolContext(); + }, + }); }, [onSubmit, reloadProtocolContext] ); + const onModeChange = useModeChange(); return ( <>
@@ -71,7 +71,7 @@ export const SwapForm = ({ />
onModeChange(mode === 'stake' ? 'unstake' : 'stake')} + onClick={() => onModeChange(mode === Mode.stake ? Mode.unstake : Mode.stake)} >
@@ -101,10 +101,11 @@ interface FormInputProps { const getTitle = (error: string | null, mode: Mode) => { if (error) return {error}; switch (mode) { - case 'stake': - return 'Stake'; - case 'unstake': + case Mode.unstake: return 'Unstake'; + default: + case Mode.stake: + return 'Stake'; } }; @@ -129,7 +130,7 @@ const SwapFormInput = ({ return ( {getTitle(error, mode)} diff --git a/src/features/swap/hooks/useStaking.ts b/src/features/swap/hooks/useStaking.ts index f27d7c03..a661b9b3 100644 --- a/src/features/swap/hooks/useStaking.ts +++ b/src/features/swap/hooks/useStaking.ts @@ -1,62 +1,95 @@ -import BigNumber from 'bignumber.js'; import { useCallback, useMemo, useState } from 'react'; import { useAccountContext } from 'src/contexts/account/AccountContext'; +import { TxCallbacks, useBlockchain } from 'src/contexts/blockchain/useBlockchain'; import { useProtocolContext } from 'src/contexts/protocol/ProtocolContext'; +import { useGasPrices } from 'src/contexts/protocol/useGasPrices'; import { useAPI } from 'src/hooks/useAPI'; -import { TxCallbacks, useBlockchain } from 'src/hooks/useBlockchain'; -import { Celo, CeloUSD, StCelo } from 'src/utils/tokens'; -import { transactionEvent } from '../../../utils/ga'; -import { showStakingToast } from '../utils/toast'; +import { Mode } from 'src/types'; +import { transactionEvent } from 'src/utils/ga'; +import { Celo, CeloUSD, StCelo, Token } from 'src/utils/tokens'; +import { useContractWrite, usePublicClient } from 'wagmi'; +import { showErrorToast, showStakingToast } from '../utils/toast'; export function useStaking() { - const { address, loadBalances, celoBalance } = useAccountContext(); - const { managerContract, stCeloContract, sendTransaction } = useBlockchain(); + const { address, loadBalances, celoBalance, stCeloBalance } = useAccountContext(); + const { managerContract } = useBlockchain(); const { api } = useAPI(); - const { stakingRate, celoToUSDRate, suggestedGasPrice } = useProtocolContext(); + const { stakingRate, celoToUSDRate } = useProtocolContext(); + const { suggestedGasPrice } = useGasPrices(); const [celoAmount, setCeloAmount] = useState(null); + const publicClient = usePublicClient(); - const createTxOptions = useCallback(() => { - if (!address) throw new Error('Cannot create tx options without an address'); - return { from: address, value: celoAmount?.toFixed(), gasPrice: suggestedGasPrice }; - }, [address, celoAmount, suggestedGasPrice]); + const { writeAsync: _stake } = useContractWrite({ + ...managerContract, + functionName: 'deposit', + value: 0n, + }); - const depositTx = useCallback(() => managerContract.methods.deposit(), [managerContract]); + const stake = useCallback( + async (callbacks?: TxCallbacks) => { + if (!address || !celoAmount || celoAmount.isEqualTo(0) || !stCeloBalance || !loadBalances) { + return; + } - const stake = async (callbacks?: TxCallbacks) => { - if (!address || !celoAmount || celoAmount.isEqualTo(0)) return; - const preDepositStTokenBalance = new StCelo( - await stCeloContract.methods.balanceOf(address).call() - ); - transactionEvent({ - action: 'stake', - status: 'initiated_transaction', - value: celoAmount.displayAsBase(), - }); - await sendTransaction(depositTx(), createTxOptions(), callbacks); - transactionEvent({ - action: 'stake', - status: 'signed_transaction', - value: celoAmount.displayAsBase(), - }); - api.activate(); - await loadBalances(); - const postDepositStTokenBalance = new StCelo( - await stCeloContract.methods.balanceOf(address).call() - ); - const receivedStCelo = new StCelo(postDepositStTokenBalance.minus(preDepositStTokenBalance)); - showStakingToast(receivedStCelo); - setCeloAmount(null); - }; + const preDepositStTokenBalance = stCeloBalance!; + transactionEvent({ + action: Mode.stake, + status: 'initiated_transaction', + value: celoAmount.displayAsBase(), + }); + try { + await _stake({ value: celoAmount?.toBigInt() }); + transactionEvent({ + action: Mode.stake, + status: 'signed_transaction', + value: celoAmount.displayAsBase(), + }); + await api.activate(); + const [{ data: _celoBalance }, { data: _stCeloBalance }] = await loadBalances(); + const postDepositStTokenBalance = new StCelo(_stCeloBalance); + const receivedStCelo = new StCelo( + postDepositStTokenBalance.minus(preDepositStTokenBalance) + ); + showStakingToast(receivedStCelo); + setCeloAmount(null); + } catch (e: unknown) { + console.error(e); + showErrorToast( + (e as Error).message.includes('rejected') + ? 'User rejected the request' + : (e as Error).message + ); + } finally { + callbacks?.onSent?.(); + } + }, + [address, api, celoAmount, loadBalances, publicClient, stCeloBalance] + ); const estimateStakingGas = useCallback(async () => { - if (!celoAmount || celoAmount.isEqualTo(0) || celoAmount.isGreaterThan(celoBalance)) { + if ( + !celoAmount || + celoAmount.isEqualTo(0) || + celoAmount.isGreaterThan(celoBalance) || + !address || + !managerContract.address + ) { return null; } - const gasFee = new BigNumber(await depositTx().estimateGas(createTxOptions())); + + const gasFee = new Token( + await publicClient.estimateContractGas({ + abi: managerContract.abi, + address: managerContract.address!, + account: address!, + functionName: 'deposit', + value: celoAmount.toBigInt(), + }) + ); const gasFeeInCelo = new Celo(gasFee.multipliedBy(suggestedGasPrice)); const gasFeeInUSD = new CeloUSD(gasFeeInCelo.multipliedBy(celoToUSDRate)); return gasFeeInUSD; - }, [createTxOptions, depositTx, celoBalance, celoAmount, celoToUSDRate, suggestedGasPrice]); + }, [celoAmount, celoBalance, managerContract, publicClient, suggestedGasPrice, celoToUSDRate]); const receivedStCelo = useMemo( () => (celoAmount ? new StCelo(celoAmount.multipliedBy(stakingRate).dp(0)) : null), diff --git a/src/features/swap/hooks/useSwap.ts b/src/features/swap/hooks/useSwap.ts index 412b4ea2..5cc87d6d 100644 --- a/src/features/swap/hooks/useSwap.ts +++ b/src/features/swap/hooks/useSwap.ts @@ -1,10 +1,11 @@ +import BigNumber from 'bignumber.js'; import { useCallback, useEffect, useState } from 'react'; import { MAX_AMOUNT_THRESHOLD } from 'src/config/consts'; import { useAccountContext } from 'src/contexts/account/AccountContext'; +import { TxCallbacks } from 'src/contexts/blockchain/useBlockchain'; import { useProtocolContext } from 'src/contexts/protocol/ProtocolContext'; -import { TxCallbacks } from 'src/hooks/useBlockchain'; +import { Mode } from 'src/types'; import { Celo, CeloUSD, StCelo, Token } from 'src/utils/tokens'; -import { Mode } from '../types'; import { useStaking } from './useStaking'; import { useUnstaking } from './useUnstaking'; @@ -24,16 +25,7 @@ export function useSwap(mode: Mode) { let setAmount: (amount?: Token) => void; switch (mode) { - case 'stake': - balance = celoBalance; - amount = celoAmount; - receiveAmount = receivedStCelo; - swapRate = stakingRate; - estimateGas = estimateStakingGas; - swap = stake; - setAmount = (amount?: Token) => setCeloAmount(!amount ? null : new Celo(amount)); - break; - case 'unstake': + case Mode.unstake: balance = stCeloBalance; amount = stCeloAmount; receiveAmount = receivedCelo; @@ -42,10 +34,20 @@ export function useSwap(mode: Mode) { swap = unstake; setAmount = (amount?: Token) => setStCeloAmount(!amount ? null : new StCelo(amount)); break; + default: + case Mode.stake: + balance = celoBalance; + amount = celoAmount; + receiveAmount = receivedStCelo; + swapRate = stakingRate; + estimateGas = estimateStakingGas; + swap = stake; + setAmount = (amount?: Token) => setCeloAmount(!amount ? null : new Celo(amount)); + break; } const setMaxAmount = useCallback(() => { - const maxAmount = new Token(balance.minus(MAX_AMOUNT_THRESHOLD)); + const maxAmount = new Token(BigNumber.max(0, balance.minus(MAX_AMOUNT_THRESHOLD.toString()))); setAmount(maxAmount); }, [setAmount, balance]); @@ -62,9 +64,9 @@ export function useSwap(mode: Mode) { // When switching modes expected received amount should be set as provided amount // Because receiveAmount is updated after mode is changed we need to perform instance type check useEffect(() => { - if (mode === 'stake' && (!receiveAmount || receiveAmount instanceof StCelo)) { + if (mode === Mode.stake && (!receiveAmount || receiveAmount instanceof StCelo)) { setStCeloAmount(receiveAmount); - } else if (mode === 'unstake' && (!receiveAmount || receiveAmount instanceof Celo)) { + } else if (mode === Mode.unstake && (!receiveAmount || receiveAmount instanceof Celo)) { setCeloAmount(receiveAmount); } }, [mode, receiveAmount, setCeloAmount, setStCeloAmount]); diff --git a/src/features/swap/hooks/useUnstaking.ts b/src/features/swap/hooks/useUnstaking.ts index 64f45a51..695ce20a 100644 --- a/src/features/swap/hooks/useUnstaking.ts +++ b/src/features/swap/hooks/useUnstaking.ts @@ -1,58 +1,107 @@ -import BigNumber from 'bignumber.js'; import { useCallback, useMemo, useState } from 'react'; import { useAccountContext } from 'src/contexts/account/AccountContext'; +import { TxCallbacks, useBlockchain } from 'src/contexts/blockchain/useBlockchain'; import { useProtocolContext } from 'src/contexts/protocol/ProtocolContext'; +import { useGasPrices } from 'src/contexts/protocol/useGasPrices'; import { useAPI } from 'src/hooks/useAPI'; -import { TxCallbacks, useBlockchain } from 'src/hooks/useBlockchain'; -import { Celo, CeloUSD, StCelo } from 'src/utils/tokens'; +import { Mode } from 'src/types'; +import { Celo, CeloUSD, StCelo, Token } from 'src/utils/tokens'; +import { useContractWrite, usePublicClient } from 'wagmi'; import { transactionEvent } from '../../../utils/ga'; -import { showUnstakingToast } from '../utils/toast'; +import { showErrorToast, showUnstakingToast } from '../utils/toast'; export function useUnstaking() { const { address, loadBalances, loadPendingWithdrawals, stCeloBalance } = useAccountContext(); - const { managerContract, sendTransaction } = useBlockchain(); + const { managerContract } = useBlockchain(); const { api } = useAPI(); - const { unstakingRate, celoToUSDRate, suggestedGasPrice } = useProtocolContext(); + const { unstakingRate, celoToUSDRate } = useProtocolContext(); + const { suggestedGasPrice } = useGasPrices(); const [stCeloAmount, setStCeloAmount] = useState(null); + const publicClient = usePublicClient(); - const createTxOptions = useCallback(() => { - if (!address) throw new Error('Cannot create tx options without an address'); - return { from: address, gasPrice: suggestedGasPrice }; - }, [address, suggestedGasPrice]); + const params = { + functionName: 'withdraw', + args: [stCeloAmount?.toBigInt() || 0n] as const, + } as const; - const withdrawTx = useCallback( - () => stCeloAmount && managerContract.methods.withdraw(stCeloAmount.toFixed()), - [managerContract, stCeloAmount] - ); + const { writeAsync: _unstake } = useContractWrite({ + ...managerContract, + ...params, + }); - const unstake = async (callbacks?: TxCallbacks) => { - if (!address || !stCeloAmount || stCeloAmount.isEqualTo(0)) return; - transactionEvent({ - action: 'unstake', - status: 'initiated_transaction', - value: stCeloAmount.displayAsBase(), - }); - await sendTransaction(withdrawTx(), createTxOptions(), callbacks); - transactionEvent({ - action: 'unstake', - status: 'signed_transaction', - value: stCeloAmount.displayAsBase(), - }); - api.withdraw(address); - await Promise.all([loadBalances(), loadPendingWithdrawals()]); - showUnstakingToast(); - setStCeloAmount(null); - }; + const unstake = useCallback( + async (callbacks?: TxCallbacks) => { + if ( + !address || + !stCeloAmount || + stCeloAmount.isEqualTo(0) || + !managerContract || + !loadBalances + ) + return; + + transactionEvent({ + action: Mode.unstake, + status: 'signed_transaction', + value: stCeloAmount.displayAsBase(), + }); + try { + await _unstake(); + await api.withdraw(address); + showUnstakingToast(); + await Promise.all([loadBalances(), loadPendingWithdrawals?.()]); + setStCeloAmount(null); + } catch (e: unknown) { + console.error(e); + showErrorToast( + (e as Error).message.includes('rejected') + ? 'User rejected the request' + : (e as Error).message + ); + } finally { + callbacks?.onSent?.(); + } + }, + [ + address, + api, + loadBalances, + loadPendingWithdrawals, + managerContract, + publicClient, + stCeloAmount, + ] + ); const estimateUnstakingGas = useCallback(async () => { - if (!stCeloAmount || stCeloAmount.isEqualTo(0) || stCeloAmount.isGreaterThan(stCeloBalance)) { + if ( + !stCeloAmount || + stCeloAmount.isEqualTo(0) || + stCeloAmount.isGreaterThan(stCeloBalance) || + !managerContract + ) { return null; } - const gasFee = new BigNumber(await withdrawTx().estimateGas(createTxOptions())); + + const gasFee = new Token( + await publicClient.estimateContractGas({ + abi: managerContract.abi, + address: managerContract.address!, + account: address!, + ...params, + }) + ); const gasFeeInCelo = new Celo(gasFee.multipliedBy(suggestedGasPrice)); const gasFeeInUSD = new CeloUSD(gasFeeInCelo.multipliedBy(celoToUSDRate)); return gasFeeInUSD; - }, [withdrawTx, createTxOptions, stCeloBalance, stCeloAmount, celoToUSDRate, suggestedGasPrice]); + }, [ + stCeloAmount, + stCeloBalance, + managerContract, + publicClient, + suggestedGasPrice, + celoToUSDRate, + ]); const receivedCelo = useMemo( () => (stCeloAmount ? new Celo(stCeloAmount.multipliedBy(unstakingRate).dp(0)) : null), diff --git a/src/features/swap/types/index.ts b/src/features/swap/types/index.ts deleted file mode 100644 index 783aad73..00000000 --- a/src/features/swap/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type Mode = 'stake' | 'unstake'; diff --git a/src/features/swap/utils/toast.tsx b/src/features/swap/utils/toast.tsx index f2b21b5c..95f4a3ac 100644 --- a/src/features/swap/utils/toast.tsx +++ b/src/features/swap/utils/toast.tsx @@ -1,7 +1,9 @@ import Image from 'next/image'; import { PropsWithChildren } from 'react'; +import { ThemedIcon } from 'src/components/icons/ThemedIcon'; import { TokenIcon } from 'src/components/icons/TokenIcon'; import Clock from 'src/images/icons/clock.svg'; +import { VoteType } from 'src/types'; import { showToast } from 'src/utils/toast'; import { StCelo } from 'src/utils/tokens'; @@ -22,3 +24,23 @@ export const showUnstakingToast = () => Clock, You started unstaking, funds available in 3 days. ); + +export const showElectionToast = () => { + showToast( + , + Validator Group Selection Strategy Changed + ); +}; + +export const showVoteToast = ({ vote, proposalID }: { vote: VoteType; proposalID: string }) => { + showToast( + , + + Voted {vote} for proposal #{proposalID} + + ); +}; + +export const showErrorToast = (message: string) => { + showToast(, {message}); +}; diff --git a/src/features/swap/utils/validation.ts b/src/features/swap/utils/validation.ts index 54456f2d..6a5f49e3 100644 --- a/src/features/swap/utils/validation.ts +++ b/src/features/swap/utils/validation.ts @@ -1,11 +1,11 @@ +import { Mode } from 'src/types'; import { Token } from 'src/utils/tokens'; -import { Mode } from '../types'; export const validateAmount = (amount: Token | null, balance: Token, mode: Mode) => { if (!amount) return null; - if (amount.isLessThan(0)) return 'Amount cannot be negative'; + if (amount.isLessThanOrEqualTo(0)) return 'Amount cannot be negative or zero'; if (balance.isLessThan(amount)) { - return `Not enough ${mode === 'stake' ? 'CELO' : 'stCELO'}`; + return `Not enough ${mode === Mode.stake ? 'CELO' : 'stCELO'}`; } return null; }; diff --git a/src/features/validators/components/Details.tsx b/src/features/validators/components/Details.tsx new file mode 100644 index 00000000..84db42d7 --- /dev/null +++ b/src/features/validators/components/Details.tsx @@ -0,0 +1,123 @@ +import { ConnectButton } from '@rainbow-me/rainbowkit'; +import { FormEvent, useEffect, useState } from 'react'; +import { useAsyncCallback } from 'react-use-async-callback'; +import { BackToListButton } from 'src/components/buttons/BackToListButton'; +import { SubmitButton } from 'src/components/buttons/SubmitButton'; +import { ContainerSecondaryBG } from 'src/components/containers/ContainerSecondaryBG'; +import { LinkOut } from 'src/components/text/LinkOut'; +import { TertiaryCallout } from 'src/components/text/TertiaryCallout'; +import { TransactionCalloutModal } from 'src/components/TransactionCalloutModal'; +import { ADDRESS_ZERO, EXPLORER_ALFAJORES_URL, EXPLORER_MAINNET_URL } from 'src/config/consts'; +import { useAccountContext } from 'src/contexts/account/AccountContext'; + +import { Alfajores } from '@celo/rainbowkit-celo/chains'; +import { useChangeStrategy } from 'src/features/validators/hooks/useChangeStrategy'; +import { removeAddressMiddle } from 'src/features/validators/removeAddressMiddle'; +import { useIsTransitioning } from 'src/hooks/useIsTransitioning'; +import { CenteredLayout } from 'src/layout/CenteredLayout'; +import { Mode } from 'src/types'; +import { Address, useChainId } from 'wagmi'; +interface Props { + groupAddress: Address; + name?: string; +} + +export const Details = ({ groupAddress, name }: Props) => { + const isTransitioning = useIsTransitioning(); + const [isTransactionModalOpen, setTransactionModalOpen] = useState(false); + const chainId = useChainId(); + const { loadBalances, stCeloBalance, isConnected, strategy } = useAccountContext(); + const displayName = name || removeAddressMiddle(groupAddress); + const { changeStrategy } = useChangeStrategy(); + + useEffect(() => { + if (isConnected) { + loadBalances?.(); + } + }, [loadBalances, isConnected]); + + const [onSubmit, { isExecuting }] = useAsyncCallback( + async (event: FormEvent) => { + event.preventDefault(); + setTransactionModalOpen(true); + return changeStrategy(groupAddress, { onSent: () => setTransactionModalOpen(false) }); + }, + [groupAddress] + ); + + const explorerLink = chainId === Alfajores.id ? EXPLORER_ALFAJORES_URL : EXPLORER_MAINNET_URL; + const infoLink = + groupAddress === ADDRESS_ZERO + ? 'https://docs.stcelo.xyz/voting-for-validator-groups' + : `https://thecelo.com/groupDetail/${groupAddress}`; + + return ( + + + +
+
+ + + + {groupAddress} + + + view info + +
+
+ + {isConnected && ( + <> + {'Your '} + {stCeloBalance.displayAsBase(true)} + {' stCELO '} + {strategy === groupAddress ? 'is voting for' : 'will vote for'}{' '} + {truncateIfLong(displayName)} + + )} + +
+
+ {isConnected ? ( + + ) : ( + + )} +
+
+ setTransactionModalOpen(false)} + /> + + ); +}; + +function nameSize(name: string) { + if (name.length < 30) { + return 'text-2xl'; + } else if (name.length < 40) { + return 'text-lg'; + } else { + return 'text-base'; + } +} + +function truncateIfLong(word: string) { + const maxLength = 26; + if (word.length < maxLength) { + return word; + } + return word.slice(0, maxLength - 2) + '…'; +} diff --git a/src/features/validators/components/List.tsx b/src/features/validators/components/List.tsx new file mode 100644 index 00000000..30e86b52 --- /dev/null +++ b/src/features/validators/components/List.tsx @@ -0,0 +1,65 @@ +import { Celo } from '@celo/rainbowkit-celo/chains'; +import { useMemo } from 'react'; +import { LinkOut } from 'src/components/text/LinkOut'; +import { SPECIFIC_GROUP_STRATEGY_MAINNET_ADDRESS } from 'src/config/consts'; +import { useAccountContext } from 'src/contexts/account/AccountContext'; +import { ValidatorGroupRow } from 'src/features/validators/components/ValidatorGroupRow'; +import { ValidatorGroup } from 'src/features/validators/data/fetchValidGroups'; +import { CenteredLayout } from 'src/layout/CenteredLayout'; +import chainIdToChain from 'src/utils/chainIdToChain'; +import { useChainId } from 'wagmi'; + +interface ValidatorsProps { + list: ValidatorGroup[]; +} + +const defaultStrategy: ValidatorGroup = { + name: 'Default Strategy', + address: '0x0000000000000000000000000000000000000000', +}; + +export const Validators = ({ list }: ValidatorsProps) => { + const { strategy } = useAccountContext(); + + const fullList = useMemo(() => { + return [ + defaultStrategy, + ...list.sort((a, b) => { + return a.address === strategy ? -1 : b.address === strategy ? -1 : 0; + }), + ]; + }, [list, strategy]); + + const chainId = useChainId(); + const chain = chainIdToChain(chainId); + + // It means the contracts aren't deployed yet + if (SPECIFIC_GROUP_STRATEGY_MAINNET_ADDRESS === '' && chain === Celo) { + return ( + +
+ This is where you'll be select which validator group will be voting on your behalf when + the contracts are deployed on Mainnet. +
+ You can{' '} + + follow the progress here + +
+
+ ); + } + + return ( +
    + {fullList.map((vg) => ( + + ))} +
+ ); +}; diff --git a/src/features/validators/components/ValidatorGroupRow.tsx b/src/features/validators/components/ValidatorGroupRow.tsx new file mode 100644 index 00000000..c3310ab6 --- /dev/null +++ b/src/features/validators/components/ValidatorGroupRow.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { Row } from 'src/components/list/row'; +import { removeAddressMiddle } from 'src/features/validators/removeAddressMiddle'; +import { appendChainIdToLink } from 'src/utils/appendChainIdToLink'; +import { useChainId } from 'wagmi'; +const ADDRESS_SLICE_POINT_LAST_PART = 37; + +interface Props { + name?: string; + groupAddress: string; + isCurrentStrategy?: boolean; +} + +export const ValidatorGroupRow = React.memo(({ name, groupAddress, isCurrentStrategy }: Props) => { + const displayName = name || removeAddressMiddle(groupAddress); + const baseHref = `validators/${groupAddress}`; + const chainId = useChainId(); + const href = appendChainIdToLink(baseHref, chainId); + + const truncatedAddress = groupAddress.slice(ADDRESS_SLICE_POINT_LAST_PART); + + return ( + + …{truncatedAddress} + + ); +}); + +ValidatorGroupRow.displayName = 'ValidatorGroupRow'; diff --git a/src/features/validators/data/fetchValidGroups.ts b/src/features/validators/data/fetchValidGroups.ts new file mode 100644 index 00000000..31e280fe --- /dev/null +++ b/src/features/validators/data/fetchValidGroups.ts @@ -0,0 +1,60 @@ +import { Alfajores, Celo } from '@celo/rainbowkit-celo/chains'; +import { gql, request } from 'graphql-request'; +import { EXPLORER_GRAPH_ALFAJORES_URL, EXPLORER_GRAPH_MAINNET_URL } from 'src/config/consts'; +import { healthyGroupsOnly } from 'src/features/validators/data/healthyGroupsOnly'; +import { nonBlockedGroupsOnly } from 'src/features/validators/data/nonBlockedGroupsOnly'; + +export interface ValidatorGroup { + name: string; + address: string; +} + +const query = gql` + { + celoValidatorGroups { + name + address + } + } +`; + +interface GraphValues { + celoValidatorGroups: ValidatorGroup[]; +} + +interface ValidGroups { + chainId: number; + groups: ValidatorGroup[]; +} + +// returns ValidatorGroups that are healthy and not blocked based on +// criteria defined i https://github.com/celo-org/staked-celo/blob/master/contracts/Manager.sol#L348 +export default async function fetchValidGroups(chainId: number): Promise { + const url = Alfajores.id === chainId ? EXPLORER_GRAPH_ALFAJORES_URL : EXPLORER_GRAPH_MAINNET_URL; + const data = await request(url, query); + + const allPossibleGroups = data.celoValidatorGroups; + + const groupAddresses = allPossibleGroups.map((group) => group.address); + + // TODO remove this once contracts are deployed to mainnet + // only while no contracts deployed return now so its doesnt crash + if (chainId === Celo.id) { + return { + chainId: chainId, + groups: allPossibleGroups, + }; + } + + const [healthyGroups, nonBlockedGroups] = await Promise.all( + [healthyGroupsOnly, nonBlockedGroupsOnly].map((fn) => fn(groupAddresses, chainId)) + ); + const validGroups = allPossibleGroups.filter( + (group) => healthyGroups.has(group.address) && nonBlockedGroups.has(group.address) + ); + + return { + chainId: chainId, + groups: validGroups, + }; +} diff --git a/src/features/validators/data/getGoodAddresses.ts b/src/features/validators/data/getGoodAddresses.ts new file mode 100644 index 00000000..c85af5f8 --- /dev/null +++ b/src/features/validators/data/getGoodAddresses.ts @@ -0,0 +1,13 @@ +// results is an array of booleans that correspond to the groupAddresses block status +// good: because we want the non blocked groups good is false, but true for getting health groups. +export function getGoodAddresses(results: boolean[], groupAddresses: string[], good = false) { + if (results.length !== groupAddresses.length) { + throw new Error('results and groupAddresses must be the same length'); + } + return results.reduce>((goodies, result, index) => { + if (result === good) { + goodies.add(groupAddresses[index]); + } + return goodies; + }, new Set()); +} diff --git a/src/features/validators/data/getGroupName.ts b/src/features/validators/data/getGroupName.ts new file mode 100644 index 00000000..18768c0f --- /dev/null +++ b/src/features/validators/data/getGroupName.ts @@ -0,0 +1,22 @@ +import { accountsABI } from '@celo/abis/types/wagmi'; +import { ADDRESS_ZERO } from 'src/config/consts'; +import celoRegistry from 'src/utils/celoRegistry'; +import clients from 'src/utils/clients'; +import { Address, getContract } from 'viem'; + +export default async function getGroupName(chainId: number, address: Address): Promise { + const publicClient = clients[chainId]; + if (address === ADDRESS_ZERO) { + return 'Default Strategy'; + } + const registryContract = getContract({ ...celoRegistry, publicClient }); + const accountsAddress = await registryContract.read.getAddressForString(['Accounts']); + const accountsContract = getContract({ + address: accountsAddress, + abi: accountsABI, + publicClient, + }); + + const groupName: string = (await accountsContract.read.getName([address])) as string; + return groupName; +} diff --git a/src/features/validators/data/healthyGroupsOnly.ts b/src/features/validators/data/healthyGroupsOnly.ts new file mode 100644 index 00000000..6ab2dbf6 --- /dev/null +++ b/src/features/validators/data/healthyGroupsOnly.ts @@ -0,0 +1,36 @@ +import GroupHealthABI from 'src/blockchain/ABIs/GroupHealth'; +import { getContractAddressForChain } from 'src/config/contracts'; +import clients from 'src/utils/clients'; +import { Address, getContract } from 'viem'; +import { getGoodAddresses } from './getGoodAddresses'; + +// once complete will return all the addresses of groups that are healthy +export async function healthyGroupsOnly( + groupAddresses: string[], + chainId: number +): Promise> { + const client = clients[chainId]; + const GroupHealthContract = getContract({ + abi: GroupHealthABI, + address: getContractAddressForChain(chainId, 'groupHealth'), + publicClient: client, + }); + + const calls = groupAddresses.map((groupAddress) => ({ + address: getContractAddressForChain(chainId, 'groupHealth'), + abi: GroupHealthABI, + functionName: 'isGroupValid', + args: [groupAddress] as [Address], + })); + + let results: boolean[] = []; + try { + results = (await client.multicall({ contracts: calls })).map((x) => x.result as boolean); + } catch (error) { + results = await Promise.all( + calls.map((call) => GroupHealthContract.read.isGroupValid(call.args) as Promise) + ); + } + + return getGoodAddresses(results, groupAddresses, true); +} diff --git a/src/features/validators/data/nonBlockedGroupsOnly.ts b/src/features/validators/data/nonBlockedGroupsOnly.ts new file mode 100644 index 00000000..9e986b59 --- /dev/null +++ b/src/features/validators/data/nonBlockedGroupsOnly.ts @@ -0,0 +1,38 @@ +import SpecificGroupStrategyABI from 'src/blockchain/ABIs/SpecificGroupStrategy'; +import { getContractAddressForChain } from 'src/config/contracts'; +import clients from 'src/utils/clients'; +import { Address, getContract } from 'viem'; +import { getGoodAddresses } from './getGoodAddresses'; + +// once complete will return all the addresses of groups that are not blocked +export async function nonBlockedGroupsOnly( + groupAddresses: string[], + chainId: number +): Promise> { + const client = clients[chainId]; + const specificGroupStrategyContract = getContract({ + abi: SpecificGroupStrategyABI, + address: getContractAddressForChain(chainId, 'specificGroupStrategy'), + publicClient: client, + }); + + const calls = groupAddresses.map((groupAddress) => ({ + address: getContractAddressForChain(chainId, 'specificGroupStrategy'), + abi: SpecificGroupStrategyABI, + functionName: 'isBlockedGroup', + args: [groupAddress] as [Address], + })); + + let results: boolean[] = []; + try { + results = (await client.multicall({ contracts: calls })).map((x) => x.result as boolean); + } catch (error) { + results = await Promise.all( + calls.map( + (call) => specificGroupStrategyContract.read.isBlockedGroup(call.args) as Promise + ) + ); + } + + return getGoodAddresses(results, groupAddresses); +} diff --git a/src/features/validators/hooks/useChangeStrategy.ts b/src/features/validators/hooks/useChangeStrategy.ts new file mode 100644 index 00000000..3c857e89 --- /dev/null +++ b/src/features/validators/hooks/useChangeStrategy.ts @@ -0,0 +1,57 @@ +import { useAsyncCallback } from 'react-use-async-callback'; +import { useAccountContext } from 'src/contexts/account/AccountContext'; +import { TxCallbacks, useBlockchain } from 'src/contexts/blockchain/useBlockchain'; +import { showElectionToast, showErrorToast } from 'src/features/swap/utils/toast'; +import { transactionEvent } from 'src/utils/ga'; +import { Address, useAccount, useContractWrite } from 'wagmi'; + +export const useChangeStrategy = () => { + const { managerContract } = useBlockchain(); + const { reloadStrategy } = useAccountContext(); + const { address } = useAccount(); + + const { writeAsync: _changeStrategy } = useContractWrite({ + ...managerContract, + functionName: 'changeStrategy', + }); + + /* + * @param groupAddress the address of validator group OR 0 for default + */ + const [changeStrategy, status] = useAsyncCallback( + async (groupAddress: Address, callbacks?: TxCallbacks) => { + if (!address || !managerContract) { + throw new Error('change strategy called before loading completed'); + } + transactionEvent({ + action: 'changeStrategy', + status: 'initiated_transaction', + value: '', + }); + try { + await _changeStrategy?.({ + args: [groupAddress], + }); + transactionEvent({ + action: 'changeStrategy', + status: 'signed_transaction', + value: '', + }); + showElectionToast(); + await reloadStrategy?.(); + } catch (e: unknown) { + console.error(e); + showErrorToast( + (e as Error).message.includes('rejected') + ? 'User rejected the request' + : (e as Error).message + ); + } finally { + callbacks?.onSent?.(); + } + }, + [address, managerContract, reloadStrategy] + ); + + return { changeStrategy, ...status }; +}; diff --git a/src/features/validators/removeAddressMiddle.tsx b/src/features/validators/removeAddressMiddle.tsx new file mode 100644 index 00000000..306abd2b --- /dev/null +++ b/src/features/validators/removeAddressMiddle.tsx @@ -0,0 +1,5 @@ +const ADDRESS_SLICE_POINT_A = 6; +const ADDRESS_SLICE_POINT_B = 38; +export function removeAddressMiddle(addr: string) { + return `${addr.slice(0, ADDRESS_SLICE_POINT_A)}…${addr.slice(ADDRESS_SLICE_POINT_B)}`; +} diff --git a/src/features/wallet/components/WalletButton.tsx b/src/features/wallet/components/WalletButton.tsx index 211d036a..1e0f7700 100644 --- a/src/features/wallet/components/WalletButton.tsx +++ b/src/features/wallet/components/WalletButton.tsx @@ -1,29 +1,42 @@ -import { useMemo, useState } from 'react'; +import { useAccountModal, useChainModal } from '@rainbow-me/rainbowkit'; +import { useMemo } from 'react'; import { IndicatorIcon } from 'src/components/icons/IndicatorIcon'; import { Label } from 'src/components/text/Label'; import { useAccountContext } from 'src/contexts/account/AccountContext'; -import { WalletModal } from './WalletModal'; +import chainIdToChain from 'src/utils/chainIdToChain'; +import { useChainId } from 'wagmi'; export const WalletButton = () => { - const [isModalOpened, setIsModalOpened] = useState(false); const { address } = useAccountContext(); + const chainId = useChainId(); + const { openAccountModal } = useAccountModal(); + const { openChainModal } = useChainModal(); const addressLabel = useMemo(() => { return address ? `${address.slice(0, 2)}...${address.slice(-4)}` : ''; }, [address]); + const chainLabel = useMemo(() => { + return chainId ? chainIdToChain(chainId).name : ''; + }, [chainId]); + const flexClasses = 'inline-flex items-center'; const paddingClasses = 'py-[2px] md:py-[8px] px-[9px] md:px-[16px]'; return ( - <> +
+ openChainModal?.()} + > + + setIsModalOpened(true)} + onClick={() => openAccountModal?.()} > - setIsModalOpened(false)} /> - +
); }; diff --git a/src/features/wallet/components/WalletModal.tsx b/src/features/wallet/components/WalletModal.tsx deleted file mode 100644 index 00263eaa..00000000 --- a/src/features/wallet/components/WalletModal.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import Image from 'next/image'; -import { PropsWithChildren, useCallback, useMemo } from 'react'; -import { IndicatorIcon } from 'src/components/icons/IndicatorIcon'; -import { Modal } from 'src/components/modals/Modal'; -import { Label } from 'src/components/text/Label'; -import { useAccountContext } from 'src/contexts/account/AccountContext'; -import Close from 'src/images/icons/close.svg'; -import { useWallet } from '../hooks/useWallet'; - -interface WalletModalProps { - isOpen: boolean; - close: () => void; -} - -export const WalletModal = ({ isOpen, close }: WalletModalProps) => { - const { changeWallet, disconnectWallet, changingWallet } = useWallet(); - const { address } = useAccountContext(); - - const changeWalletWithClose = useCallback(async () => { - const walletChanged = await changeWallet(); - if (walletChanged) close(); - }, [changeWallet, close]); - - const disconnectWalletWithClose = useCallback(async () => { - await disconnectWallet(); - close(); - }, [disconnectWallet, close]); - - const displayAddress: string = useMemo(() => { - if (!address) return ''; - const relevantNumbers = address.slice(2); - return `0x ${relevantNumbers.replaceAll(/([0-9a-zA-Z]{4})/g, '$1 ')}`; - }, [address]); - - return ( - -
-
-
- - -
- - Close button - -
-
-
-
-

Wallet address

- -
-

{displayAddress}

-
- Change Wallet - Disconnect -
-
-
- ); -}; - -interface WalletModalActionProps { - action: () => void; -} - -const WalletModalAction = ({ children, action }: PropsWithChildren) => { - return ( - - ); -}; diff --git a/src/features/wallet/hooks/useWallet.ts b/src/features/wallet/hooks/useWallet.ts deleted file mode 100644 index 39f8df85..00000000 --- a/src/features/wallet/hooks/useWallet.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { useCelo } from '@celo/react-celo'; -import { useCallback, useState } from 'react'; -import logger from 'src/services/logger'; -import { walletEvent } from '../../../utils/ga'; - -export function useWallet() { - const { connect, destroy, walletType } = useCelo(); - - const connectWallet = useCallback(async () => { - try { - walletEvent({ - action: 'connect-wallet', - status: 'initiated', - label: 'N/A', - }); - const connection = await connect(); - - walletEvent({ - action: 'connect-wallet', - status: 'completed', - label: connection.type.toString(), - }); - return true; - } catch (error: any) { - logger.error(error?.message); - return false; - } - }, [connect]); - - const disconnectWallet = useCallback(async () => { - try { - walletEvent({ - action: 'disconnect-wallet', - status: 'initiated', - label: walletType.toString(), - }); - await destroy(); - - walletEvent({ - action: 'disconnect-wallet', - status: 'completed', - label: 'N/A', - }); - return true; - } catch (error: any) { - logger.error(error?.message); - return false; - } - }, [destroy]); - - const [changingWallet, setChangingWallet] = useState(false); - const changeWallet = useCallback(async (): Promise => { - setChangingWallet(true); - const changed = await connectWallet(); - setChangingWallet(false); - return changed; - }, [connectWallet]); - - return { - connectWallet, - disconnectWallet, - changeWallet, - changingWallet, - }; -} diff --git a/src/hooks/useAPI.ts b/src/hooks/useAPI.ts index 425aaadb..c17975c4 100644 --- a/src/hooks/useAPI.ts +++ b/src/hooks/useAPI.ts @@ -1,15 +1,15 @@ -import { useCelo } from '@celo/react-celo'; +import { Celo } from '@celo/rainbowkit-celo/chains'; import { useMemo } from 'react'; import { mainnetAPIUrl, testnetAPIUrl } from 'src/config/services'; import { createAPI } from 'src/services/api'; +import { useChainId } from 'wagmi'; export function useAPI() { - const { network } = useCelo(); - + const chainId = useChainId(); const api = useMemo(() => { - if (network.name === 'Mainnet') return createAPI(mainnetAPIUrl); + if (chainId === Celo.id) return createAPI(mainnetAPIUrl); return createAPI(testnetAPIUrl); - }, [network]); + }, [chainId]); return { api }; } diff --git a/src/hooks/useAddresses.ts b/src/hooks/useAddresses.ts new file mode 100644 index 00000000..dbc80e5e --- /dev/null +++ b/src/hooks/useAddresses.ts @@ -0,0 +1,15 @@ +import { Celo } from '@celo/rainbowkit-celo/chains'; +import { useMemo } from 'react'; +import { mainnetAddresses, testnetAddresses } from 'src/config/contracts'; +import { usePublicClient } from 'wagmi'; + +export default function useAddresses() { + const publicClient = usePublicClient(); + + const addresses = useMemo(() => { + if (publicClient.chain.id === Celo.id) return mainnetAddresses; + return testnetAddresses; + }, [publicClient]); + + return addresses; +} diff --git a/src/hooks/useBlockchain.ts b/src/hooks/useBlockchain.ts deleted file mode 100644 index 09cbdab5..00000000 --- a/src/hooks/useBlockchain.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { ContractKit, newKit } from '@celo/contractkit'; -import { useCelo } from '@celo/react-celo'; -import { COMPLIANT_ERROR_RESPONSE } from 'compliance-sdk'; -import { useCallback, useEffect, useMemo, useState } from 'react'; -import AccountABI from 'src/blockchain/ABIs/Account.json'; -import ManagerABI from 'src/blockchain/ABIs/Manager.json'; -import StCeloABI from 'src/blockchain/ABIs/StakedCelo.json'; -import { mainnetAddresses, testnetAddresses } from 'src/config/contracts'; -import { isSanctionedAddress } from 'src/utils/sanctioned'; -import { AbiItem } from 'web3-utils'; - -interface TxOptions { - from: string; - value?: string; -} - -export interface TxCallbacks { - onSent?: () => void; -} - -type EpochRewardsContract = Awaited>; -type SortedOraclesContract = Awaited>; -type StableTokenContract = Awaited>; -type GasPriceMinimumContract = Awaited>; - -export function useBlockchain() { - const { kit, network } = useCelo(); - const contractKit = useMemo(() => newKit(network.rpcUrl), [network]); - - // react-celo doesn't update network when it's changed second time - // Hence we need to reload application after the first change - const [currentNetwork, setCurrentNetwork] = useState(null); - useEffect(() => { - if (!network.name) return; - if (!currentNetwork) { - setCurrentNetwork(network.name); - return; - } - if (currentNetwork !== network.name) location.reload(); - }, [network, currentNetwork]); - - const addresses = useMemo(() => { - if (network.name === 'Mainnet') return mainnetAddresses; - return testnetAddresses; - }, [network]); - - const managerContract = useMemo(() => { - const { eth } = kit.connection.web3; - return new eth.Contract(ManagerABI as AbiItem[], addresses.manager); - }, [kit.connection, addresses]); - - const stCeloContract = useMemo(() => { - const { eth } = kit.connection.web3; - return new eth.Contract(StCeloABI as AbiItem[], addresses.stakedCelo); - }, [kit.connection, addresses]); - - const accountContract = useMemo(() => { - const { eth } = kit.connection.web3; - return new eth.Contract(AccountABI as AbiItem[], addresses.account); - }, [kit.connection, addresses]); - - const sendTransaction = useCallback( - async (txObject: any, txOptions: TxOptions, callbacks?: TxCallbacks) => { - if (await isSanctionedAddress(txOptions.from)) { - throw new Error(COMPLIANT_ERROR_RESPONSE); - } - const tx = await kit.connection.sendTransactionObject(txObject, { - ...txOptions, - }); - await tx.getHash(); - if (callbacks?.onSent) callbacks.onSent(); - await tx.waitReceipt(); - }, - [kit.connection] - ); - - const [epochRewardsContract, setEpochRewardsContract] = useState(); - useEffect( - () => void contractKit._web3Contracts.getEpochRewards().then(setEpochRewardsContract), - [contractKit] - ); - - const [sortedOraclesContract, setSortedOraclesContract] = useState(); - useEffect( - () => void contractKit.contracts.getSortedOracles().then(setSortedOraclesContract), - [contractKit] - ); - - const [stableTokenContract, setStableTokenContract] = useState(); - useEffect( - () => void contractKit.contracts.getStableToken().then(setStableTokenContract), - [contractKit] - ); - const [gasPriceMinimumContract, setGasPriceMinimumContract] = useState(); - useEffect( - () => void contractKit.contracts.getGasPriceMinimum().then(setGasPriceMinimumContract), - [contractKit] - ); - - return { - epochRewardsContract, - sortedOraclesContract, - stableTokenContract, - gasPriceMinimumContract, - managerContract, - stCeloContract, - accountContract, - sendTransaction, - }; -} diff --git a/src/hooks/useCeloRegistryAddress.ts b/src/hooks/useCeloRegistryAddress.ts new file mode 100644 index 00000000..0c2d464d --- /dev/null +++ b/src/hooks/useCeloRegistryAddress.ts @@ -0,0 +1,16 @@ +import celoRegistry from 'src/utils/celoRegistry'; +import { useContractRead } from 'wagmi'; + +export default function useCeloRegistryAddress(contractName: string) { + const { data: address } = useContractRead({ + address: celoRegistry.address, + abi: celoRegistry.abi, + functionName: 'getAddressForString', + args: [contractName], + }); + + if (address && parseInt(address, 16) === 0) { + return undefined; + } + return address; +} diff --git a/src/hooks/useIsTransitioning.ts b/src/hooks/useIsTransitioning.ts new file mode 100644 index 00000000..d9776681 --- /dev/null +++ b/src/hooks/useIsTransitioning.ts @@ -0,0 +1,25 @@ +// components/PageWithTransition.tsx +import Router from 'next/router'; +import { useLayoutEffect, useState } from 'react'; + +export function useIsTransitioning() { + const [transitioning, setTransitioning] = useState(false); + useLayoutEffect(() => { + const begin = () => { + setTransitioning(true); + }; + const end = () => { + setTransitioning(false); + }; + Router.events.on('routeChangeStart', begin); + Router.events.on('routeChangeError', end); + Router.events.on('routeChangeComplete', end); + return () => { + Router.events.off('routeChangeStart', begin); + Router.events.off('routeChangeError', end); + Router.events.off('routeChangeComplete', end); + }; + }, [Router.asPath]); + + return transitioning; +} diff --git a/src/hooks/useModeChange.tsx b/src/hooks/useModeChange.tsx new file mode 100644 index 00000000..57f48a0a --- /dev/null +++ b/src/hooks/useModeChange.tsx @@ -0,0 +1,21 @@ +import { Alfajores } from '@celo/rainbowkit-celo/chains'; +import Router from 'next/router'; +import { useCallback } from 'react'; +import { Mode } from 'src/types'; +import { useChainId } from 'wagmi'; + +export default function useModeChange() { + const currentChain = useChainId(); + + const onModeChange = useCallback( + (mode: Mode) => { + void Router.push({ + pathname: `/${mode}`, + query: currentChain === Alfajores.id ? { chainId: currentChain } : {}, + }); + }, + [currentChain] + ); + + return onModeChange; +} diff --git a/src/hooks/useRedirectToConnectedChainIfNeeded.tsx b/src/hooks/useRedirectToConnectedChainIfNeeded.tsx new file mode 100644 index 00000000..47efeeaf --- /dev/null +++ b/src/hooks/useRedirectToConnectedChainIfNeeded.tsx @@ -0,0 +1,29 @@ +import { Celo } from '@celo/rainbowkit-celo/chains'; +import Router from 'next/router'; +import { ParsedUrlQuery } from 'querystring'; +import { useLayoutEffect } from 'react'; +import { Option } from 'src/types'; +import { useChainId } from 'wagmi'; + +// only use on page components +export function useRedirectToConnectedChainIfNeeded( + chainServerKnowsAbout: Option, + path: string +) { + const chainId = useChainId(); + useLayoutEffect(() => { + const serverSideChainId = chainServerKnowsAbout ?? Router.query.chainId ?? Celo.id; + if (chainId !== serverSideChainId) { + void Router.push({ + pathname: path, + query: chainId === Celo.id ? {} : { chainId }, + }); + } + }, [chainServerKnowsAbout, path, chainId]); +} + +export function getChainIdFromQuery(query: ParsedUrlQuery) { + return ( + (Array.isArray(query.chainId) ? Number(query.chainId[0]) : Number(query.chainId)) || Celo.id + ); +} diff --git a/src/images/icons/caret-purple-dark.svg b/src/images/icons/caret-purple-dark.svg new file mode 100644 index 00000000..ca8329f4 --- /dev/null +++ b/src/images/icons/caret-purple-dark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/images/icons/caret-purple-light.svg b/src/images/icons/caret-purple-light.svg new file mode 100644 index 00000000..df6e70d2 --- /dev/null +++ b/src/images/icons/caret-purple-light.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/layout/AppLayout/Header.tsx b/src/layout/AppLayout/Header.tsx index a939d5b0..74307a74 100644 --- a/src/layout/AppLayout/Header.tsx +++ b/src/layout/AppLayout/Header.tsx @@ -46,7 +46,7 @@ export const Header = ({ isConnectPage = true }: HeaderProps) => {
- + {isConnected && } diff --git a/src/layout/AppLayout/index.tsx b/src/layout/AppLayout/index.tsx index 51fd1590..285d0aa9 100644 --- a/src/layout/AppLayout/index.tsx +++ b/src/layout/AppLayout/index.tsx @@ -1,7 +1,8 @@ -import { useCelo } from '@celo/react-celo'; +import { Alfajores } from '@celo/rainbowkit-celo/chains'; import Head from 'next/head'; import { PropsWithChildren } from 'react'; import { useThemeContext } from 'src/contexts/theme/ThemeContext'; +import { useChainId } from 'wagmi'; import { Footer } from './Footer'; import { Header } from './Header'; @@ -36,13 +37,13 @@ export const AppLayout = ({ pathName, children }: PropsWithChildren) => { }; const DeveloperMode = () => { - const { network } = useCelo(); + const chainId = useChainId(); - if (network?.name === 'Alfajores') { + if (chainId === Alfajores.id) { return (
- Developer network: Alfajores + Developer network: {Alfajores.name}
); diff --git a/src/pages/[...slug].tsx b/src/pages/[...slug].tsx new file mode 100644 index 00000000..a7aa0db2 --- /dev/null +++ b/src/pages/[...slug].tsx @@ -0,0 +1,111 @@ +import type { GetServerSideProps, NextPage } from 'next'; +import Router from 'next/router'; +import { useMemo } from 'react'; +import { Switcher } from 'src/components/switcher/Switcher'; +import { Governance } from 'src/features/governance/components/Governance'; +import { getProposals, SerializedProposal } from 'src/features/governance/data/getProposals'; +import { Swap } from 'src/features/swap/components/Swap'; +import { Validators } from 'src/features/validators/components/List'; +import fetchValidGroups, { ValidatorGroup } from 'src/features/validators/data/fetchValidGroups'; +import { useIsTransitioning } from 'src/hooks/useIsTransitioning'; +import { + getChainIdFromQuery, + useRedirectToConnectedChainIfNeeded, +} from 'src/hooks/useRedirectToConnectedChainIfNeeded'; +import { CenteredLayout } from 'src/layout/CenteredLayout'; +import { Mode } from 'src/types'; + +interface Props { + serverSideChainId: number; + validatorGroups?: ValidatorGroup[]; + proposals?: SerializedProposal[]; + pastProposals?: SerializedProposal[]; +} + +const MultiModePage: NextPage = ({ + serverSideChainId, + validatorGroups, + proposals, + pastProposals, +}) => { + const { slug } = Router.query as { slug?: string[] }; + const mode = (slug ? slug[0] : Mode.stake) as Mode; + + useRedirectToConnectedChainIfNeeded(serverSideChainId, mode); + const isTransitioning = useIsTransitioning(); + + const page = useMemo(() => { + switch (mode) { + case Mode.stake: + case Mode.unstake: + return ; + case Mode.governance: + return ; + case Mode.validators: + return ; + default: + return null; + } + }, [mode, validatorGroups, serverSideChainId, proposals, pastProposals]); + + if (!page) return page; + + return ( + + + {page} + + ); +}; + +export default MultiModePage; + +const MAX_AGE_SECONDS = 60 * 15; +const SWR_SECONDS = 60 * 60 * 12; + +export const getServerSideProps: GetServerSideProps = async ({ + query, + res, + params, +}) => { + res.setHeader( + 'Cache-Control', + `public, s-maxage=${MAX_AGE_SECONDS}, stale-while-revalidate=${SWR_SECONDS}` + ); + + const slug = Array.isArray(params?.slug) ? params?.slug[0] : params?.slug; + const chainId = getChainIdFromQuery(query); + + switch (slug) { + case Mode.validators: { + const groups = await fetchValidGroups(chainId); + + return { + props: { + serverSideChainId: chainId, + validatorGroups: groups.groups, + }, + }; + } + case Mode.governance: { + const proposals = await getProposals(chainId); + return { + props: { + serverSideChainId: chainId, + proposals: proposals.proposals, + pastProposals: proposals.pastProposals, + }, + }; + } + case Mode.stake: + case Mode.unstake: + return { + props: { serverSideChainId: chainId }, + }; + default: { + return { + notFound: true, + }; + } + } +}; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 489bb418..c6860754 100755 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,25 +1,50 @@ -import { CeloProvider, Mainnet, useCelo } from '@celo/react-celo'; -import '@celo/react-celo/lib/styles.css'; +import '@rainbow-me/rainbowkit/styles.css'; + import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; import type { AppProps } from 'next/app'; import Head from 'next/head'; -import { useRouter } from 'next/router'; -import { PropsWithChildren, useEffect, useState } from 'react'; +import Router from 'next/router'; +import { PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react'; import { toast, ToastContainer, Zoom } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import { AccountProvider, useAccountContext } from 'src/contexts/account/AccountContext'; +import { BlockchainProvider } from 'src/contexts/blockchain/BlockchainContext'; import { ProtocolProvider } from 'src/contexts/protocol/ProtocolContext'; -import { ThemeProvider } from 'src/contexts/theme/ThemeContext'; +import { ThemeProvider, useThemeContext } from 'src/contexts/theme/ThemeContext'; import { AppLayout } from 'src/layout/AppLayout'; import 'src/styles/globals.css'; import 'src/styles/transitions.scss'; import { pageview } from '../utils/ga'; +import celoGroups from '@celo/rainbowkit-celo/lists'; +import { darkTheme, lightTheme, RainbowKitProvider } from '@rainbow-me/rainbowkit'; +import { WALLET_CONNECT_PROJECT_ID } from 'src/config/consts'; +import { configureChains, createConfig, WagmiConfig } from 'wagmi'; +import { celo, celoAlfajores } from 'wagmi/chains'; +import { jsonRpcProvider } from 'wagmi/providers/jsonRpc'; + +const { chains, publicClient } = configureChains( + [celo, celoAlfajores], + [jsonRpcProvider({ rpc: (chain) => ({ http: chain.rpcUrls.default.http[0] }) })] +); + +const connectors = celoGroups({ + chains, + projectId: WALLET_CONNECT_PROJECT_ID, + appName: 'Staked Celo', +}); +const wagmiConfig = createConfig({ + autoConnect: true, + connectors, + publicClient, +}); + dayjs.extend(relativeTime); const App = ({ Component, pageProps, router }: AppProps) => { const pathName = router.pathname; + const { theme } = useThemeContext(); return ( <> @@ -27,34 +52,31 @@ const App = ({ Component, pageProps, router }: AppProps) => { {`StakedCelo - Liquid staking on Celo | ${getHeadTitle(pathName)}`} - Connect Wallet, - providersOptions: { searchable: false }, - }} - > - - - - - - - - - + + + + + + + + + + + + ); @@ -83,41 +105,44 @@ const ClientOnly = ({ children }: PropsWithChildren) => { }; const TopProvider = (props: PropsWithChildren) => { - const { initialised } = useCelo(); - if (!initialised) return null; - return ( - - {props.children} - + + + {props.children} + + ); }; -const routingsWithConnection = ['/']; +const routingsWithConnection = ['', 'stake', 'unstake']; const CeloConnectRedirect = (props: PropsWithChildren) => { - const router = useRouter(); const { isConnected } = useAccountContext(); - - if (!isConnected && routingsWithConnection.includes(router.pathname)) { - void router.push('/connect'); - - const handleRouteChange = (url: URL) => { - pageview(url); - }; - router.events.on('routeChangeComplete', handleRouteChange); - - // Router is async. Show empty screen before redirect. - return null; - } else if (isConnected && router.pathname == '/connect') { - void router.push('/'); + const route = Router.asPath; + const lastRoute = useRef(null); + const basePath = Router.query.slug?.[0] || ''; + + useLayoutEffect(() => { + if (!isConnected && routingsWithConnection.includes(basePath)) { + void Router.push('/connect'); + } else if (isConnected && basePath == 'connect') { + void Router.push(lastRoute.current ?? '/stake'); + } else if (isConnected && basePath === '') { + void Router.push('/stake'); + } + }, [isConnected, route, basePath]); + + useEffect(() => { const handleRouteChange = (url: URL) => { pageview(url); }; - router.events.on('routeChangeComplete', handleRouteChange); - return null; - } + // Record last route + Router.events.on('beforeHistoryChange', () => { + lastRoute.current = Router.asPath; + }); + Router.events.on('routeChangeComplete', handleRouteChange); + }, []); return <>{props.children}; }; diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index bef0244a..33c8d410 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -1,6 +1,6 @@ import Document, { Head, Html, Main, NextScript } from 'next/document'; -const name = 'Liquid Staking'; +const name = 'StakedCelo'; const description = 'A simple DApp for Celo liquid staking.'; class MyDocument extends Document { @@ -44,7 +44,7 @@ class MyDocument extends Document { - +
diff --git a/src/pages/connect.tsx b/src/pages/connect.tsx index 713720ba..54f5791c 100644 --- a/src/pages/connect.tsx +++ b/src/pages/connect.tsx @@ -1,12 +1,12 @@ -import { Button } from 'src/components/buttons/Button'; +import { ConnectButton } from '@rainbow-me/rainbowkit'; +import { useState } from 'react'; +import { ThemedIcon } from 'src/components/icons/ThemedIcon'; import { TokenIcon } from 'src/components/icons/TokenIcon'; -import { useProtocolContext } from 'src/contexts/protocol/ProtocolContext'; -import { useWallet } from 'src/features/wallet/hooks/useWallet'; +import { InfoModal } from 'src/components/modals/InfoModal'; import styles from './connect.module.css'; const Connect = () => { - const { connectWallet } = useWallet(); - const { annualProjectedRate } = useProtocolContext(); + const [isOpen, setIsOpen] = useState(false); return (
@@ -17,24 +17,31 @@ const Connect = () => {

Introducing stCELO

    -
  • - Earn a projected {annualProjectedRate ? annualProjectedRate : '-'}% APR -
  • +
  • Continue to earn rewards while using Celo
  • Stake without locking
  • -
  • No fees for launch
  • +
  • + + No fees for launch + + setIsOpen(true)} + /> + +
- +
+ setIsOpen(false)}> + All the epoch rewards accrued by the underlying CELO are shared with stCELO holders and the + StakedCelo protocol is earning no fees. Blockchain transaction fees and/or other fees may + apply. + ); }; diff --git a/src/pages/governance/[...slug].tsx b/src/pages/governance/[...slug].tsx new file mode 100644 index 00000000..eff4bc70 --- /dev/null +++ b/src/pages/governance/[...slug].tsx @@ -0,0 +1,66 @@ +import { Alfajores, Celo } from '@celo/rainbowkit-celo/chains'; +import type { GetServerSideProps, NextPage } from 'next'; +import Router from 'next/router'; +import { Details } from 'src/features/governance/components/Details'; +import { + getProposalRecord, + getYamlForProposal, + SerializedProposal, +} from 'src/features/governance/data/getProposals'; +import { useRedirectToConnectedChainIfNeeded } from 'src/hooks/useRedirectToConnectedChainIfNeeded'; + +interface Props { + proposal: SerializedProposal; + serverChainId: number; +} + +const GovernanceDetailsPage: NextPage = ({ proposal, serverChainId }) => { + const { slug: id } = Router.query; + const proposalId = Array.isArray(id) ? id[0] : id; + useRedirectToConnectedChainIfNeeded(serverChainId, `/governance/${proposalId}`); + + return
; +}; + +export default GovernanceDetailsPage; + +const MAX_AGE_SECONDS = 60 * 5; +const SWR_SECONDS = 60 * 60 * 2; + +export const getServerSideProps: GetServerSideProps = async ({ query, params, res }) => { + res.setHeader( + 'Cache-Control', + `public, s-maxage=${MAX_AGE_SECONDS}, stale-while-revalidate=${SWR_SECONDS}` + ); + + const id = params?.slug; + const proposalID = Array.isArray(id) ? id[0] : id; + const chainId = + Number(query.chainId as string) || + (process.env.NODE_ENV === 'production' ? Celo.id : Alfajores.id); + + if (typeof proposalID !== 'string') { + return { + notFound: true, + }; + } + + const proposal = await getProposalRecord(chainId, proposalID); + + if (proposal === null) { + return { + notFound: true, + }; + } + const parsedYAML = await getYamlForProposal(proposal); + + return { + props: { + serverChainId: chainId, + proposal: { + ...proposal, + parsedYAML, + }, + }, + }; +}; diff --git a/src/pages/index.tsx b/src/pages/index.tsx deleted file mode 100755 index 688f3a79..00000000 --- a/src/pages/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { NextPage } from 'next'; -import { useRouter } from 'next/router'; -import { Swap } from 'src/features/swap/components/Swap'; -import { Mode } from 'src/features/swap/types'; -import * as ga from '../utils/ga'; - -const SwapPage: NextPage = () => { - const router = useRouter(); - const { mode = 'stake' } = router.query; - const onModeChange = (mode: Mode) => { - void router.push({ - pathname: router.pathname, - query: { mode }, - }); - const handleRouteChange = (url: URL) => { - ga.pageview(url); - }; - router.events.on('routeChangeComplete', handleRouteChange); - }; - if (typeof mode !== 'string' || !['stake', 'unstake'].includes(mode)) return null; - return ; -}; - -export default SwapPage; diff --git a/src/pages/library.tsx b/src/pages/library.tsx new file mode 100644 index 00000000..c204d837 --- /dev/null +++ b/src/pages/library.tsx @@ -0,0 +1,35 @@ +import { Row } from 'src/components/list/row'; +import { Pill } from 'src/components/pills/Pill'; +import { LinkOut } from 'src/components/text/LinkOut'; +import { ValidatorGroupRow } from 'src/features/validators/components/ValidatorGroupRow'; + +const page = () => { + return ( +
+ Pill Test +
+ External Link Link Out + + Item + + + …197F6 + + + Passed + + + Child Here + + + +
+ ); +}; +export default page; diff --git a/src/pages/validators/[...slug].tsx b/src/pages/validators/[...slug].tsx new file mode 100644 index 00000000..cb184582 --- /dev/null +++ b/src/pages/validators/[...slug].tsx @@ -0,0 +1,74 @@ +import type { NextPage } from 'next'; +import { GetServerSideProps } from 'next'; +import Router from 'next/router'; +import { ParsedUrlQuery } from 'querystring'; +import { Details } from 'src/features/validators/components/Details'; +import getGroupName from 'src/features/validators/data/getGroupName'; +import { + getChainIdFromQuery, + useRedirectToConnectedChainIfNeeded, +} from 'src/hooks/useRedirectToConnectedChainIfNeeded'; +import logger from 'src/services/logger'; +import { Address } from 'viem'; +import { isAddress } from 'web3-utils'; + +interface Props { + name?: string; + serverChainId: number; +} + +interface Query extends ParsedUrlQuery { + groupAddress: Address[]; +} + +const ValidatorGroupShowPage: NextPage = ({ name, serverChainId }: Props) => { + const { slug: groupAddress } = Router.query; + const address = Array.isArray(groupAddress) ? groupAddress[0] : groupAddress; + useRedirectToConnectedChainIfNeeded(serverChainId, `/validators/${address}`); + + return
; +}; + +export default ValidatorGroupShowPage; + +// will refetch every 3 minutes (if requests come in) +const MAX_AGE_SECONDS = 180; +// will serve old data for up to x hour (if no requests come in) +const SERVE_STALE_WHILE_REVALIDATE_SECONDS = 60 * 60 * 2; + +export const getServerSideProps: GetServerSideProps = async ({ + res, + params, + query, +}) => { + res.setHeader( + 'Cache-Control', + `public, s-maxage=${MAX_AGE_SECONDS}, stale-while-revalidate=${SERVE_STALE_WHILE_REVALIDATE_SECONDS}` + ); + + const groupAddress = params?.slug; + const address = Array.isArray(groupAddress) ? groupAddress[0] : groupAddress; + if (typeof address !== 'string' || !isAddress(address)) { + return { + notFound: true, + }; + } + const chainId = getChainIdFromQuery(query); + + // will throw if no validatorGroup with such address + try { + const name = await getGroupName(chainId, address as Address); + + return { + props: { + serverChainId: chainId, + name, + }, + }; + } catch (error) { + logger.error('failed to fetch group', address, error); + return { + notFound: true, + }; + } +}; diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 00000000..e526febd --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,14 @@ +export enum Mode { + stake = 'stake', + unstake = 'unstake', + governance = 'governance', + validators = 'validators', +} + +export enum VoteType { + yes = 'yes', + no = 'no', + abstain = 'abstain', +} + +export type Option = T | undefined; diff --git a/src/utils/appendChainIdToLink.tsx b/src/utils/appendChainIdToLink.tsx new file mode 100644 index 00000000..f4b11e11 --- /dev/null +++ b/src/utils/appendChainIdToLink.tsx @@ -0,0 +1,8 @@ +import { Celo } from '@celo/rainbowkit-celo/chains'; +export function appendChainIdToLink(link: string, chainId: number) { + if (chainId === Celo.id) { + return link; + } else { + return `${link}?chainId=${chainId}`; + } +} diff --git a/src/utils/celoRegistry.ts b/src/utils/celoRegistry.ts new file mode 100644 index 00000000..a735a2ec --- /dev/null +++ b/src/utils/celoRegistry.ts @@ -0,0 +1,7 @@ +import { registryABI } from '@celo/abis/types/wagmi'; + +const REGISTRY_CONTRACT_ADDRESS = '0x000000000000000000000000000000000000ce10'; +export default { + address: REGISTRY_CONTRACT_ADDRESS, + abi: registryABI, +} as const; diff --git a/src/utils/chainIdToChain.ts b/src/utils/chainIdToChain.ts new file mode 100644 index 00000000..3a360dd1 --- /dev/null +++ b/src/utils/chainIdToChain.ts @@ -0,0 +1,14 @@ +import { Alfajores, Baklava, Cannoli, Celo } from '@celo/rainbowkit-celo/chains'; + +const chainFromChainId = { + [Celo.id]: Celo, + [Alfajores.id]: Alfajores, + [Baklava.id]: Baklava, + [Cannoli.id]: Cannoli, +}; + +export default function chainIdToChain( + chainId: number +): typeof Celo | typeof Alfajores | typeof Baklava | typeof Cannoli { + return chainFromChainId[chainId] || chainFromChainId[Celo.id]; +} diff --git a/src/utils/chainIdToRPC.ts b/src/utils/chainIdToRPC.ts new file mode 100644 index 00000000..7e33b3d5 --- /dev/null +++ b/src/utils/chainIdToRPC.ts @@ -0,0 +1,12 @@ +import { Alfajores, Baklava, Cannoli, Celo } from '@celo/rainbowkit-celo/chains'; + +const chainIdForRPC = { + [Celo.id]: Celo.rpcUrls.default.http[0], + [Alfajores.id]: Alfajores.rpcUrls.default.http[0], + [Baklava.id]: Baklava.rpcUrls.default.http[0], + [Cannoli.id]: Cannoli.rpcUrls.default.http[0], +}; + +export default function chainIdToRPC(chainId: number) { + return chainIdForRPC[chainId] || chainIdForRPC[Celo.id]; +} diff --git a/src/utils/clients.ts b/src/utils/clients.ts new file mode 100644 index 00000000..74a92525 --- /dev/null +++ b/src/utils/clients.ts @@ -0,0 +1,15 @@ +import { Alfajores, Celo } from '@celo/rainbowkit-celo/chains'; +import { createPublicClient, http } from 'viem'; + +const clients = { + [Celo.id]: createPublicClient({ + chain: Celo, + transport: http(), + }), + [Alfajores.id]: createPublicClient({ + chain: Alfajores, + transport: http(), + }), +} as const; + +export default clients; diff --git a/src/utils/localSave.ts b/src/utils/localSave.ts new file mode 100644 index 00000000..aeae30f9 --- /dev/null +++ b/src/utils/localSave.ts @@ -0,0 +1,10 @@ +export const writeToCache = (url: string, data: string[]) => + localStorage.setItem(url, JSON.stringify({ ts: Date.now(), data })); + +export const readFromCache = (url: string) => { + const cached = localStorage.getItem(url); + if (cached) { + return JSON.parse(cached) as { ts: number; data: string[] }; + } + return null; +}; diff --git a/src/utils/proposals.ts b/src/utils/proposals.ts new file mode 100644 index 00000000..dd73490f --- /dev/null +++ b/src/utils/proposals.ts @@ -0,0 +1,44 @@ +export function camelCasesify(str: string): string { + const words = str.split(/\W/g); + + return words.map((x, i) => (i === 0 ? x : x.charAt(0).toUpperCase().concat(x.slice(1)))).join(''); +} + +export type ParsedYAML = { + cgp: string; + title: string; + dateCreated: string; + author: string; + status: string; + discussionsTo: string; + governanceProposalId: string; + dateExecuted: string; +}; + +export function parsedYAMLFromMarkdown(markdown: string): ParsedYAML | null { + const parsed = markdown.match(/---(.*?)---/s); + if (!parsed) { + return null; + } + const rows = parsed[1].split('\n'); + const keyValues = rows + .map((x) => + x + .split(/(.*?):(.*)/) + .map((x) => x.trim()) + .filter(Boolean) + ) + .filter((x) => x.length); + + return keyValues.reduce( + (acc, [key, value]) => ({ + ...acc, + [camelCasesify(key)]: value, + }), + {} as ParsedYAML + ); +} + +export function getRawGithubUrl(descriptionURL: string) { + return descriptionURL.replace('github.com', 'raw.githubusercontent.com').replace('/blob/', '/'); +} diff --git a/src/utils/sanctioned.ts b/src/utils/sanctioned.ts index 6962353a..a160ded1 100644 --- a/src/utils/sanctioned.ts +++ b/src/utils/sanctioned.ts @@ -1,15 +1,5 @@ import { OFAC_SANCTIONS_LIST_URL, SANCTIONED_ADDRESSES } from 'compliance-sdk'; - -const writeToCache = (url: string, data: string[]) => - localStorage.setItem(url, JSON.stringify({ ts: Date.now(), data })); - -const readFromCache = (url: string) => { - const cached = localStorage.getItem(url); - if (cached) { - return JSON.parse(cached) as { ts: number; data: string[] }; - } - return null; -}; +import { readFromCache, writeToCache } from './localSave'; const DAY = 24 * 60 * 60 * 1000; diff --git a/src/utils/tokens.ts b/src/utils/tokens.ts index dfa35864..5853816b 100644 --- a/src/utils/tokens.ts +++ b/src/utils/tokens.ts @@ -6,7 +6,15 @@ export type TokenType = 'CELO' | 'stCELO' | 'cUSD'; export class Token extends BigNumber { constructor(value: any) { - super(value instanceof BigNumber ? value.toFixed() : value); + if (value instanceof BigNumber) { + super(value.toFixed()); + } else if (value && typeof value.value !== 'undefined') { + // returnvalue from viem balanceOf looks like that: + // { decimals: 18, formatted: "1", symbol: "CELO", value: 1n } + super(value.value); + } else { + super(value); + } } displayAsBase(skipTrailingZeroes = false): string { @@ -19,6 +27,10 @@ export class Token extends BigNumber { const baseValue = fromWei(this.toFixed(0, BigNumber.ROUND_FLOOR)); return new BigNumber(baseValue); } + + toBigInt(): bigint { + return BigInt(this.toNumber()); + } } export class Celo extends Token { diff --git a/tailwind.config.js b/tailwind.config.js index 65cfdf78..c2e1f893 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -4,6 +4,9 @@ module.exports = { content: ['src/**/*.{js,ts,jsx,tsx}'], theme: { extend: { + borderColor: { + 'color-tertiary-callout': 'var(--c-text-tertiary-callout-color)', + }, textColor: { 'color-primary': 'var(--c-text-primary-color)', 'color-secondary': 'var(--c-text-secondary-color)', @@ -38,6 +41,7 @@ module.exports = { 'action-secondary-light': 'var(--c-bg-action-secondary-light-color)', 'action-secondary-regular': 'var(--c-bg-action-secondary-regular-color)', 'action-secondary-dark': 'var(--c-bg-action-secondary-dark-color)', + 'action-secondary-callout': 'var(--c-text-secondary-callout-color)', 'highlight-primary': 'var(--c-bg-highlight-primary-color)', 'highlight-secondary': 'var(--c-bg-highlight-secondary-color)', 'callout-modal': 'var(--c-bg-callout-modal-color)', diff --git a/yarn.lock b/yarn.lock index b032854f..9d8bedc7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@adraffy/ens-normalize@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.0.tgz#223572538f6bea336750039bb43a4016dcc8182d" + integrity sha512-iowxq3U30sghZotgl4s/oJRci6WPBfNO5YYgk2cIOMCHr3LeGPcsZjCEr+33Q4N+oV3OABDAtA+pyvWjbvBifQ== + "@babel/runtime-corejs3@^7.10.2": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.18.6.tgz#6f02c5536911f4b445946a2179554b95c8838635" @@ -31,16 +36,16 @@ dependencies: regenerator-runtime "^0.13.4" +"@celo/abis@^9.0.6": + version "9.0.6" + resolved "https://registry.yarnpkg.com/@celo/abis/-/abis-9.0.6.tgz#3586f578394cb0408f17335cdaedf98fd9f47d7c" + integrity sha512-w/zQWAnJMUfthiFyzUoSKgZ1DQDKjXaSmImwGRDi6U9SPyEx5rWsHm7tsoVXoxYzAdPbtpkeFykQPvPqCJfHmA== + "@celo/base@3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@celo/base/-/base-3.2.0.tgz#19dcff6a822abb1f6b57af8f9db35a4c673aee62" integrity sha512-9wfZYiYv7dzt17a29fxU6sV7JssyXfpSQ9kPSpfOlsewPICXwfOMQ+25Jn6xZu20Vx9rmKebmLHiQyiuYEDOcQ== -"@celo/base@4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@celo/base/-/base-4.1.0.tgz#9cd45f1c7d0ac61b4e2e98c046066f9eb9e143e9" - integrity sha512-Q9wKLa4JJw06FXpToZm5PYfFYjx+tvwIQlvFofx+GleX+uq+BT/gdxgTQ/c08OrxZUyc53TUdqSCs+88VlhmlA== - "@celo/connect@3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@celo/connect/-/connect-3.2.0.tgz#547023b017c319c98020daaadc14dd3d3f0455ce" @@ -54,19 +59,6 @@ debug "^4.1.1" utf8 "3.0.0" -"@celo/connect@4.1.0", "@celo/connect@>=2.3.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@celo/connect/-/connect-4.1.0.tgz#bcdd2a37e7c6e034371a097810f7e64444de397e" - integrity sha512-1PaPy/b9ZLtXGCNN7lqlt0Nqsw/Ql20iCcOZbrAhoN9HkxtHI/yMK7p9aMGDR0Qy4jEi123p8kt5qgJhH2IkKg== - dependencies: - "@celo/base" "4.1.0" - "@celo/utils" "4.1.0" - "@types/debug" "^4.1.5" - "@types/utf8" "^2.1.6" - bignumber.js "^9.0.0" - debug "^4.1.1" - utf8 "3.0.0" - "@celo/contractkit@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@celo/contractkit/-/contractkit-3.2.0.tgz#c0886e3a01534a199618fce65c6861cecb0c5ed1" @@ -86,26 +78,10 @@ semver "^7.3.5" web3 "1.3.6" -"@celo/react-celo@^5.0.4": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@celo/react-celo/-/react-celo-5.0.4.tgz#c7574e6c90047a1be5f1d087533dad89ceb526d2" - integrity sha512-BCB00lamhfxrZOu2RtkEtrcAkdPsOpJ/5B9bXIDzXzhRMAWPp/vPBCcbjJKaqX8hADDhZXoxn5+hUTJyoSI5Xg== - dependencies: - "@celo/wallet-base" ">=2.3.0" - "@celo/wallet-ledger" ">=2.3.0" - "@celo/wallet-local" ">=2.3.0" - "@celo/wallet-remote" ">=2.3.0" - "@celo/wallet-walletconnect" "5.0.4" - "@coinbase/wallet-sdk" "^3.2.0" - "@ethersproject/providers" "^5.5.2" - "@ledgerhq/hw-transport-webusb" "^5.43.0" - "@types/react-modal" "^3.13.1" - eventemitter3 "^4.0.7" - isomorphic-fetch "^3.0.0" - qrcode "^1.5.0" - react-device-detect "^2.2.3" - react-helmet "^6.1.0" - react-modal "^3.14.4" +"@celo/rainbowkit-celo@1.0.2-beta.2": + version "1.0.2-beta.2" + resolved "https://registry.yarnpkg.com/@celo/rainbowkit-celo/-/rainbowkit-celo-1.0.2-beta.2.tgz#2518a2f18d744d0a2d167c7bd237f67a2bb3c5f8" + integrity sha512-bBv4+6ebEWsLCgcMsB1KC4H+sOnmm1zLc6pmyhKDGVuM6DPSFmrKPfLgYXC2g+NR5nJU26mrRFpkXptIO6FDaw== "@celo/utils@3.2.0": version "3.2.0" @@ -124,23 +100,6 @@ web3-eth-abi "1.3.6" web3-utils "1.3.6" -"@celo/utils@4.1.0", "@celo/utils@>=2.3.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@celo/utils/-/utils-4.1.0.tgz#ffbfedb8d5866af8d309b57a79dfb35870e368e8" - integrity sha512-N0ijAXAGFQavX75clVXhGOVTzSpv/AJmh+igYUCNVzyF0s/Ms/l9WjjEQsd0c3uWRkWBLXiKmCNTI9LZXazjkw== - dependencies: - "@celo/base" "4.1.0" - "@types/bn.js" "^5.1.0" - "@types/elliptic" "^6.4.9" - "@types/ethereumjs-util" "^5.2.0" - "@types/node" "^10.12.18" - bignumber.js "^9.0.0" - elliptic "^6.5.4" - ethereumjs-util "^5.2.0" - io-ts "2.0.1" - web3-eth-abi "1.3.6" - web3-utils "1.3.6" - "@celo/wallet-base@3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@celo/wallet-base/-/wallet-base-3.2.0.tgz#feff094fd43fb651f3f742b6a73dc3b740b0c39c" @@ -156,37 +115,6 @@ eth-lib "^0.2.8" ethereumjs-util "^5.2.0" -"@celo/wallet-base@4.1.0", "@celo/wallet-base@>=2.3.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@celo/wallet-base/-/wallet-base-4.1.0.tgz#890ad567b73ad59ba7f8eb060372fd8ab8476bb7" - integrity sha512-fc6DGI6vcwGE/z3hT/7rZkQ9nvv/7l8RAEmof05zqMCdXdqaq135GWuE5H7gcC/qCLJzRNVpPGcWAPKUQ4z03A== - dependencies: - "@celo/base" "4.1.0" - "@celo/connect" "4.1.0" - "@celo/utils" "4.1.0" - "@types/debug" "^4.1.5" - "@types/ethereumjs-util" "^5.2.0" - bignumber.js "^9.0.0" - debug "^4.1.1" - eth-lib "^0.2.8" - ethereumjs-util "^5.2.0" - -"@celo/wallet-ledger@>=2.3.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@celo/wallet-ledger/-/wallet-ledger-4.1.0.tgz#366c2f219d798cebcfa76fdf0048d5880a292d5a" - integrity sha512-8UVJsEIGGc2rWo3U70fq3dv9QoTpapYdiOQ/RJGctfoWduMLRWeTIApk4DJ9+wUS0Wjf3F5+U9q35UxVp/KTdA== - dependencies: - "@celo/connect" "4.1.0" - "@celo/utils" "4.1.0" - "@celo/wallet-base" "4.1.0" - "@celo/wallet-remote" "4.1.0" - "@ledgerhq/hw-app-eth" "~5.11.0" - "@ledgerhq/hw-transport" "~5.11.0" - "@types/ethereumjs-util" "^5.2.0" - debug "^4.1.1" - eth-lib "^0.2.8" - ethereumjs-util "^5.2.0" - "@celo/wallet-local@3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@celo/wallet-local/-/wallet-local-3.2.0.tgz#905dd18a3285852a8341e5683beda94512c0f4f8" @@ -199,51 +127,10 @@ eth-lib "^0.2.8" ethereumjs-util "^5.2.0" -"@celo/wallet-local@>=2.3.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@celo/wallet-local/-/wallet-local-4.1.0.tgz#e75ffb44f0352585db13f823034230d14064af1e" - integrity sha512-nG7f77gblF3CQ3811LOtmoLr8yC+f+G6QjkgUV9GmFNBDdUNQZf7OM1ZQaYib10D6OwY0UPxlP9N+tweVWDOdA== - dependencies: - "@celo/connect" "4.1.0" - "@celo/utils" "4.1.0" - "@celo/wallet-base" "4.1.0" - "@types/ethereumjs-util" "^5.2.0" - eth-lib "^0.2.8" - ethereumjs-util "^5.2.0" - -"@celo/wallet-remote@4.1.0", "@celo/wallet-remote@>=2.3.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@celo/wallet-remote/-/wallet-remote-4.1.0.tgz#40b89fb9aa6e5f1f93d6f6719728e6d71f2546df" - integrity sha512-SNxVdLa6ixJGDqOyBI2SOJN5CLr6gZG0AUCo0cPwkpV7c5Dy9ezJ2gRWxxvcbU1j++Jjh/H1yyKLmqbfUEtw8w== - dependencies: - "@celo/connect" "4.1.0" - "@celo/utils" "4.1.0" - "@celo/wallet-base" "4.1.0" - "@types/debug" "^4.1.5" - "@types/ethereumjs-util" "^5.2.0" - eth-lib "^0.2.8" - ethereumjs-util "^5.2.0" - -"@celo/wallet-walletconnect@5.0.4": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@celo/wallet-walletconnect/-/wallet-walletconnect-5.0.4.tgz#7828d0037366d147f7d482a14f5c61050c5d584c" - integrity sha512-YQgHRHh+qhsK038UAEXsoEO327kSd4HJshL7WjNjhVH7C5EkUmfXsabEKEI+LfnICDvWU4lGbpRyO9fyMjX5vA== - dependencies: - "@celo/connect" ">=2.3.0" - "@celo/utils" ">=2.3.0" - "@celo/wallet-base" ">=2.3.0" - "@celo/wallet-remote" ">=2.3.0" - "@walletconnect/core" "^2.7.3" - "@walletconnect/sign-client" "^2.7.3" - "@walletconnect/types" "^2.7.3" - "@walletconnect/utils" "^2.7.3" - debug "^4.3.3" - ethereumjs-util "^7.1.3" - -"@coinbase/wallet-sdk@^3.2.0": - version "3.7.1" - resolved "https://registry.yarnpkg.com/@coinbase/wallet-sdk/-/wallet-sdk-3.7.1.tgz#44b3b7a925ff5cc974e4cbf7a44199ffdcf03541" - integrity sha512-LjyoDCB+7p0waQXfK+fUgcAs3Ezk6S6e+LYaoFjpJ6c9VTop3NyZF40Pi7df4z7QJohCwzuIDjz0Rhtig6Y7Pg== +"@coinbase/wallet-sdk@^3.6.6": + version "3.6.6" + resolved "https://registry.yarnpkg.com/@coinbase/wallet-sdk/-/wallet-sdk-3.6.6.tgz#4a0758fe0fe0ba3ed7e33b5bb6eb094ff8bd6c98" + integrity sha512-vX+epj/Ttjo7XRwlr3TFUUfW5GTRMvORpERPwiu7z2jl3DSVL4rXLmHt5y6LDPlUVreas2gumdcFbu0fLRG9Jg== dependencies: "@metamask/safe-event-emitter" "2.0.0" "@solana/web3.js" "^1.70.1" @@ -263,6 +150,23 @@ stream-browserify "^3.0.0" util "^0.12.4" +"@emotion/hash@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.8.0.tgz#bbbff68978fefdbe68ccb533bc8cbe1d1afb5413" + integrity sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow== + +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.4.0": + version "4.5.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.1.tgz#cdd35dce4fa1a89a4fd42b1599eb35b3af408884" + integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== + "@eslint/eslintrc@^1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" @@ -278,22 +182,6 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@ethereumjs/common@^2.5.0", "@ethereumjs/common@^2.6.4": - version "2.6.5" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.5.tgz#0a75a22a046272579d91919cb12d84f2756e8d30" - integrity sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.1.5" - -"@ethereumjs/tx@^3.3.2": - version "3.5.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.5.2.tgz#197b9b6299582ad84f9527ca961466fce2296c1c" - integrity sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw== - dependencies: - "@ethereumjs/common" "^2.6.4" - ethereumjs-util "^7.1.5" - "@ethersproject/abi@5.0.7": version "5.0.7" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.7.tgz#79e52452bd3ca2956d0e1c964207a58ad1a0ee7b" @@ -309,21 +197,6 @@ "@ethersproject/properties" "^5.0.3" "@ethersproject/strings" "^5.0.4" -"@ethersproject/abi@^5.6.3": - version "5.6.4" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.4.tgz#f6e01b6ed391a505932698ecc0d9e7a99ee60362" - integrity sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg== - dependencies: - "@ethersproject/address" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/constants" "^5.6.1" - "@ethersproject/hash" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.1" - "@ethersproject/abstract-provider@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz#02ddce150785caf0c77fe036a0ebfcee61878c59" @@ -366,14 +239,6 @@ dependencies: "@ethersproject/bytes" "^5.6.1" -"@ethersproject/basex@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.6.1.tgz#badbb2f1d4a6f52ce41c9064f01eab19cc4c5305" - integrity sha512-a52MkVz4vuBXR06nvflPMotld1FJWSj2QT0985v7P/emPZO00PucFAkbcmq2vpVU7Ts7umKiSI6SppiLykVWsA== - dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.2.tgz#72a0717d6163fab44c47bcc82e0c550ac0315d66" @@ -397,7 +262,7 @@ dependencies: "@ethersproject/bignumber" "^5.6.2" -"@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.6.1": +"@ethersproject/hash@^5.0.4": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.1.tgz#224572ea4de257f05b4abf8ae58b03a67e99b0f4" integrity sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA== @@ -438,40 +303,6 @@ dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/providers@^5.5.2": - version "5.6.8" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.8.tgz#22e6c57be215ba5545d3a46cf759d265bb4e879d" - integrity sha512-Wf+CseT/iOJjrGtAOf3ck9zS7AgPmr2fZ3N97r4+YXN3mBePTG2/bJ8DApl9mVwYL+RpYbNxMEkEp4mPGdwG/w== - dependencies: - "@ethersproject/abstract-provider" "^5.6.1" - "@ethersproject/abstract-signer" "^5.6.2" - "@ethersproject/address" "^5.6.1" - "@ethersproject/base64" "^5.6.1" - "@ethersproject/basex" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/constants" "^5.6.1" - "@ethersproject/hash" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/networks" "^5.6.3" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/random" "^5.6.1" - "@ethersproject/rlp" "^5.6.1" - "@ethersproject/sha2" "^5.6.1" - "@ethersproject/strings" "^5.6.1" - "@ethersproject/transactions" "^5.6.2" - "@ethersproject/web" "^5.6.1" - bech32 "1.1.4" - ws "7.4.6" - -"@ethersproject/random@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.6.1.tgz#66915943981bcd3e11bbd43733f5c3ba5a790255" - integrity sha512-/wtPNHwbmng+5yi3fkipA8YBT59DdkGRoC2vWk09Dci/q5DlgnMkhIycjHlavrvrjJBkFjO/ueLyT+aUDfc4lA== - dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/rlp@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.1.tgz#df8311e6f9f24dcb03d59a2bac457a28a4fe2bd8" @@ -480,15 +311,6 @@ "@ethersproject/bytes" "^5.6.1" "@ethersproject/logger" "^5.6.0" -"@ethersproject/sha2@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.1.tgz#211f14d3f5da5301c8972a8827770b6fd3e51656" - integrity sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g== - dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - hash.js "1.1.7" - "@ethersproject/signing-key@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.2.tgz#8a51b111e4d62e5a62aee1da1e088d12de0614a3" @@ -536,6 +358,11 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.1" +"@graphql-typed-document-node/core@^3.1.1": + 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== + "@humanwhocodes/config-array@^0.9.2": version "0.9.5" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" @@ -590,61 +417,22 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@ledgerhq/devices@^5.11.0", "@ledgerhq/devices@^5.51.1": - version "5.51.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-5.51.1.tgz#d741a4a5d8f17c2f9d282fd27147e6fe1999edb7" - integrity sha512-4w+P0VkbjzEXC7kv8T1GJ/9AVaP9I6uasMZ/JcdwZBS3qwvKo5A5z9uGhP5c7TvItzcmPb44b5Mw2kT+WjUuAA== - dependencies: - "@ledgerhq/errors" "^5.50.0" - "@ledgerhq/logs" "^5.50.0" - rxjs "6" - semver "^7.3.5" - -"@ledgerhq/errors@^5.11.0", "@ledgerhq/errors@^5.50.0": - version "5.50.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.50.0.tgz#e3a6834cb8c19346efca214c1af84ed28e69dad9" - integrity sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow== - -"@ledgerhq/hw-app-eth@~5.11.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-5.11.0.tgz#5db6abe0ddf5b5266ed09868de12021f59c1a33e" - integrity sha512-qgpPwZzM8UMHYMC5+9xYV2O+8kgkDAl9+38w9JiBksaGmUFqcS4najsB1nj6AWf2rGEuXdKMb2WEYRskVypJrA== - dependencies: - "@ledgerhq/errors" "^5.11.0" - "@ledgerhq/hw-transport" "^5.11.0" - -"@ledgerhq/hw-transport-webusb@^5.43.0": - version "5.53.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webusb/-/hw-transport-webusb-5.53.1.tgz#3df8c401417571e3bcacc378d8aca587214b05ae" - integrity sha512-A/f+xcrkIAZiJrvPpDvsrjxQX4cI2kbdiunQkwsYmOG3Bp4z89ZnsBiC7YBst4n2/g+QgTg0/KPVtODU5djooQ== - dependencies: - "@ledgerhq/devices" "^5.51.1" - "@ledgerhq/errors" "^5.50.0" - "@ledgerhq/hw-transport" "^5.51.1" - "@ledgerhq/logs" "^5.50.0" +"@ledgerhq/connect-kit-loader@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/connect-kit-loader/-/connect-kit-loader-1.1.0.tgz#10343b78ef13436818bf3453568a559c0eeb9d48" + integrity sha512-HUy12FEczoWY2FPubnsm1uOA8tkVWc0j90i47suThV3C9NL2xx69ZAIEU3Ytzs2bwLek9S1Q2S1VQJvA+3Ygkg== -"@ledgerhq/hw-transport@^5.11.0", "@ledgerhq/hw-transport@^5.51.1": - version "5.51.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz#8dd14a8e58cbee4df0c29eaeef983a79f5f22578" - integrity sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw== - dependencies: - "@ledgerhq/devices" "^5.51.1" - "@ledgerhq/errors" "^5.50.0" - events "^3.3.0" +"@lit-labs/ssr-dom-shim@^1.0.0", "@lit-labs/ssr-dom-shim@^1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.1.1.tgz#64df34e2f12e68e78ac57e571d25ec07fa460ca9" + integrity sha512-kXOeFbfCm4fFf2A3WwVEeQj55tMZa8c8/f9AKHMobQMkzNUfUj+antR3fRPaZJawsa1aZiP/Da3ndpZrwEe4rQ== -"@ledgerhq/hw-transport@~5.11.0": - version "5.11.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-5.11.0.tgz#f5c45a34d9b68d81fd2f6641b49815527720364b" - integrity sha512-z56iwv0DZZu20T5q9sNMHFQNVuRKYqzCuNFhY9woWSpmOQkyVHCRiEgOQbN5h6kVri6fkfPkDzqqcsYjJlnT9g== +"@lit/reactive-element@^1.3.0", "@lit/reactive-element@^1.6.0": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.6.1.tgz#0d958b6d479d0e3db5fc1132ecc4fa84be3f0b93" + integrity sha512-va15kYZr7KZNNPZdxONGQzpUr+4sxVu7V/VG7a8mRfPPXUyhEYj5RzXCQmGrlP3tAh0L3HHm5AjBMFYRqlM9SA== dependencies: - "@ledgerhq/devices" "^5.11.0" - "@ledgerhq/errors" "^5.11.0" - events "^3.1.0" - -"@ledgerhq/logs@^5.50.0": - version "5.50.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.50.0.tgz#29c6419e8379d496ab6d0426eadf3c4d100cd186" - integrity sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA== + "@lit-labs/ssr-dom-shim" "^1.0.0" "@metamask/safe-event-emitter@2.0.0", "@metamask/safe-event-emitter@^2.0.0": version "2.0.0" @@ -661,6 +449,82 @@ semver "^7.3.8" superstruct "^1.0.3" +"@motionone/animation@^10.15.1": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.15.1.tgz#4a85596c31cbc5100ae8eb8b34c459fb0ccf6807" + integrity sha512-mZcJxLjHor+bhcPuIFErMDNyrdb2vJur8lSfMCsuCB4UyV8ILZLvK+t+pg56erv8ud9xQGK/1OGPt10agPrCyQ== + dependencies: + "@motionone/easing" "^10.15.1" + "@motionone/types" "^10.15.1" + "@motionone/utils" "^10.15.1" + tslib "^2.3.1" + +"@motionone/dom@^10.16.2": + version "10.16.2" + resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.16.2.tgz#0c44df8ee3d1cfc50ee11d27050b27824355a61a" + integrity sha512-bnuHdNbge1FutZXv+k7xub9oPWcF0hsu8y1HTH/qg6av58YI0VufZ3ngfC7p2xhMJMnoh0LXFma2EGTgPeCkeg== + dependencies: + "@motionone/animation" "^10.15.1" + "@motionone/generators" "^10.15.1" + "@motionone/types" "^10.15.1" + "@motionone/utils" "^10.15.1" + hey-listen "^1.0.8" + tslib "^2.3.1" + +"@motionone/easing@^10.15.1": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/easing/-/easing-10.15.1.tgz#95cf3adaef34da6deebb83940d8143ede3deb693" + integrity sha512-6hIHBSV+ZVehf9dcKZLT7p5PEKHGhDwky2k8RKkmOvUoYP3S+dXsKupyZpqx5apjd9f+php4vXk4LuS+ADsrWw== + dependencies: + "@motionone/utils" "^10.15.1" + tslib "^2.3.1" + +"@motionone/generators@^10.15.1": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.15.1.tgz#dc6abb11139d1bafe758a41c134d4c753a9b871c" + integrity sha512-67HLsvHJbw6cIbLA/o+gsm7h+6D4Sn7AUrB/GPxvujse1cGZ38F5H7DzoH7PhX+sjvtDnt2IhFYF2Zp1QTMKWQ== + dependencies: + "@motionone/types" "^10.15.1" + "@motionone/utils" "^10.15.1" + tslib "^2.3.1" + +"@motionone/svelte@^10.16.2": + version "10.16.2" + resolved "https://registry.yarnpkg.com/@motionone/svelte/-/svelte-10.16.2.tgz#0b37c3b12927814d31d24941d1ca0ff49981b444" + integrity sha512-38xsroKrfK+aHYhuQlE6eFcGy0EwrB43Q7RGjF73j/kRUTcLNu/LAaKiLLsN5lyqVzCgTBVt4TMT/ShWbTbc5Q== + dependencies: + "@motionone/dom" "^10.16.2" + tslib "^2.3.1" + +"@motionone/types@^10.15.1": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.15.1.tgz#89441b54285012795cbba8612cbaa0fa420db3eb" + integrity sha512-iIUd/EgUsRZGrvW0jqdst8st7zKTzS9EsKkP+6c6n4MPZoQHwiHuVtTQLD6Kp0bsBLhNzKIBlHXponn/SDT4hA== + +"@motionone/utils@^10.15.1": + version "10.15.1" + resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.15.1.tgz#6b5f51bde75be88b5411e084310299050368a438" + integrity sha512-p0YncgU+iklvYr/Dq4NobTRdAPv9PveRDUXabPEeOjBLSO/1FNB2phNTZxOxpi1/GZwYpAoECEa0Wam+nsmhSw== + dependencies: + "@motionone/types" "^10.15.1" + hey-listen "^1.0.8" + tslib "^2.3.1" + +"@motionone/vue@^10.16.2": + version "10.16.2" + resolved "https://registry.yarnpkg.com/@motionone/vue/-/vue-10.16.2.tgz#faf13afc27620a2df870c71c58a04ee8de8dea65" + integrity sha512-7/dEK/nWQXOkJ70bqb2KyNfSWbNvWqKKq1C8juj+0Mg/AorgD8O5wE3naddK0G+aXuNMqRuc4jlsYHHWHtIzVw== + dependencies: + "@motionone/dom" "^10.16.2" + tslib "^2.3.1" + +"@next/bundle-analyzer@^13.4.3": + version "13.4.3" + resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-13.4.3.tgz#7e48a91eac582e32e4d235d8cf7503843f100000" + integrity sha512-jzWk6eaCFaIXfIswyQQWnR6FN22HpWoSWe3nLa3JCNkNd2ksriJgn86oQyZRxgAPaEbVKQXBp8GZi8e5DrhVJg== + dependencies: + webpack-bundle-analyzer "4.7.0" + "@next/env@12.2.1": version "12.2.1" resolved "https://registry.yarnpkg.com/@next/env/-/env-12.2.1.tgz#083cc88469931fc3dc32bb633623321c29971a09" @@ -738,6 +602,13 @@ resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.1.tgz#f3b186c8f7278656c7690a64f362d0d5b1d738af" integrity sha512-gx4aLMAZAVjtShiCrUSszoxnzBWJWf09Lkey6mcc0jFZjbz4xkyDbp53V229DtOYTUL4t0IZJ0I7+ftQ5CYIjg== +"@noble/curves@1.0.0", "@noble/curves@~1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.0.0.tgz#e40be8c7daf088aaf291887cbc73f43464a92932" + integrity sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw== + dependencies: + "@noble/hashes" "1.3.0" + "@noble/curves@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.1.0.tgz#f13fc667c89184bc04cccb9b11e8e7bae27d8c3d" @@ -745,6 +616,11 @@ dependencies: "@noble/hashes" "1.3.1" +"@noble/hashes@1.3.0", "@noble/hashes@~1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" + integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== + "@noble/hashes@1.3.1", "@noble/hashes@^1.3.0": version "1.3.1" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" @@ -771,11 +647,73 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@polka/url@^1.0.0-next.20": + version "1.0.0-next.21" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" + integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== + +"@rainbow-me/rainbowkit@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@rainbow-me/rainbowkit/-/rainbowkit-1.0.4.tgz#22f74c35ba036f7d1deb02528b162691ac5a32af" + integrity sha512-ceW0azA1EynlM21zG/bpA7QsXx8taX3NoR78Z1RgbZwujM//6PWJQRGBA4VvHJkmuio/R2lfP51inJucs+i4gg== + dependencies: + "@vanilla-extract/css" "1.9.1" + "@vanilla-extract/dynamic" "2.0.2" + "@vanilla-extract/sprinkles" "1.5.0" + clsx "1.1.1" + qrcode "1.5.0" + react-remove-scroll "2.5.4" + "@rushstack/eslint-patch@^1.1.3": version "1.1.4" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" integrity sha512-LwzQKA4vzIct1zNZzBmRKI9QuNpLgTQMEjsQLf3BXuGYb3QPTP4Yjf6mkdX+X1mYttZ808QpOwAzZjv28kq7DA== +"@safe-global/safe-apps-provider@^0.17.1": + version "0.17.1" + resolved "https://registry.yarnpkg.com/@safe-global/safe-apps-provider/-/safe-apps-provider-0.17.1.tgz#72df2a66be5343940ed505efe594ed3b0f2f7015" + integrity sha512-lYfRqrbbK1aKU1/UGkYWc/X7PgySYcumXKc5FB2uuwAs2Ghj8uETuW5BrwPqyjBknRxutFbTv+gth/JzjxAhdQ== + dependencies: + "@safe-global/safe-apps-sdk" "8.0.0" + events "^3.3.0" + +"@safe-global/safe-apps-sdk@8.0.0", "@safe-global/safe-apps-sdk@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@safe-global/safe-apps-sdk/-/safe-apps-sdk-8.0.0.tgz#9bdfe0e0d85e1b2d279bb840f40c4b930aaf8bc1" + integrity sha512-gYw0ki/EAuV1oSyMxpqandHjnthZjYYy+YWpTAzf8BqfXM3ItcZLpjxfg+3+mXW8HIO+3jw6T9iiqEXsqHaMMw== + dependencies: + "@safe-global/safe-gateway-typescript-sdk" "^3.5.3" + viem "^1.0.0" + +"@safe-global/safe-gateway-typescript-sdk@^3.5.3": + version "3.7.3" + resolved "https://registry.yarnpkg.com/@safe-global/safe-gateway-typescript-sdk/-/safe-gateway-typescript-sdk-3.7.3.tgz#68ec7d82711e2d0f82ce2e577b1df67ba8da2bed" + integrity sha512-O6JCgXNZWG0Vv8FnOEjKfcbsP0WxGvoPJk5ufqUrsyBlHup16It6oaLnn+25nXFLBZOHI1bz8429JlqAc2t2hg== + dependencies: + cross-fetch "^3.1.5" + +"@scure/base@~1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" + integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== + +"@scure/bip32@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.0.tgz#6c8d980ef3f290987736acd0ee2e0f0d50068d87" + integrity sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q== + dependencies: + "@noble/curves" "~1.0.0" + "@noble/hashes" "~1.3.0" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.0.tgz#a207e2ef96de354de7d0002292ba1503538fc77b" + integrity sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg== + dependencies: + "@noble/hashes" "~1.3.0" + "@scure/base" "~1.1.0" + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -957,6 +895,40 @@ dependencies: defer-to-connect "^1.0.1" +"@tanstack/query-core@4.29.5": + version "4.29.5" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.29.5.tgz#a0273e88bf2fc102c4c893dc7c034127b67fd5d9" + integrity sha512-xXIiyQ/4r9KfaJ3k6kejqcaqFXXBTzN2aOJ5H1J6aTJE9hl/nbgAdfF6oiIu0CD5xowejJEJ6bBg8TO7BN4NuQ== + +"@tanstack/query-persist-client-core@4.29.5": + version "4.29.5" + resolved "https://registry.yarnpkg.com/@tanstack/query-persist-client-core/-/query-persist-client-core-4.29.5.tgz#88ba2e532a7651bfa0d5eb4ba116ae94859a5bb3" + integrity sha512-IjLtEZiEUnzpcFVdHoZGqtjv2g0smLK5WOWk8hP/2ndlXe5kaSbtCKWO2WFbw7yWPYVMM2m9zyglZqg5kU1DMA== + dependencies: + "@tanstack/query-core" "4.29.5" + +"@tanstack/query-sync-storage-persister@^4.27.1": + version "4.29.5" + resolved "https://registry.yarnpkg.com/@tanstack/query-sync-storage-persister/-/query-sync-storage-persister-4.29.5.tgz#0d55e8e427d2ffcc39a14aab00c1812bc21d413c" + integrity sha512-A5K2owrQ1z/Ipndt/thv3vMXjRPOT02jwlXM51OV5IHg4FLQ9vlXvImYWlBoHmY1MMl91x9bqRgz0gX6hnr14g== + dependencies: + "@tanstack/query-persist-client-core" "4.29.5" + +"@tanstack/react-query-persist-client@^4.28.0": + version "4.29.5" + resolved "https://registry.yarnpkg.com/@tanstack/react-query-persist-client/-/react-query-persist-client-4.29.5.tgz#a7c6e08e30709b070a8db92573eee567173287e2" + integrity sha512-zvQChSqO/HpRHWjCn+4L4M45Yr2eslogJcQr2HFxRw27Wj/5WlFYhnQFo5SCCR+gZh09tMnkzD+zFhN76wMEGw== + dependencies: + "@tanstack/query-persist-client-core" "4.29.5" + +"@tanstack/react-query@^4.28.0": + version "4.29.5" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.29.5.tgz#3890741291f9f925933243d78bd74dfc59d64208" + integrity sha512-F87cibC3s3eG0Q90g2O+hqntpCrudKFnR8P24qkH9uccEhXErnJxBC/AAI4cJRV2bfMO8IeGZQYf3WyYgmSg0w== + dependencies: + "@tanstack/query-core" "4.29.5" + use-sync-external-store "^1.2.0" + "@types/bn.js@*", "@types/bn.js@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" @@ -1122,6 +1094,16 @@ dependencies: "@types/node" "*" +"@types/semver@^7.3.12": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" + integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== + +"@types/trusted-types@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.3.tgz#a136f83b0758698df454e328759dbd3d44555311" + integrity sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g== + "@types/utf8@^2.1.6": version "2.1.6" resolved "https://registry.yarnpkg.com/@types/utf8/-/utf8-2.1.6.tgz#430cabb71a42d0a3613cce5621324fe4f5a25753" @@ -1134,22 +1116,23 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@^5.30.5": - version "5.30.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz#e9a0afd6eb3b1d663db91cf1e7bc7584d394503d" - integrity sha512-lftkqRoBvc28VFXEoRgyZuztyVUQ04JvUnATSPtIRFAccbXTWL6DEtXGYMcbg998kXw1NLUJm7rTQ9eUt+q6Ig== +"@typescript-eslint/eslint-plugin@^5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.6.tgz#a350faef1baa1e961698240f922d8de1761a9e2b" + integrity sha512-sXtOgJNEuRU5RLwPUb1jxtToZbgvq3M6FPpY4QENxoOggK+UpTxUBpj6tD8+Qh2g46Pi9We87E+eHnUw8YcGsw== dependencies: - "@typescript-eslint/scope-manager" "5.30.5" - "@typescript-eslint/type-utils" "5.30.5" - "@typescript-eslint/utils" "5.30.5" + "@eslint-community/regexpp" "^4.4.0" + "@typescript-eslint/scope-manager" "5.59.6" + "@typescript-eslint/type-utils" "5.59.6" + "@typescript-eslint/utils" "5.59.6" debug "^4.3.4" - functional-red-black-tree "^1.0.1" + grapheme-splitter "^1.0.4" ignore "^5.2.0" - regexpp "^3.2.0" + natural-compare-lite "^1.4.0" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.21.0", "@typescript-eslint/parser@^5.30.5": +"@typescript-eslint/parser@^5.21.0": version "5.30.5" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.30.5.tgz#f667c34e4e4c299d98281246c9b1e68c03a92522" integrity sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q== @@ -1159,6 +1142,16 @@ "@typescript-eslint/typescript-estree" "5.30.5" debug "^4.3.4" +"@typescript-eslint/parser@^5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.6.tgz#bd36f71f5a529f828e20b627078d3ed6738dbb40" + integrity sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA== + dependencies: + "@typescript-eslint/scope-manager" "5.59.6" + "@typescript-eslint/types" "5.59.6" + "@typescript-eslint/typescript-estree" "5.59.6" + debug "^4.3.4" + "@typescript-eslint/scope-manager@5.30.5": version "5.30.5" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz#7f90b9d6800552c856a5f3644f5e55dd1469d964" @@ -1167,12 +1160,21 @@ "@typescript-eslint/types" "5.30.5" "@typescript-eslint/visitor-keys" "5.30.5" -"@typescript-eslint/type-utils@5.30.5": - version "5.30.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.30.5.tgz#7a9656f360b4b1daea635c4621dab053d08bf8a9" - integrity sha512-k9+ejlv1GgwN1nN7XjVtyCgE0BTzhzT1YsQF0rv4Vfj2U9xnslBgMYYvcEYAFVdvhuEscELJsB7lDkN7WusErw== +"@typescript-eslint/scope-manager@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.6.tgz#d43a3687aa4433868527cfe797eb267c6be35f19" + integrity sha512-gLbY3Le9Dxcb8KdpF0+SJr6EQ+hFGYFl6tVY8VxLPFDfUZC7BHFw+Vq7bM5lE9DwWPfx4vMWWTLGXgpc0mAYyQ== + dependencies: + "@typescript-eslint/types" "5.59.6" + "@typescript-eslint/visitor-keys" "5.59.6" + +"@typescript-eslint/type-utils@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.6.tgz#37c51d2ae36127d8b81f32a0a4d2efae19277c48" + integrity sha512-A4tms2Mp5yNvLDlySF+kAThV9VTBPCvGf0Rp8nl/eoDX9Okun8byTKoj3fJ52IJitjWOk0fKPNQhXEB++eNozQ== dependencies: - "@typescript-eslint/utils" "5.30.5" + "@typescript-eslint/typescript-estree" "5.59.6" + "@typescript-eslint/utils" "5.59.6" debug "^4.3.4" tsutils "^3.21.0" @@ -1181,6 +1183,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.30.5.tgz#36a0c05a72af3623cdf9ee8b81ea743b7de75a98" integrity sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw== +"@typescript-eslint/types@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.6.tgz#5a6557a772af044afe890d77c6a07e8c23c2460b" + integrity sha512-tH5lBXZI7T2MOUgOWFdVNUILsI02shyQvfzG9EJkoONWugCG77NDDa1EeDGw7oJ5IvsTAAGVV8I3Tk2PNu9QfA== + "@typescript-eslint/typescript-estree@5.30.5": version "5.30.5" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz#c520e4eba20551c4ec76af8d344a42eb6c9767bb" @@ -1194,17 +1201,32 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.30.5": - version "5.30.5" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.30.5.tgz#3999cbd06baad31b9e60d084f20714d1b2776765" - integrity sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA== +"@typescript-eslint/typescript-estree@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.6.tgz#2fb80522687bd3825504925ea7e1b8de7bb6251b" + integrity sha512-vW6JP3lMAs/Tq4KjdI/RiHaaJSO7IUsbkz17it/Rl9Q+WkQ77EOuOnlbaU8kKfVIOJxMhnRiBG+olE7f3M16DA== + dependencies: + "@typescript-eslint/types" "5.59.6" + "@typescript-eslint/visitor-keys" "5.59.6" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.6.tgz#82960fe23788113fc3b1f9d4663d6773b7907839" + integrity sha512-vzaaD6EXbTS29cVH0JjXBdzMt6VBlv+hE31XktDRMX1j3462wZCJa7VzO2AxXEXcIl8GQqZPcOPuW/Z1tZVogg== dependencies: + "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.30.5" - "@typescript-eslint/types" "5.30.5" - "@typescript-eslint/typescript-estree" "5.30.5" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.59.6" + "@typescript-eslint/types" "5.59.6" + "@typescript-eslint/typescript-estree" "5.59.6" eslint-scope "^5.1.1" - eslint-utils "^3.0.0" + semver "^7.3.7" "@typescript-eslint/visitor-keys@5.30.5": version "5.30.5" @@ -1214,10 +1236,88 @@ "@typescript-eslint/types" "5.30.5" eslint-visitor-keys "^3.3.0" -"@walletconnect/core@2.8.2", "@walletconnect/core@^2.7.3": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.8.2.tgz#81f35573a744b18e2ca0330d8ee71eb9297118f9" - integrity sha512-24ygQe1RIjcBQEh+I1KlhpLgKONrL0ll+2HIoLlSs/NLvsvNT7Ib2ku+ded8o82Pgji3DSSl5h0RNknkw2L5pQ== +"@typescript-eslint/visitor-keys@5.59.6": + version "5.59.6" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.6.tgz#673fccabf28943847d0c8e9e8d008e3ada7be6bb" + integrity sha512-zEfbFLzB9ETcEJ4HZEEsCR9HHeNku5/Qw1jSS5McYJv5BR+ftYXwFFAH5Al+xkGaZEqowMwl7uoJjQb1YSPF8Q== + dependencies: + "@typescript-eslint/types" "5.59.6" + eslint-visitor-keys "^3.3.0" + +"@vanilla-extract/css@1.9.1": + version "1.9.1" + resolved "https://registry.yarnpkg.com/@vanilla-extract/css/-/css-1.9.1.tgz#337b79faa5f8f98915a90c3fe3c30b54be746c09" + integrity sha512-pu2SFiff5jRhPwvGoj8cM5l/qIyLvigOmy22ss5DGjwV5pJYezRjDLxWumi2luIwioMWvh9EozCjyfH8nq+7fQ== + dependencies: + "@emotion/hash" "^0.8.0" + "@vanilla-extract/private" "^1.0.3" + ahocorasick "1.0.2" + chalk "^4.1.1" + css-what "^5.0.1" + cssesc "^3.0.0" + csstype "^3.0.7" + deep-object-diff "^1.1.0" + deepmerge "^4.2.2" + media-query-parser "^2.0.2" + outdent "^0.8.0" + +"@vanilla-extract/dynamic@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@vanilla-extract/dynamic/-/dynamic-2.0.2.tgz#13a3e461964c8029a52e6b6b631009ca6a8b27f5" + integrity sha512-U4nKaEQ8Kuz+exXEr51DUpyaOuzo24/S/k1YbDPQR06cYcNjQqvwFRnwWtZ+9ImocqM1wTKtzrdUgSTtLGIwAg== + dependencies: + "@vanilla-extract/private" "^1.0.3" + +"@vanilla-extract/private@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@vanilla-extract/private/-/private-1.0.3.tgz#7ec72bc2ff6fe51f9d650f962e8d1989b073690f" + integrity sha512-17kVyLq3ePTKOkveHxXuIJZtGYs+cSoev7BlP+Lf4916qfDhk/HBjvlYDe8egrea7LNPHKwSZJK/bzZC+Q6AwQ== + +"@vanilla-extract/sprinkles@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@vanilla-extract/sprinkles/-/sprinkles-1.5.0.tgz#c921183ae518bb484299c2dc81f2acefd91c3dbe" + integrity sha512-W58f2Rzz5lLmk0jbhgStVlZl5wEiPB1Ur3fRvUaBM+MrifZ3qskmFq/CiH//fEYeG5Dh9vF1qRviMMH46cX9Nw== + +"@wagmi/chains@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@wagmi/chains/-/chains-1.2.0.tgz#d59eaa70ec51a5fdcd113975926992acfb17ab12" + integrity sha512-dmDRipsE54JfyudOBkuhEexqQWcrZqxn/qiujG8SBzMh/az/AH5xlJSA+j1CPWTx9+QofSMF3B7A4gb6XRmSaQ== + +"@wagmi/chains@1.4.0", "@wagmi/chains@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@wagmi/chains/-/chains-1.4.0.tgz#71855105b510de0b412b8238016808dd9940d370" + integrity sha512-9HwJrhcZ1TxyrCbE10y7s1eSiSiyfGam7AHIOLYExaOX+vpOZ+MNTt4orFEDbEpz1fxwJDPPI38lanAUix1OSA== + +"@wagmi/connectors@2.6.3", "@wagmi/connectors@^2.6.4": + version "2.6.4" + resolved "https://registry.yarnpkg.com/@wagmi/connectors/-/connectors-2.6.4.tgz#c2a0cae01d10758370dee404bd74d427cfae7c4a" + integrity sha512-UrgYRNR573uy5exaVDMUfsZrcAh5rj5wNxZB+uN/3O45gOVZFh0o63ZmAWIvouuQDBJPr9UP2pNegEvi4v13cg== + dependencies: + "@coinbase/wallet-sdk" "^3.6.6" + "@ledgerhq/connect-kit-loader" "^1.1.0" + "@safe-global/safe-apps-provider" "^0.17.1" + "@safe-global/safe-apps-sdk" "^8.0.0" + "@walletconnect/ethereum-provider" "2.8.6" + "@walletconnect/legacy-provider" "^2.0.0" + "@walletconnect/modal" "2.5.9" + abitype "0.8.7" + eventemitter3 "^4.0.7" + +"@wagmi/core@1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@wagmi/core/-/core-1.3.4.tgz#91dd9b12cc576f0cff92aec9bda85e9f408bd385" + integrity sha512-2p6DVtKMRjkFljaQVIBtbH/oHpgoHQ1l9lSG8RmH6Z+Gm8IO67KdUbO0HuxceO/3sfBPrbNY6abbyMEaz0Rx1g== + dependencies: + "@wagmi/chains" "1.4.0" + "@wagmi/connectors" "2.6.3" + abitype "0.8.7" + eventemitter3 "^4.0.7" + zustand "^4.3.1" + +"@walletconnect/core@2.8.6": + version "2.8.6" + resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.8.6.tgz#1db6acae36437dbe7357be7767f1faeda5d4ca6c" + integrity sha512-rnSqm1KJLcww/v6+UH8JeibQkJ3EKgyUDPfEK0stSEkrIUIcXaFlq3Et8S+vgV8bPhI0MVUhAhFL5OJZ3t2ryg== dependencies: "@walletconnect/heartbeat" "1.2.1" "@walletconnect/jsonrpc-provider" "1.0.13" @@ -1230,12 +1330,33 @@ "@walletconnect/relay-auth" "^1.0.4" "@walletconnect/safe-json" "^1.0.2" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.8.2" - "@walletconnect/utils" "2.8.2" + "@walletconnect/types" "2.8.6" + "@walletconnect/utils" "2.8.6" events "^3.3.0" lodash.isequal "4.5.0" uint8arrays "^3.1.0" +"@walletconnect/crypto@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@walletconnect/crypto/-/crypto-1.0.3.tgz#7b8dd4d7e2884fe3543c7c07aea425eef5ef9dd4" + integrity sha512-+2jdORD7XQs76I2Odgr3wwrtyuLUXD/kprNVsjWRhhhdO9Mt6WqVzOPu0/t7OHSmgal8k7SoBQzUc5hu/8zL/g== + dependencies: + "@walletconnect/encoding" "^1.0.2" + "@walletconnect/environment" "^1.0.1" + "@walletconnect/randombytes" "^1.0.3" + aes-js "^3.1.2" + hash.js "^1.1.7" + tslib "1.14.1" + +"@walletconnect/encoding@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@walletconnect/encoding/-/encoding-1.0.2.tgz#cb3942ad038d6a6bf01158f66773062dd25724da" + integrity sha512-CrwSBrjqJ7rpGQcTL3kU+Ief+Bcuu9PH6JLOb+wM6NITX1GTxR/MfNwnQfhLKK6xpRAyj2/nM04OOH6wS8Imag== + dependencies: + is-typedarray "1.0.0" + tslib "1.14.1" + typedarray-to-buffer "3.1.5" + "@walletconnect/environment@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/environment/-/environment-1.0.1.tgz#1d7f82f0009ab821a2ba5ad5e5a7b8ae3b214cd7" @@ -1243,6 +1364,21 @@ dependencies: tslib "1.14.1" +"@walletconnect/ethereum-provider@2.8.6": + version "2.8.6" + resolved "https://registry.yarnpkg.com/@walletconnect/ethereum-provider/-/ethereum-provider-2.8.6.tgz#c9321aa89ce0a5fdc6bacb562c63bb33de88f412" + integrity sha512-wUvJEsXTLmMihrOhQxAs1k9hrWEOT03QBn54P9r9GpJbJ1zEfIjQaXFfi8uup6gldhH+vN38PsbOiLyv/6d3qQ== + dependencies: + "@walletconnect/jsonrpc-http-connection" "^1.0.7" + "@walletconnect/jsonrpc-provider" "^1.0.13" + "@walletconnect/jsonrpc-types" "^1.0.3" + "@walletconnect/jsonrpc-utils" "^1.0.8" + "@walletconnect/sign-client" "2.8.6" + "@walletconnect/types" "2.8.6" + "@walletconnect/universal-provider" "2.8.6" + "@walletconnect/utils" "2.8.6" + events "^3.3.0" + "@walletconnect/events@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/events/-/events-1.0.1.tgz#2b5f9c7202019e229d7ccae1369a9e86bda7816c" @@ -1260,7 +1396,27 @@ "@walletconnect/time" "^1.0.2" tslib "1.14.1" -"@walletconnect/jsonrpc-provider@1.0.13": +"@walletconnect/jsonrpc-http-connection@^1.0.4": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-http-connection/-/jsonrpc-http-connection-1.0.6.tgz#48c41cf3e5ac9add9425420b345615dc438594cd" + integrity sha512-/3zSqDi7JDN06E4qm0NmVYMitngXfh21UWwy8zeJcBeJc+Jcs094EbLsIxtziIIKTCCbT88lWuTjl1ZujxN7cw== + dependencies: + "@walletconnect/jsonrpc-utils" "^1.0.6" + "@walletconnect/safe-json" "^1.0.1" + cross-fetch "^3.1.4" + tslib "1.14.1" + +"@walletconnect/jsonrpc-http-connection@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-http-connection/-/jsonrpc-http-connection-1.0.7.tgz#a6973569b8854c22da707a759d241e4f5c2d5a98" + integrity sha512-qlfh8fCfu8LOM9JRR9KE0s0wxP6ZG9/Jom8M0qsoIQeKF3Ni0FyV4V1qy/cc7nfI46SLQLSl4tgWSfLiE1swyQ== + dependencies: + "@walletconnect/jsonrpc-utils" "^1.0.6" + "@walletconnect/safe-json" "^1.0.1" + cross-fetch "^3.1.4" + tslib "1.14.1" + +"@walletconnect/jsonrpc-provider@1.0.13", "@walletconnect/jsonrpc-provider@^1.0.13": version "1.0.13" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.13.tgz#9a74da648d015e1fffc745f0c7d629457f53648b" integrity sha512-K73EpThqHnSR26gOyNEL+acEex3P7VWZe6KE12ZwKzAt2H4e5gldZHbjsu2QR9cLeJ8AXuO7kEMOIcRv1QEc7g== @@ -1269,6 +1425,15 @@ "@walletconnect/safe-json" "^1.0.2" tslib "1.14.1" +"@walletconnect/jsonrpc-provider@^1.0.6": + version "1.0.12" + resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.12.tgz#965408d99fc889d49c194cd207804282805f45ed" + integrity sha512-6uI2y5281gloZSzICOjk+CVC7CVu0MhtMt2Yzpj05lPb0pzm/bK2oZ2ibxwLerPrqpNt/5bIFVRmoOgPw1mHAQ== + dependencies: + "@walletconnect/jsonrpc-utils" "^1.0.7" + "@walletconnect/safe-json" "^1.0.2" + tslib "1.14.1" + "@walletconnect/jsonrpc-types@1.0.3", "@walletconnect/jsonrpc-types@^1.0.2", "@walletconnect/jsonrpc-types@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.3.tgz#65e3b77046f1a7fa8347ae02bc1b841abe6f290c" @@ -1286,6 +1451,24 @@ "@walletconnect/jsonrpc-types" "^1.0.3" tslib "1.14.1" +"@walletconnect/jsonrpc-utils@^1.0.4": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.6.tgz#7fa58e6671247e64e189828103282e6258f5330f" + integrity sha512-snp0tfkjPiDLQp/jrBewI+9SM33GPV4+Gjgldod6XQ7rFyQ5FZjnBxUkY4xWH0+arNxzQSi6v5iDXjCjSaorpg== + dependencies: + "@walletconnect/environment" "^1.0.1" + "@walletconnect/jsonrpc-types" "^1.0.2" + tslib "1.14.1" + +"@walletconnect/jsonrpc-utils@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.7.tgz#1812d17c784f1ec0735bf03d0884287f60bfa2ce" + integrity sha512-zJziApzUF/Il4VcwabnaU+0yo1QI4eUkYX99zmCVTHJvZOf2l0zjADf/OpKqWyeNFC3Io56Z/8uJHVtcNVvyFA== + dependencies: + "@walletconnect/environment" "^1.0.1" + "@walletconnect/jsonrpc-types" "^1.0.2" + tslib "1.14.1" + "@walletconnect/jsonrpc-ws-connection@^1.0.11": version "1.0.11" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.11.tgz#1ce59d86f273d576ca73385961303ebd44dd923f" @@ -1297,13 +1480,73 @@ tslib "1.14.1" ws "^7.5.1" -"@walletconnect/keyvaluestorage@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.0.2.tgz#92f5ca0f54c1a88a093778842ce0c874d86369c8" - integrity sha512-U/nNG+VLWoPFdwwKx0oliT4ziKQCEoQ27L5Hhw8YOFGA2Po9A9pULUYNWhDgHkrb0gYDNt//X7wABcEWWBd3FQ== +"@walletconnect/keyvaluestorage@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.0.2.tgz#92f5ca0f54c1a88a093778842ce0c874d86369c8" + integrity sha512-U/nNG+VLWoPFdwwKx0oliT4ziKQCEoQ27L5Hhw8YOFGA2Po9A9pULUYNWhDgHkrb0gYDNt//X7wABcEWWBd3FQ== + dependencies: + safe-json-utils "^1.1.1" + tslib "1.14.1" + +"@walletconnect/legacy-client@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@walletconnect/legacy-client/-/legacy-client-2.0.0.tgz#9f2c09694789fd4b6c5d68d6423b44bac55aed30" + integrity sha512-v5L7rYk9loVnfvUf0mF+76bUPFaU5/Vh7mzL6/950CD/yoGdzYZ3Kj+L7mkC6HPMEGeQsBP1+sqBuiVGZ/aODA== + dependencies: + "@walletconnect/crypto" "^1.0.3" + "@walletconnect/encoding" "^1.0.2" + "@walletconnect/jsonrpc-utils" "^1.0.4" + "@walletconnect/legacy-types" "^2.0.0" + "@walletconnect/legacy-utils" "^2.0.0" + "@walletconnect/safe-json" "^1.0.1" + "@walletconnect/window-getters" "^1.0.1" + "@walletconnect/window-metadata" "^1.0.1" + detect-browser "^5.3.0" + query-string "^6.13.5" + +"@walletconnect/legacy-modal@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@walletconnect/legacy-modal/-/legacy-modal-2.0.0.tgz#d0fab01a1337a8f5d88cdb1430cbef2d46072bbf" + integrity sha512-jckNd8lMhm4X7dX9TDdxM3bXKJnaqkRs6K2Mo5j6GmbIF9Eyx40jZ5+q457RVxvM6ciZEDT5s1wBHWdWoOo+9Q== + dependencies: + "@walletconnect/legacy-types" "^2.0.0" + "@walletconnect/legacy-utils" "^2.0.0" + copy-to-clipboard "^3.3.3" + preact "^10.12.0" + qrcode "^1.5.1" + +"@walletconnect/legacy-provider@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@walletconnect/legacy-provider/-/legacy-provider-2.0.0.tgz#08e2db1e4c234743b2f30422bc8100bc42e8fc44" + integrity sha512-A8xPebMI1A+50HbWwTpFCbwP7G+1NGKdTKyg8BUUg3h3Y9JucpC1W6w/x0v1Xw7qFEqQnz74LoIN/A3ytH9xrQ== + dependencies: + "@walletconnect/jsonrpc-http-connection" "^1.0.4" + "@walletconnect/jsonrpc-provider" "^1.0.6" + "@walletconnect/legacy-client" "^2.0.0" + "@walletconnect/legacy-modal" "^2.0.0" + "@walletconnect/legacy-types" "^2.0.0" + "@walletconnect/legacy-utils" "^2.0.0" + +"@walletconnect/legacy-types@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@walletconnect/legacy-types/-/legacy-types-2.0.0.tgz#224278ae2874c6a2ca805c2d1d062a511dcf7227" + integrity sha512-sOVrA7HUdbI1OwKyPOQU0/DdvTSVFlsXWpAk2K2WvP2erTkBWPMTJq6cv2BmKdoJ3p6gLApT7sd+jHi3OF71uw== dependencies: - safe-json-utils "^1.1.1" - tslib "1.14.1" + "@walletconnect/jsonrpc-types" "^1.0.2" + +"@walletconnect/legacy-utils@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@walletconnect/legacy-utils/-/legacy-utils-2.0.0.tgz#e3a637c00783f9cd2ae139b640f82223ab78ed9d" + integrity sha512-CPWxSVVXw0kgNCxvU126g4GiV3mzXmC8IPJ15twE46aJ1FX+RHEIfAzFMFz2F2+fEhBxL63A7dwNQKDXorRPcQ== + dependencies: + "@walletconnect/encoding" "^1.0.2" + "@walletconnect/jsonrpc-utils" "^1.0.4" + "@walletconnect/legacy-types" "^2.0.0" + "@walletconnect/safe-json" "^1.0.1" + "@walletconnect/window-getters" "^1.0.1" + "@walletconnect/window-metadata" "^1.0.1" + detect-browser "^5.3.0" + query-string "^6.13.5" "@walletconnect/logger@^2.0.1": version "2.0.1" @@ -1313,6 +1556,42 @@ pino "7.11.0" tslib "1.14.1" +"@walletconnect/modal-core@2.5.9": + version "2.5.9" + resolved "https://registry.yarnpkg.com/@walletconnect/modal-core/-/modal-core-2.5.9.tgz#45e0c25320d42855aaac39e6ba256a84f972b871" + integrity sha512-isIebwF9hOknGouhS/Ob4YJ9Sa/tqNYG2v6Ua9EkCqIoLimepkG5eC53tslUWW29SLSfQ9qqBNG2+iE7yQXqgw== + dependencies: + buffer "6.0.3" + valtio "1.10.6" + +"@walletconnect/modal-ui@2.5.9": + version "2.5.9" + resolved "https://registry.yarnpkg.com/@walletconnect/modal-ui/-/modal-ui-2.5.9.tgz#4d07f1697147ec9f75d85d93f564cadae05a5e59" + integrity sha512-nfBaAT9Ls7RZTBBgAq+Nt/3AoUcinIJ9bcq5UHXTV3lOPu/qCKmUC/0HY3GvUK8ykabUAsjr0OAGmcqkB91qug== + dependencies: + "@walletconnect/modal-core" "2.5.9" + lit "2.7.5" + motion "10.16.2" + qrcode "1.5.3" + +"@walletconnect/modal@2.5.9": + version "2.5.9" + resolved "https://registry.yarnpkg.com/@walletconnect/modal/-/modal-2.5.9.tgz#28840f2a46bcd0a47c5fda60d18a5f1607a92a72" + integrity sha512-Zs2RvPwbBNRdBhb50FuJCxi3FJltt1KSpI7odjU/x9GTpTOcSOkmR66PBCy2JvNA0+ztnS1Xs0LVEr3lu7/Jzw== + dependencies: + "@walletconnect/modal-core" "2.5.9" + "@walletconnect/modal-ui" "2.5.9" + +"@walletconnect/randombytes@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@walletconnect/randombytes/-/randombytes-1.0.3.tgz#e795e4918367fd1e6a2215e075e64ab93e23985b" + integrity sha512-35lpzxcHFbTN3ABefC9W+uBpNZl1GC4Wpx0ed30gibfO/y9oLdy1NznbV96HARQKSBV9J9M/rrtIvf6a23jfYw== + dependencies: + "@walletconnect/encoding" "^1.0.2" + "@walletconnect/environment" "^1.0.1" + randombytes "^2.1.0" + tslib "1.14.1" + "@walletconnect/relay-api@^1.0.9": version "1.0.9" resolved "https://registry.yarnpkg.com/@walletconnect/relay-api/-/relay-api-1.0.9.tgz#f8c2c3993dddaa9f33ed42197fc9bfebd790ecaf" @@ -1340,19 +1619,19 @@ dependencies: tslib "1.14.1" -"@walletconnect/sign-client@^2.7.3": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.8.2.tgz#53211ad196b3deb5f0f4a6cbe0848c33ceec6098" - integrity sha512-TcViLWHE55SqYeFPDny1JTuktMOszffzYK5R22VAGOeHW3PhUqJoMcMXUEhSHuEeLcvGT1F25CiyNOWo2url/g== +"@walletconnect/sign-client@2.8.6": + version "2.8.6" + resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.8.6.tgz#7c83fa769d0403efd05172c72bd6b5f678e67a69" + integrity sha512-rOFTKTHP7oJfXgYHX7+SdB8VbcsEE3ZFG/bMdmZboWaBim1mrY3vUyDdKrNr0VgI3AwBiEQezQDfKxBX0pMSQQ== dependencies: - "@walletconnect/core" "2.8.2" + "@walletconnect/core" "2.8.6" "@walletconnect/events" "^1.0.1" "@walletconnect/heartbeat" "1.2.1" "@walletconnect/jsonrpc-utils" "1.0.8" "@walletconnect/logger" "^2.0.1" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.8.2" - "@walletconnect/utils" "2.8.2" + "@walletconnect/types" "2.8.6" + "@walletconnect/utils" "2.8.6" events "^3.3.0" "@walletconnect/time@^1.0.2": @@ -1362,10 +1641,10 @@ dependencies: tslib "1.14.1" -"@walletconnect/types@2.8.2", "@walletconnect/types@^2.7.3": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.8.2.tgz#0c958d75bef70390a5f30cbdf0c05fe96e5de85c" - integrity sha512-TzFGL2+SEU5jTt/i+kOZhcboqxhkDL+HaFcVl5+CVS6i67dYCjHu2AUkx6NARRmVzJZV5tTIjSDnpPXARoJaZA== +"@walletconnect/types@2.8.6": + version "2.8.6" + resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.8.6.tgz#71426144db3fa693170a95f89f5d6e594ab2d901" + integrity sha512-Z/PFa3W1XdxeTcCtdR6lUsFgZfU/69wWJBPyclPwn7cu1+eriuCr6XZXQpJjib3flU+HnwHiXeUuqZaheehPxw== dependencies: "@walletconnect/events" "^1.0.1" "@walletconnect/heartbeat" "1.2.1" @@ -1374,10 +1653,25 @@ "@walletconnect/logger" "^2.0.1" events "^3.3.0" -"@walletconnect/utils@2.8.2", "@walletconnect/utils@^2.7.3": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.8.2.tgz#7f280b05e572be89588275dc67a7bcc3c1fe4fc2" - integrity sha512-VyOL1iuE7X7BorBlyB5t/FCZsFMihF5JO7gNjpharIZMRoIjiXv2SVKU+qbPT/LyrGswJ0Fkjia+hXUb3tGaWw== +"@walletconnect/universal-provider@2.8.6": + version "2.8.6" + resolved "https://registry.yarnpkg.com/@walletconnect/universal-provider/-/universal-provider-2.8.6.tgz#f23640147f184c9a794a595db2d4f7b782ffdbfa" + integrity sha512-ln1RVv8+oHu9enOJ/oVkjiarneB+4vJCk16znOklIN2JtDHwB8iObDHlQH3UE6ynNTw1iRvaGuPR4g+YdIfB6w== + dependencies: + "@walletconnect/jsonrpc-http-connection" "^1.0.7" + "@walletconnect/jsonrpc-provider" "1.0.13" + "@walletconnect/jsonrpc-types" "^1.0.2" + "@walletconnect/jsonrpc-utils" "^1.0.7" + "@walletconnect/logger" "^2.0.1" + "@walletconnect/sign-client" "2.8.6" + "@walletconnect/types" "2.8.6" + "@walletconnect/utils" "2.8.6" + events "^3.3.0" + +"@walletconnect/utils@2.8.6": + version "2.8.6" + resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.8.6.tgz#8a4f6b19525e33822f8da1aa94c4eef21482eeda" + integrity sha512-wcy6e5+COYo7tfNnW8YqidnATdJDIW6vDiWWE7A1F78Sl/VflkaevB9cIgyn8eLdxC1SxXgGoeC2oLP90nnHJg== dependencies: "@stablelib/chacha20poly1305" "1.0.1" "@stablelib/hkdf" "1.0.1" @@ -1387,7 +1681,7 @@ "@walletconnect/relay-api" "^1.0.9" "@walletconnect/safe-json" "^1.0.2" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.8.2" + "@walletconnect/types" "2.8.6" "@walletconnect/window-getters" "^1.0.1" "@walletconnect/window-metadata" "^1.0.1" detect-browser "5.3.0" @@ -1548,6 +1842,16 @@ JSONStream@^1.3.5: jsonparse "^1.2.0" through ">=2.2.7 <3" +abitype@0.8.11: + version "0.8.11" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.8.11.tgz#66e1cf2cbf46f48d0e57132d7c1c392447536cc1" + integrity sha512-bM4v2dKvX08sZ9IU38IN5BKmN+ZkOSd2oI4a9f0ejHYZQYV6cDr7j+d95ga0z2XHG36Y4jzoG5Z7qDqxp7fi/A== + +abitype@0.8.7: + version "0.8.7" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.8.7.tgz#e4b3f051febd08111f486c0cc6a98fa72d033622" + integrity sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w== + accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" @@ -1580,16 +1884,31 @@ acorn-walk@^7.0.0: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.0.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + acorn@^7.0.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== +acorn@^8.0.4: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + acorn@^8.5.0, acorn@^8.7.1: version "8.8.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== +aes-js@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" + integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== + agentkeepalive@^4.2.1: version "4.3.0" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.3.0.tgz#bb999ff07412653c1803b3ced35e50729830a255" @@ -1599,6 +1918,11 @@ agentkeepalive@^4.2.1: depd "^2.0.0" humanize-ms "^1.2.1" +ahocorasick@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/ahocorasick/-/ahocorasick-1.0.2.tgz#9eee93aef9d02bfb476d9b648d9b7a40ef2fd500" + integrity sha512-hCOfMzbFx5IDutmWLAt6MZwOUjIfSM9G9FyVxytmE4Rs/5YDPWQrD/+IR1w+FweD9H2oOZEnv36TmkjhNURBVA== + ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" @@ -1811,11 +2135,6 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bech32@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" - integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== - bigint-buffer@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442" @@ -1865,7 +2184,7 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.6, bn.js@^4.11.9: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== @@ -2076,22 +2395,22 @@ camelcase@^5.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001335: - version "1.0.30001363" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001363.tgz#26bec2d606924ba318235944e1193304ea7c4f15" - integrity sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg== +caniuse-lite@^1.0.30001332: + version "1.0.30001488" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001488.tgz#d19d7b6e913afae3e98f023db97c19e9ddc5e91f" + integrity sha512-NORIQuuL4xGpIy6iCCQGN4iFjlBXtfKWIenlUuyZJumLRIindLb7wXM+GO8erEhb7vXfcnf4BAg2PrSDN5TNLQ== -caniuse-lite@^1.0.30001366: - version "1.0.30001368" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001368.tgz#c5c06381c6051cd863c45021475434e81936f713" - integrity sha512-wgfRYa9DenEomLG/SdWgQxpIyvdtH3NW8Vq+tB6AwR9e56iOIcu1im5F/wNdDf04XlKHXqIx4N8Jo0PemeBenQ== +caniuse-lite@^1.0.30001335, caniuse-lite@^1.0.30001366: + version "1.0.30001473" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001473.tgz" + integrity sha512-ewDad7+D2vlyy+E4UJuVfiBsU69IL+8oVmTuZnH5Q6CIUbxNfI50uVpRHbUPDD6SUaN2o0Lh4DhTrvLG/Tn1yg== caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== -chalk@^4.0.0: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2164,6 +2483,11 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" +clsx@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188" + integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA== + clsx@^1.1.0, clsx@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" @@ -2193,6 +2517,11 @@ commander@^2.20.0, commander@^2.20.3: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + compliance-sdk@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/compliance-sdk/-/compliance-sdk-1.0.5.tgz#42c5a8d82ec9bf25512bb448d7c6bf2138dd8ced" @@ -2239,6 +2568,13 @@ cookiejar@^2.1.1: resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.4.tgz#ee669c1fea2cf42dc31585469d193fef0d65771b" integrity sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw== +copy-to-clipboard@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz#55ac43a1db8ae639a4bd99511c148cdd1b83a1b0" + integrity sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA== + dependencies: + toggle-selection "^1.0.6" + core-js-pure@^3.20.2: version "3.23.3" resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.23.3.tgz#bcd02d3d8ec68ad871ef50d5ccbb248ddb54f401" @@ -2257,11 +2593,6 @@ cors@^2.8.1: object-assign "^4" vary "^1" -crc-32@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" - integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== - create-ecdh@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" @@ -2293,7 +2624,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" -cross-fetch@^3.0.6: +cross-fetch@^3.0.6, cross-fetch@^3.1.4, cross-fetch@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== @@ -2326,6 +2657,11 @@ crypto-browserify@3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" +css-what@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe" + integrity sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw== + cssesc@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" @@ -2336,6 +2672,11 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2" integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA== +csstype@^3.0.7: + version "3.1.2" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.2.tgz#1d4bf9d572f11c14031f0436e1c10bc1f571f50b" + integrity sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ== + d@1, d@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" @@ -2356,6 +2697,11 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +date-fns@^2.29.3: + version "2.29.3" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8" + integrity sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA== + dayjs@^1.11.4: version "1.11.4" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.4.tgz#3b3c10ca378140d8917e06ebc13a4922af4f433e" @@ -2375,7 +2721,7 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -2404,6 +2750,16 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== +deep-object-diff@^1.1.0: + version "1.1.9" + resolved "https://registry.yarnpkg.com/deep-object-diff/-/deep-object-diff-1.1.9.tgz#6df7ef035ad6a0caa44479c536ed7b02570f4595" + integrity sha512-Rn+RuwkmkDwCi2/oXOFS9Gsr5lJZu/yTGpK7wAaAIE75CC+LCGEZHpY6VQJa/RoJcrmaA/docWJZvYohlNkWPA== + +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + defer-to-connect@^1.0.1: version "1.1.3" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" @@ -2450,11 +2806,16 @@ destroy@1.2.0: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== -detect-browser@5.3.0: +detect-browser@5.3.0, detect-browser@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.3.0.tgz#9705ef2bddf46072d0f7265a1fe300e36fe7ceca" integrity sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w== +detect-node-es@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493" + integrity sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ== + detective@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.1.tgz#6af01eeda11015acb0e73f933242b70f24f91034" @@ -2527,6 +2888,11 @@ duplexer3@^0.1.4: resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.5.tgz#0b5e4d7bad5de8901ea4440624c8e1d20099217e" integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== +duplexer@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" + integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== + duplexify@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" @@ -3072,17 +3438,6 @@ ethereumjs-util@^6.0.0: ethjs-util "0.1.6" rlp "^2.2.3" -ethereumjs-util@^7.0.10, ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.3, ethereumjs-util@^7.1.5: - version "7.1.5" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" - integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== - dependencies: - "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - rlp "^2.2.4" - ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -3109,7 +3464,7 @@ eventemitter3@^4.0.7: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -events@^3.1.0, events@^3.2.0, events@^3.3.0: +events@^3.2.0, events@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== @@ -3176,6 +3531,11 @@ extend@~3.0.2: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== +extract-files@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/extract-files/-/extract-files-9.0.0.tgz#8a7744f2437f81f5ed3250ed9f1550de902fe54a" + integrity sha512-CvdFfHkC95B4bBBk36hcEmvdR2awOdhhVUYH6S/zrVj3477zven/fJMYg7121h4T1xHZC+tetUpubpAhxwI7hQ== + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -3321,6 +3681,15 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== +form-data@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -3424,6 +3793,11 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.3" +get-nonce@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-nonce/-/get-nonce-1.0.1.tgz#fdf3f0278073820d2ce9426c18f07481b1e0cdf3" + integrity sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q== + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -3570,6 +3944,33 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.4, graceful-fs@^4.2.9: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + +graphql-request@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-5.2.0.tgz#a05fb54a517d91bb2d7aefa17ade4523dc5ebdca" + integrity sha512-pLhKIvnMyBERL0dtFI3medKqWOz/RhHdcgbZ+hMMIb32mEPa5MJSzS4AuXxfI4sRAu6JVVk5tvXuGfCWl9JYWQ== + dependencies: + "@graphql-typed-document-node/core" "^3.1.1" + cross-fetch "^3.1.5" + extract-files "^9.0.0" + form-data "^3.0.0" + +graphql@^16.6.0: + version "16.6.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.6.0.tgz#c2dcffa4649db149f6282af726c8c83f1c7c5fdb" + integrity sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw== + +gzip-size@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" + integrity sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q== + dependencies: + duplexer "^0.1.2" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -3648,6 +4049,11 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hey-listen@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" + integrity sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q== + hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -3758,6 +4164,13 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" +invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + io-ts@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-2.0.1.tgz#1261c12f915c2f48d16393a36966636b48a45aa1" @@ -3928,7 +4341,7 @@ is-typed-array@^1.1.3, is-typed-array@^1.1.9: for-each "^0.3.3" has-tostringtag "^1.0.0" -is-typedarray@^1.0.0, is-typedarray@~1.0.0: +is-typedarray@1.0.0, is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== @@ -3945,13 +4358,10 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isomorphic-fetch@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4" - integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== - dependencies: - node-fetch "^2.6.1" - whatwg-fetch "^3.4.1" +isomorphic-ws@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz#e5529148912ecb9b451b46ed44d53dae1ce04bbf" + integrity sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw== isomorphic-ws@^4.0.1: version "4.0.1" @@ -4160,6 +4570,31 @@ lilconfig@^2.0.5: resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.5.tgz#19e57fd06ccc3848fd1891655b5a447092225b25" integrity sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg== +lit-element@^3.3.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.3.2.tgz#9913bf220b85065f0e5f1bb8878cc44f36b50cfa" + integrity sha512-xXAeVWKGr4/njq0rGC9dethMnYCq5hpKYrgQZYTzawt9YQhMiXfD+T1RgrdY3NamOxwq2aXlb0vOI6e29CKgVQ== + dependencies: + "@lit-labs/ssr-dom-shim" "^1.1.0" + "@lit/reactive-element" "^1.3.0" + lit-html "^2.7.0" + +lit-html@^2.7.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.7.3.tgz#903bfa61f9d3296a0ec94128695e452beb9b1a3a" + integrity sha512-9DyLzcn/kbRGowz2vFmSANFbRZTxYUgYYFqzie89w6GLpPUiBCDHfcdeRUV/k3Q2ueYxNjfv46yPCtKAEAPOVw== + dependencies: + "@types/trusted-types" "^2.0.2" + +lit@2.7.5: + version "2.7.5" + resolved "https://registry.yarnpkg.com/lit/-/lit-2.7.5.tgz#60bc82990cfad169d42cd786999356dcf79b035f" + integrity sha512-i/cH7Ye6nBDUASMnfwcictBnsTN91+aBjXoTHF2xARghXScKxpD4F4WYI+VLXg9lqbMinDfvoI7VnZXjyHgdfQ== + dependencies: + "@lit/reactive-element" "^1.6.0" + lit-element "^3.3.0" + lit-html "^2.7.0" + loader-runner@^4.2.0: version "4.3.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" @@ -4190,6 +4625,11 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash@^4.17.20: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -4223,6 +4663,13 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +media-query-parser@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/media-query-parser/-/media-query-parser-2.0.2.tgz#ff79e56cee92615a304a1c2fa4f2bd056c0a1d29" + integrity sha512-1N4qp+jE0pL5Xv4uEcwVUhIkwdUO3S/9gML90nqKA7v7FcOS5vUtatfzok9S9U1EJU8dHWlcv95WLnKmmxZI9w== + dependencies: + "@babel/runtime" "^7.12.5" + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -4354,6 +4801,23 @@ mock-fs@^4.1.0: resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" integrity sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw== +motion@10.16.2: + version "10.16.2" + resolved "https://registry.yarnpkg.com/motion/-/motion-10.16.2.tgz#7dc173c6ad62210a7e9916caeeaf22c51e598d21" + integrity sha512-p+PurYqfUdcJZvtnmAqu5fJgV2kR0uLFQuBKtLeFVTrYEVllI99tiOTSefVNYuip9ELTEkepIIDftNdze76NAQ== + dependencies: + "@motionone/animation" "^10.15.1" + "@motionone/dom" "^10.16.2" + "@motionone/svelte" "^10.16.2" + "@motionone/types" "^10.15.1" + "@motionone/utils" "^10.15.1" + "@motionone/vue" "^10.16.2" + +mrmime@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27" + integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -4419,11 +4883,21 @@ nano-json-stream-parser@^0.1.2: resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" integrity sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew== -nanoid@^3.1.30, nanoid@^3.3.4: +nanoid@^3.1.30: + version "3.3.6" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" + integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== + +nanoid@^3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -4475,7 +4949,7 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== -node-fetch@2.6.7, node-fetch@^2.6.1: +node-fetch@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -4618,6 +5092,11 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" +opener@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" + integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== + optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -4630,6 +5109,11 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +outdent@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/outdent/-/outdent-0.8.0.tgz#2ebc3e77bf49912543f1008100ff8e7f44428eb0" + integrity sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A== + p-cancelable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" @@ -4891,6 +5375,11 @@ postcss@^8.4.14: picocolors "^1.0.0" source-map-js "^1.0.2" +preact@^10.12.0: + version "10.13.2" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.13.2.tgz#2c40c73d57248b57234c4ae6cd9ab9d8186ebc0a" + integrity sha512-q44QFLhOhty2Bd0Y46fnYW0gD/cbVM9dUVtNTDKPcdXSMA7jfY+Jpd6rk3GB0lcQss0z5s/6CmVP0Z/hV+g6pw== + preact@^10.5.9: version "10.15.1" resolved "https://registry.yarnpkg.com/preact/-/preact-10.15.1.tgz#a1de60c9fc0c79a522d969c65dcaddc5d994eede" @@ -4943,6 +5432,11 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" +proxy-compare@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/proxy-compare/-/proxy-compare-2.5.1.tgz#17818e33d1653fbac8c2ec31406bce8a2966f600" + integrity sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA== + psl@^1.1.28: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" @@ -4978,7 +5472,7 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qrcode@^1.5.0: +qrcode@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.0.tgz#95abb8a91fdafd86f8190f2836abbfc500c72d1b" integrity sha512-9MgRpgVc+/+47dFvQeD6U2s0Z92EsKzcHogtum4QB+UNd025WOJSHvn/hjk9xmzj7Stj95CyUAs31mrjxliEsQ== @@ -4988,6 +5482,16 @@ qrcode@^1.5.0: pngjs "^5.0.0" yargs "^15.3.1" +qrcode@1.5.3, qrcode@^1.5.1: + version "1.5.3" + resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.3.tgz#03afa80912c0dccf12bc93f615a535aad1066170" + integrity sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg== + dependencies: + dijkstrajs "^1.0.1" + encode-utf8 "^1.0.3" + pngjs "^5.0.0" + yargs "^15.3.1" + qs@6.10.3: version "6.10.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" @@ -5026,6 +5530,16 @@ query-string@^5.0.1: object-assign "^4.1.0" strict-uri-encode "^1.0.0" +query-string@^6.13.5: + version "6.14.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" + integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== + dependencies: + decode-uri-component "^0.2.0" + filter-obj "^1.1.0" + split-on-first "^1.0.0" + strict-uri-encode "^2.0.0" + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -5071,13 +5585,6 @@ raw-body@2.5.1: iconv-lite "0.4.24" unpipe "1.0.0" -react-device-detect@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/react-device-detect/-/react-device-detect-2.2.3.tgz#97a7ae767cdd004e7c3578260f48cf70c036e7ca" - integrity sha512-buYY3qrCnQVlIFHrC5UcUoAj7iANs/+srdkwsnNjI7anr3Tt7UY6MqNxtMLlr0tMBied0O49UZVK8XKs3ZIiPw== - dependencies: - ua-parser-js "^1.0.33" - react-dom@18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" @@ -5086,21 +5593,6 @@ react-dom@18.2.0: loose-envify "^1.1.0" scheduler "^0.23.0" -react-fast-compare@^3.1.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb" - integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA== - -react-helmet@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726" - integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw== - dependencies: - object-assign "^4.1.1" - prop-types "^15.7.2" - react-fast-compare "^3.1.1" - react-side-effect "^2.1.0" - react-is@^16.13.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -5111,7 +5603,7 @@ react-lifecycles-compat@^3.0.0: resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== -react-modal@^3.14.4, react-modal@^3.15.1: +react-modal@^3.15.1: version "3.15.1" resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.15.1.tgz#950ce67bfef80971182dd0ed38f2d9b1a681288b" integrity sha512-duB9bxOaYg7Zt6TMFldIFxQRtSP+Dg3F1ZX3FXxSUn+3tZZ/9JCgeAQKDg7rhZSAqopq8TFRw3yIbnx77gyFTw== @@ -5128,10 +5620,33 @@ react-number-format@^4.9.3: dependencies: prop-types "^15.7.2" -react-side-effect@^2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.2.tgz#dc6345b9e8f9906dc2eeb68700b615e0b4fe752a" - integrity sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw== +react-remove-scroll-bar@^2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz#53e272d7a5cb8242990c7f144c44d8bd8ab5afd9" + integrity sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A== + dependencies: + react-style-singleton "^2.2.1" + tslib "^2.0.0" + +react-remove-scroll@2.5.4: + version "2.5.4" + resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.4.tgz#afe6491acabde26f628f844b67647645488d2ea0" + integrity sha512-xGVKJJr0SJGQVirVFAUZ2k1QLyO6m+2fy0l8Qawbp5Jgrv3DeLalrfMNBFSlmz5kriGGzsVBtGVnf4pTKIhhWA== + dependencies: + react-remove-scroll-bar "^2.3.3" + react-style-singleton "^2.2.1" + tslib "^2.1.0" + use-callback-ref "^1.3.0" + use-sidecar "^1.1.2" + +react-style-singleton@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.1.tgz#f99e420492b2d8f34d38308ff660b60d0b1205b4" + integrity sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g== + dependencies: + get-nonce "^1.0.0" + invariant "^2.2.4" + tslib "^2.0.0" react-toastify@^9.0.5: version "9.0.5" @@ -5150,6 +5665,11 @@ react-transition-group@^4.4.5: loose-envify "^1.4.0" prop-types "^15.6.2" +react-use-async-callback@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/react-use-async-callback/-/react-use-async-callback-2.1.2.tgz#0aedc3242f50605bfb726921dd7c055a772ff5ae" + integrity sha512-0BFrqKmVPiMBYYr0xJhuyTK3cUaChs/Bz2or3FaPxntPkP7LVjDTFy1NY8bS77Ho8fYQddQWHCq/KMD/9s0ffw== + react@18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" @@ -5304,7 +5824,7 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rlp@^2.0.0, rlp@^2.2.3, rlp@^2.2.4: +rlp@^2.0.0, rlp@^2.2.3: version "2.2.7" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== @@ -5331,7 +5851,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@6, rxjs@^6.6.3: +rxjs@^6.6.3: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== @@ -5526,6 +6046,15 @@ simple-get@^2.7.0: once "^1.3.1" simple-concat "^1.0.0" +sirv@^1.0.7: + version "1.0.19" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.19.tgz#1d73979b38c7fe91fcba49c85280daa9c2363b49" + integrity sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ== + dependencies: + "@polka/url" "^1.0.0-next.20" + mrmime "^1.0.0" + totalist "^1.0.0" + slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -5838,11 +6367,21 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +toggle-selection@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32" + integrity sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ== + toidentifier@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +totalist@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" + integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== + tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" @@ -5876,6 +6415,11 @@ tslib@^2.0.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== +tslib@^2.1.0, tslib@^2.3.1: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + tslib@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" @@ -5930,22 +6474,17 @@ type@^2.5.0: resolved "https://registry.yarnpkg.com/type/-/type-2.6.0.tgz#3ca6099af5981d36ca86b78442973694278a219f" integrity sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ== -typedarray-to-buffer@^3.1.5: +typedarray-to-buffer@3.1.5, typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== dependencies: is-typedarray "^1.0.0" -typescript@4.7.4: - version "4.7.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== - -ua-parser-js@^1.0.33: - version "1.0.35" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.35.tgz#c4ef44343bc3db0a3cbefdf21822f1b1fc1ab011" - integrity sha512-fKnGuqmTBnIE+/KXSzCn4db8RTigUzw1AN0DmdU6hJovUTbYJKyqj+8Mt1c4VfRDnOVJnENmfYkIPZ946UrSAA== +typescript@5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" + integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== uint8arrays@^3.0.0, uint8arrays@^3.1.0: version "3.1.1" @@ -6023,11 +6562,31 @@ url-to-options@^1.0.1: resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" integrity sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A== +use-callback-ref@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.0.tgz#772199899b9c9a50526fedc4993fc7fa1f7e32d5" + integrity sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w== + dependencies: + tslib "^2.0.0" + +use-sidecar@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.1.2.tgz#2f43126ba2d7d7e117aa5855e5d8f0276dfe73c2" + integrity sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw== + dependencies: + detect-node-es "^1.1.0" + tslib "^2.0.0" + use-sync-external-store@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.1.0.tgz#3343c3fe7f7e404db70f8c687adf5c1652d34e82" integrity sha512-SEnieB2FPKEVne66NpXPd1Np4R1lTNKfjuy3XdIoPQKYBAFdzbzSZlSn1KJZUiihQLQC5Znot4SBz1EOTBwQAQ== +use-sync-external-store@1.2.0, use-sync-external-store@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + utf-8-validate@^5.0.2: version "5.0.9" resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.9.tgz#ba16a822fbeedff1a58918f2a6a6b36387493ea3" @@ -6093,6 +6652,14 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== +valtio@1.10.6: + version "1.10.6" + resolved "https://registry.yarnpkg.com/valtio/-/valtio-1.10.6.tgz#80ed00198b949939863a0fa56ae687abb417fc4f" + integrity sha512-SxN1bHUmdhW6V8qsQTpCgJEwp7uHbntuH0S9cdLQtiohuevwBksbpXjwj5uDMA7bLwg1WKyq9sEpZrx3TIMrkA== + dependencies: + proxy-compare "2.5.1" + use-sync-external-store "1.2.0" + varint@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" @@ -6112,6 +6679,48 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +viem@^1.0.0: + version "1.1.8" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.1.8.tgz#af5f8e2d3339be1db36405f3c0f15f5243658ce9" + integrity sha512-sMIbBu/rKI4paCWvCxpDNAT7vO9nCtu9SKXdVk5lwMVRL/HmMFCiIBtvRO0IiqlrvZTFCWnPEMn7ndNRyb+NCQ== + dependencies: + "@adraffy/ens-normalize" "1.9.0" + "@noble/curves" "1.0.0" + "@noble/hashes" "1.3.0" + "@scure/bip32" "1.3.0" + "@scure/bip39" "1.2.0" + "@wagmi/chains" "1.2.0" + abitype "0.8.7" + isomorphic-ws "5.0.0" + ws "8.12.0" + +viem@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.2.9.tgz#8ccf786cd00d28b14b644f2b9fe35fc6bf2bdc41" + integrity sha512-EnEbTuAAHv43unUgMISdQXbD9mrhZLvOdmf6eRGbDFl+XwP/PEzZAT79RaWAuDPnLXGMP1gBCJF++NFjSMukUw== + dependencies: + "@adraffy/ens-normalize" "1.9.0" + "@noble/curves" "1.0.0" + "@noble/hashes" "1.3.0" + "@scure/bip32" "1.3.0" + "@scure/bip39" "1.2.0" + "@wagmi/chains" "1.2.0" + abitype "0.8.11" + isomorphic-ws "5.0.0" + ws "8.12.0" + +wagmi@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/wagmi/-/wagmi-1.3.4.tgz#1c2310a7bb3f30a92dfa85509351b440bfd8929a" + integrity sha512-PY+8coQDfQsXiJZq8KGYTzVRe708bMn7OFrbGq2NhykahkfsIB0QtEGDtpoa3Kvkt4RO68ClRSmH6vmt1ZqYSA== + dependencies: + "@tanstack/query-sync-storage-persister" "^4.27.1" + "@tanstack/react-query" "^4.28.0" + "@tanstack/react-query-persist-client" "^4.28.0" + "@wagmi/core" "1.3.4" + abitype "0.8.7" + use-sync-external-store "^1.2.0" + warning@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" @@ -6137,15 +6746,6 @@ web3-bzz@1.3.6: swarm-js "^0.1.40" underscore "1.12.1" -web3-bzz@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.7.4.tgz#9419e606e38a9777443d4ce40506ebd796e06075" - integrity sha512-w9zRhyEqTK/yi0LGRHjZMcPCfP24LBjYXI/9YxFw9VqsIZ9/G0CRCnUt12lUx0A56LRAMpF7iQ8eA73aBcO29Q== - dependencies: - "@types/node" "^12.12.6" - got "9.6.0" - swarm-js "^0.1.40" - web3-core-helpers@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.3.6.tgz#c478246a9abe4e5456acf42657dac2f7c330be74" @@ -6155,14 +6755,6 @@ web3-core-helpers@1.3.6: web3-eth-iban "1.3.6" web3-utils "1.3.6" -web3-core-helpers@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.7.4.tgz#f8f808928560d3e64e0c8d7bdd163aa4766bcf40" - integrity sha512-F8PH11qIkE/LpK4/h1fF/lGYgt4B6doeMi8rukeV/s4ivseZHHslv1L6aaijLX/g/j4PsFmR42byynBI/MIzFg== - dependencies: - web3-eth-iban "1.7.4" - web3-utils "1.7.4" - web3-core-method@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.3.6.tgz#4b0334edd94b03dfec729d113c69a4eb6ebc68ae" @@ -6175,17 +6767,6 @@ web3-core-method@1.3.6: web3-core-subscriptions "1.3.6" web3-utils "1.3.6" -web3-core-method@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.7.4.tgz#3873c6405e1a0a8a1efc1d7b28de8b7550b00c15" - integrity sha512-56K7pq+8lZRkxJyzf5MHQPI9/VL3IJLoy4L/+q8HRdZJ3CkB1DkXYaXGU2PeylG1GosGiSzgIfu1ljqS7CP9xQ== - dependencies: - "@ethersproject/transactions" "^5.6.2" - web3-core-helpers "1.7.4" - web3-core-promievent "1.7.4" - web3-core-subscriptions "1.7.4" - web3-utils "1.7.4" - web3-core-promievent@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.3.6.tgz#6c27dc79de8f71b74f5d17acaf9aaf593d3cb0c9" @@ -6193,13 +6774,6 @@ web3-core-promievent@1.3.6: dependencies: eventemitter3 "4.0.4" -web3-core-promievent@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.7.4.tgz#80a75633fdfe21fbaae2f1e38950edb2f134868c" - integrity sha512-o4uxwXKDldN7ER7VUvDfWsqTx9nQSP1aDssi1XYXeYC2xJbVo0n+z6ryKtmcoWoRdRj7uSpVzal3nEmlr480mA== - dependencies: - eventemitter3 "4.0.4" - web3-core-requestmanager@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.3.6.tgz#4fea269fe913fd4fca464b4f7c65cb94857b5b2a" @@ -6212,17 +6786,6 @@ web3-core-requestmanager@1.3.6: web3-providers-ipc "1.3.6" web3-providers-ws "1.3.6" -web3-core-requestmanager@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.7.4.tgz#2dc8a526dab8183dca3fef54658621801b1d0469" - integrity sha512-IuXdAm65BQtPL4aI6LZJJOrKAs0SM5IK2Cqo2/lMNvVMT9Kssq6qOk68Uf7EBDH0rPuINi+ReLP+uH+0g3AnPA== - dependencies: - util "^0.12.0" - web3-core-helpers "1.7.4" - web3-providers-http "1.7.4" - web3-providers-ipc "1.7.4" - web3-providers-ws "1.7.4" - web3-core-subscriptions@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.3.6.tgz#ee24e7974d1d72ff6c992c599deba4ef9b308415" @@ -6232,14 +6795,6 @@ web3-core-subscriptions@1.3.6: underscore "1.12.1" web3-core-helpers "1.3.6" -web3-core-subscriptions@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.7.4.tgz#cfbd3fa71081a8c8c6f1a64577a1a80c5bd9826f" - integrity sha512-VJvKWaXRyxk2nFWumOR94ut9xvjzMrRtS38c4qj8WBIRSsugrZr5lqUwgndtj0qx4F+50JhnU++QEqUEAtKm3g== - dependencies: - eventemitter3 "4.0.4" - web3-core-helpers "1.7.4" - web3-core@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.3.6.tgz#a6a761d1ff2f3ee462b8dab679229d2f8e267504" @@ -6253,19 +6808,6 @@ web3-core@1.3.6: web3-core-requestmanager "1.3.6" web3-utils "1.3.6" -web3-core@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.7.4.tgz#943fff99134baedafa7c65b4a0bbd424748429ff" - integrity sha512-L0DCPlIh9bgIED37tYbe7bsWrddoXYc897ANGvTJ6MFkSNGiMwDkTLWSgYd9Mf8qu8b4iuPqXZHMwIo4atoh7Q== - dependencies: - "@types/bn.js" "^5.1.0" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.7.4" - web3-core-method "1.7.4" - web3-core-requestmanager "1.7.4" - web3-utils "1.7.4" - web3-eth-abi@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.3.6.tgz#4272ca48d817aa651bbf97b269f5ff10abc2b8a9" @@ -6275,14 +6817,6 @@ web3-eth-abi@1.3.6: underscore "1.12.1" web3-utils "1.3.6" -web3-eth-abi@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.7.4.tgz#3fee967bafd67f06b99ceaddc47ab0970f2a614a" - integrity sha512-eMZr8zgTbqyL9MCTCAvb67RbVyN5ZX7DvA0jbLOqRWCiw+KlJKTGnymKO6jPE8n5yjk4w01e165Qb11hTDwHgg== - dependencies: - "@ethersproject/abi" "^5.6.3" - web3-utils "1.7.4" - web3-eth-accounts@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.3.6.tgz#f9fcb50b28ee58090ab292a10d996155caa2b474" @@ -6300,23 +6834,6 @@ web3-eth-accounts@1.3.6: web3-core-method "1.3.6" web3-utils "1.3.6" -web3-eth-accounts@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.7.4.tgz#7a24a4dfe947f7e9d1bae678529e591aa146167a" - integrity sha512-Y9vYLRKP7VU7Cgq6wG1jFaG2k3/eIuiTKAG8RAuQnb6Cd9k5BRqTm5uPIiSo0AP/u11jDomZ8j7+WEgkU9+Btw== - dependencies: - "@ethereumjs/common" "^2.5.0" - "@ethereumjs/tx" "^3.3.2" - crypto-browserify "3.12.0" - eth-lib "0.2.8" - ethereumjs-util "^7.0.10" - scrypt-js "^3.0.1" - uuid "3.3.2" - web3-core "1.7.4" - web3-core-helpers "1.7.4" - web3-core-method "1.7.4" - web3-utils "1.7.4" - web3-eth-contract@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.3.6.tgz#cccf4d32dc56917fb6923e778498a9ba2a5ba866" @@ -6332,20 +6849,6 @@ web3-eth-contract@1.3.6: web3-eth-abi "1.3.6" web3-utils "1.3.6" -web3-eth-contract@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.7.4.tgz#e5761cfb43d453f57be4777b2e5e7e1082078ff7" - integrity sha512-ZgSZMDVI1pE9uMQpK0T0HDT2oewHcfTCv0osEqf5qyn5KrcQDg1GT96/+S0dfqZ4HKj4lzS5O0rFyQiLPQ8LzQ== - dependencies: - "@types/bn.js" "^5.1.0" - web3-core "1.7.4" - web3-core-helpers "1.7.4" - web3-core-method "1.7.4" - web3-core-promievent "1.7.4" - web3-core-subscriptions "1.7.4" - web3-eth-abi "1.7.4" - web3-utils "1.7.4" - web3-eth-ens@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.3.6.tgz#0d28c5d4ea7b4462ef6c077545a77956a6cdf175" @@ -6361,20 +6864,6 @@ web3-eth-ens@1.3.6: web3-eth-contract "1.3.6" web3-utils "1.3.6" -web3-eth-ens@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.7.4.tgz#346720305379c0a539e226141a9602f1da7bc0c8" - integrity sha512-Gw5CVU1+bFXP5RVXTCqJOmHn71X2ghNk9VcEH+9PchLr0PrKbHTA3hySpsPco1WJAyK4t8SNQVlNr3+bJ6/WZA== - dependencies: - content-hash "^2.5.2" - eth-ens-namehash "2.0.8" - web3-core "1.7.4" - web3-core-helpers "1.7.4" - web3-core-promievent "1.7.4" - web3-eth-abi "1.7.4" - web3-eth-contract "1.7.4" - web3-utils "1.7.4" - web3-eth-iban@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.3.6.tgz#0d6ba21fe78f190af8919e9cd5453882457209e0" @@ -6383,14 +6872,6 @@ web3-eth-iban@1.3.6: bn.js "^4.11.9" web3-utils "1.3.6" -web3-eth-iban@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.7.4.tgz#711fb2547fdf0f988060027331b2b6c430505753" - integrity sha512-XyrsgWlZQMv5gRcjXMsNvAoCRvV5wN7YCfFV5+tHUCqN8g9T/o4XUS20vDWD0k4HNiAcWGFqT1nrls02MGZ08w== - dependencies: - bn.js "^5.2.1" - web3-utils "1.7.4" - web3-eth-personal@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.3.6.tgz#226137916754c498f0284f22c55924c87a2efcf0" @@ -6403,18 +6884,6 @@ web3-eth-personal@1.3.6: web3-net "1.3.6" web3-utils "1.3.6" -web3-eth-personal@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.7.4.tgz#22c399794cb828a75703df8bb4b3c1331b471546" - integrity sha512-O10C1Hln5wvLQsDhlhmV58RhXo+GPZ5+W76frSsyIrkJWLtYQTCr5WxHtRC9sMD1idXLqODKKgI2DL+7xeZ0/g== - dependencies: - "@types/node" "^12.12.6" - web3-core "1.7.4" - web3-core-helpers "1.7.4" - web3-core-method "1.7.4" - web3-net "1.7.4" - web3-utils "1.7.4" - web3-eth@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.3.6.tgz#2c650893d540a7a0eb1365dd5b2dca24ac919b7c" @@ -6434,24 +6903,6 @@ web3-eth@1.3.6: web3-net "1.3.6" web3-utils "1.3.6" -web3-eth@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.7.4.tgz#a7c1d3ccdbba4de4a82df7e3c4db716e4a944bf2" - integrity sha512-JG0tTMv0Ijj039emXNHi07jLb0OiWSA9O24MRSk5vToTQyDNXihdF2oyq85LfHuF690lXZaAXrjhtLNlYqb7Ug== - dependencies: - web3-core "1.7.4" - web3-core-helpers "1.7.4" - web3-core-method "1.7.4" - web3-core-subscriptions "1.7.4" - web3-eth-abi "1.7.4" - web3-eth-accounts "1.7.4" - web3-eth-contract "1.7.4" - web3-eth-ens "1.7.4" - web3-eth-iban "1.7.4" - web3-eth-personal "1.7.4" - web3-net "1.7.4" - web3-utils "1.7.4" - web3-net@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.3.6.tgz#a56492e2227475e38db29394f8bac305a2446e41" @@ -6461,15 +6912,6 @@ web3-net@1.3.6: web3-core-method "1.3.6" web3-utils "1.3.6" -web3-net@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.7.4.tgz#3153dfd3423262dd6fbec7aae5467202c4cad431" - integrity sha512-d2Gj+DIARHvwIdmxFQ4PwAAXZVxYCR2lET0cxz4KXbE5Og3DNjJi+MoPkX+WqoUXqimu/EOd4Cd+7gefqVAFDg== - dependencies: - web3-core "1.7.4" - web3-core-method "1.7.4" - web3-utils "1.7.4" - web3-providers-http@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.3.6.tgz#36e8724a7424d52827819d53fd75dbf31f5422c2" @@ -6478,14 +6920,6 @@ web3-providers-http@1.3.6: web3-core-helpers "1.3.6" xhr2-cookies "1.1.0" -web3-providers-http@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.7.4.tgz#8209cdcb115db5ccae1f550d1c4e3005e7538d02" - integrity sha512-AU+/S+49rcogUER99TlhW+UBMk0N2DxvN54CJ2pK7alc2TQ7+cprNPLHJu4KREe8ndV0fT6JtWUfOMyTvl+FRA== - dependencies: - web3-core-helpers "1.7.4" - xhr2-cookies "1.1.0" - web3-providers-ipc@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.3.6.tgz#cef8d12c1ebb47adce5ebf597f553c623362cb4a" @@ -6495,14 +6929,6 @@ web3-providers-ipc@1.3.6: underscore "1.12.1" web3-core-helpers "1.3.6" -web3-providers-ipc@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.7.4.tgz#02e85e99e48f432c9d34cee7d786c3685ec9fcfa" - integrity sha512-jhArOZ235dZy8fS8090t60nTxbd1ap92ibQw5xIrAQ9m7LcZKNfmLAQUVsD+3dTFvadRMi6z1vCO7zRi84gWHw== - dependencies: - oboe "2.1.5" - web3-core-helpers "1.7.4" - web3-providers-ws@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.3.6.tgz#e1df617bc89d66165abdf2191da0014c505bfaac" @@ -6513,15 +6939,6 @@ web3-providers-ws@1.3.6: web3-core-helpers "1.3.6" websocket "^1.0.32" -web3-providers-ws@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.7.4.tgz#6e60bcefb456f569a3e766e386d7807a96f90595" - integrity sha512-g72X77nrcHMFU8hRzQJzfgi/072n8dHwRCoTw+WQrGp+XCQ71fsk2qIu3Tp+nlp5BPn8bRudQbPblVm2uT4myQ== - dependencies: - eventemitter3 "4.0.4" - web3-core-helpers "1.7.4" - websocket "^1.0.32" - web3-shh@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.3.6.tgz#4e3486c7eca5cbdb87f88910948223a5b7ea6c20" @@ -6532,16 +6949,6 @@ web3-shh@1.3.6: web3-core-subscriptions "1.3.6" web3-net "1.3.6" -web3-shh@1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.7.4.tgz#bee91cce2737c529fd347274010b548b6ea060f1" - integrity sha512-mlSZxSYcMkuMCxqhTYnZkUdahZ11h+bBv/8TlkXp/IHpEe4/Gg+KAbmfudakq3EzG/04z70XQmPgWcUPrsEJ+A== - dependencies: - web3-core "1.7.4" - web3-core-method "1.7.4" - web3-core-subscriptions "1.7.4" - web3-net "1.7.4" - web3-utils@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.6.tgz#390bc9fa3a7179746963cfaca55bb80ac4d8dc10" @@ -6556,19 +6963,6 @@ web3-utils@1.3.6: underscore "1.12.1" utf8 "3.0.0" -web3-utils@1.7.4, web3-utils@^1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.7.4.tgz#eb6fa3706b058602747228234453811bbee017f5" - integrity sha512-acBdm6Evd0TEZRnChM/MCvGsMwYKmSh7OaUfNf5OKG0CIeGWD/6gqLOWIwmwSnre/2WrA1nKGId5uW2e5EfluA== - dependencies: - bn.js "^5.2.1" - ethereum-bloom-filters "^1.0.6" - ethereumjs-util "^7.1.0" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - utf8 "3.0.0" - web3@1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/web3/-/web3-1.3.6.tgz#599425461c3f9a8cbbefa70616438995f4a064cc" @@ -6582,24 +6976,26 @@ web3@1.3.6: web3-shh "1.3.6" web3-utils "1.3.6" -web3@^1.3.6: - version "1.7.4" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.7.4.tgz#00c9aef8e13ade92fd773d845fff250535828e93" - integrity sha512-iFGK5jO32vnXM/ASaJBaI0+gVR6uHozvYdxkdhaeOCD6HIQ4iIXadbO2atVpE9oc/H8l2MovJ4LtPhG7lIBN8A== - dependencies: - web3-bzz "1.7.4" - web3-core "1.7.4" - web3-eth "1.7.4" - web3-eth-personal "1.7.4" - web3-net "1.7.4" - web3-shh "1.7.4" - web3-utils "1.7.4" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +webpack-bundle-analyzer@4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.7.0.tgz#33c1c485a7fcae8627c547b5c3328b46de733c66" + integrity sha512-j9b8ynpJS4K+zfO5GGwsAcQX4ZHpWV+yRiHDiL+bE0XHJ8NiPYLTNVQdlFYWxtpg9lfAQNlwJg16J9AJtFSXRg== + dependencies: + acorn "^8.0.4" + acorn-walk "^8.0.0" + chalk "^4.1.0" + commander "^7.2.0" + gzip-size "^6.0.0" + lodash "^4.17.20" + opener "^1.5.2" + sirv "^1.0.7" + ws "^7.3.1" + webpack-sources@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" @@ -6647,11 +7043,6 @@ websocket@^1.0.32: utf-8-validate "^5.0.2" yaeti "^0.0.6" -whatwg-fetch@^3.4.1: - version "3.6.2" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" - integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== - whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -6714,10 +7105,10 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -ws@7.4.6: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.12.0: + version "8.12.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.12.0.tgz#485074cc392689da78e1828a9ff23585e06cddd8" + integrity sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig== ws@^3.0.0: version "3.3.3" @@ -6728,7 +7119,7 @@ ws@^3.0.0: safe-buffer "~5.1.0" ultron "~1.1.0" -ws@^7.4.5, ws@^7.5.1: +ws@^7.3.1, ws@^7.4.5, ws@^7.5.1: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== @@ -6829,3 +7220,10 @@ yargs@^15.3.1: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^18.1.2" + +zustand@^4.3.1: + version "4.3.8" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.3.8.tgz#37113df8e9e1421b0be1b2dca02b49b76210e7c4" + integrity sha512-4h28KCkHg5ii/wcFFJ5Fp+k1J3gJoasaIbppdgZFO4BPJnsNxL0mQXBSFgOgAdCdBj35aDTPvdAJReTMntFPGg== + dependencies: + use-sync-external-store "1.2.0"