diff --git a/.example.env b/.example.env index 345be632d9..ab680e4d89 100644 --- a/.example.env +++ b/.example.env @@ -7,10 +7,7 @@ NEXT_PUBLIC_INFURA_NETWORK= NEXT_PUBLIC_SUBGRAPH_URL= # Query URL for Juicebox subgraph used by server -NEXT_SUBGRAPH_URL= - -# Query URL for Juicebox subgraph used to load schema for graphql generation -GRAPHQL_SCHEMA_SUBGRAPH_URL= +SUBGRAPH_URL= # Base URL of site - for dev, just use http://localhost:3000/ NEXT_PUBLIC_BASE_URL= diff --git a/.github/workflows/ci-run.yml b/.github/workflows/ci-run.yml index 016dbe226b..ea432aa33c 100644 --- a/.github/workflows/ci-run.yml +++ b/.github/workflows/ci-run.yml @@ -19,7 +19,7 @@ on: env: NEXT_PUBLIC_INFURA_NETWORK: mainnet PRE_RENDER_INFURA_ID: ${{ secrets.PRE_RENDER_INFURA_ID }} - GRAPHQL_SCHEMA_SUBGRAPH_URL: ${{ secrets.GRAPHQL_SCHEMA_SUBGRAPH_URL }} + SUBGRAPH_URL: ${{ secrets.SUBGRAPH_URL }} jobs: jest: diff --git a/.linguirc.json b/.linguirc.json deleted file mode 100644 index ee7f81e809..0000000000 --- a/.linguirc.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "catalogs": [ - { - "path": "src/locales/{locale}/messages", - "include": ["src"] - } - ], - "format": "po", - "formatOptions": { - "lineNumbers": false, - "origins": false - }, - "orderBy": "messageId", - "fallbackLocales": { - "default": "en" - }, - "locales": ["en", "zh"], - "sourceLocale": "en" -} diff --git a/codegen.yml b/codegen.yml index bd56421ae5..826d04611f 100644 --- a/codegen.yml +++ b/codegen.yml @@ -1,5 +1,5 @@ overwrite: true -schema: ${GRAPHQL_SCHEMA_SUBGRAPH_URL} +schema: ${SUBGRAPH_URL} documents: 'src/graphql/**/*.graphql' generates: src/generated/graphql.tsx: diff --git a/doc/devops.md b/doc/devops.md index 430ca49c4c..d55933f671 100644 --- a/doc/devops.md +++ b/doc/devops.md @@ -25,15 +25,15 @@ We need to update the following configurations for new subgraph versions: #### Vercel - [ ] Update **juice-interface-goerli** project - - [ ] `GRAPHQL_SCHEMA_SUBGRAPH_URL` + - [ ] `SUBGRAPH_URL` - [ ] `NEXT_PUBLIC_SUBGRAPH_URL` - [ ] Update **juice-interface** - - [ ] `GRAPHQL_SCHEMA_SUBGRAPH_URL` + - [ ] `SUBGRAPH_URL` - [ ] `NEXT_PUBLIC_SUBGRAPH_URL` #### GitHub -- [ ] `GRAPHQL_SCHEMA_SUBGRAPH_URL` +- [ ] `SUBGRAPH_URL` 1. Select **Secrets** > **Actions**. 2. Locate the **Repository secrets** section. 3. Edit the secret variable diff --git a/lingui.config.js b/lingui.config.js new file mode 100644 index 0000000000..1fc467eeb6 --- /dev/null +++ b/lingui.config.js @@ -0,0 +1,25 @@ +const { formatter } = require('@lingui/format-po') + +const locales = ['en', 'zh'] + +if (process.env.NODE_ENV !== 'production') { + locales.push('pseudo') +} + +/** @type {import('@lingui/conf').LinguiConfig} */ +module.exports = { + locales: locales, + sourceLocale: 'en', + pseudoLocale: 'pseudo', + catalogs: [ + { + path: 'src/locales/{locale}/messages', + include: ['src'], + }, + ], + format: formatter({ origins: false, lineNumbers: false }), + orderBy: 'messageId', + fallbackLocales: { + default: 'en', + }, +} diff --git a/next.config.js b/next.config.js index 7e027d9b55..689511d3e5 100644 --- a/next.config.js +++ b/next.config.js @@ -4,6 +4,7 @@ // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ const { withSentryConfig } = require('@sentry/nextjs') const withBundleAnalyzer = require('@next/bundle-analyzer') +const linguiConfig = require('./lingui.config') const webpack = require('webpack') @@ -112,8 +113,19 @@ const SECURITY_HEADERS = [ }, // NOTE: gnosis safe is still allowed due to frame-ancestors definition ] +/** @type {import('next').NextConfig} */ const nextConfig = removeImports({ - experimental: { esmExternals: true }, + experimental: { + esmExternals: true, + swcPlugins: [ + '@lingui/swc-plugin', + { + runtimeModules: { + i18n: ['@lingui/core', 'i18n'], + }, + }, + ], + }, staticPageGenerationTimeout: 90, webpack: config => { config.resolve.fallback = { fs: false, module: false } @@ -126,6 +138,11 @@ const nextConfig = removeImports({ return config }, + i18n: { + localeDetection: false, + locales: linguiConfig.locales, + defaultLocale: linguiConfig.sourceLocale, + }, async redirects() { return [ { diff --git a/package.json b/package.json index 1827e6247a..8f9015ff1f 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,9 @@ "@jbx-protocol/juice-721-delegate-v3-1": "npm:@jbx-protocol/juice-721-delegate@5.0.2", "@jbx-protocol/juice-721-delegate-v3-2": "npm:@jbx-protocol/juice-721-delegate@6.0.3", "@jbx-protocol/juice-721-delegate-v3-3": "npm:@jbx-protocol/juice-721-delegate@7.0.0", + "@jbx-protocol/juice-721-delegate-v3-4": "npm:@jbx-protocol/juice-721-delegate@8.0.0", "@jbx-protocol/juice-contracts-v3": "5.0.0", - "@jbx-protocol/juice-delegates-registry": "1.0.0", + "@jbx-protocol/juice-delegates-registry": "1.0.3", "@jbx-protocol/juice-v1-token-terminal": "1.0.1", "@jbx-protocol/juice-v3-migration": "1.0.0", "@jbx-protocol/project-handles": "^2.0.4", @@ -118,6 +119,7 @@ "graphql": "^16.5.0", "he": "^1.2.0", "jsonwebtoken": "^9.0.0", + "juicebox-metadata-helper": "0.1.7", "less": "4.1.2", "lodash": "^4.17.21", "lottie-react": "^2.4.0", @@ -160,6 +162,8 @@ "@graphql-codegen/typescript-operations": "^3.0.3", "@graphql-codegen/typescript-react-apollo": "^3.3.2", "@graphql-codegen/typescript-resolvers": "^3.2.0", + "@lingui/loader": "^4.4.0", + "@lingui/swc-plugin": "4.0.4", "@next/bundle-analyzer": "^13.2.4", "@testing-library/cypress": "^8.0.2", "@testing-library/jest-dom": "^5.16.5", diff --git a/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx b/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx index fa647b7676..e4567c8815 100644 --- a/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx +++ b/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx @@ -1,14 +1,15 @@ import { CheckCircleFilled } from '@ant-design/icons' -import { t, Trans } from '@lingui/macro' -import { Checkbox, Form, Modal } from 'antd' +import { Trans } from '@lingui/macro' +import { Checkbox, Form } from 'antd' import { Callout } from 'components/Callout' import { useDeployProject } from 'components/Create/hooks/DeployProject' import ExternalLink from 'components/ExternalLink' +import { emitConfirmationDeletionModal } from 'components/ProjectDashboard/utils/modals' import TransactionModal from 'components/modals/TransactionModal' import { TERMS_OF_SERVICE_URL } from 'constants/links' +import { useWallet } from 'hooks/Wallet' import useMobile from 'hooks/useMobile' import { useModal } from 'hooks/useModal' -import { useWallet } from 'hooks/Wallet' import { useRouter } from 'next/router' import { useCallback, useContext, useEffect, useMemo, useState } from 'react' import { useDispatch } from 'react-redux' @@ -62,7 +63,7 @@ export const ReviewDeployPage = () => { const router = useRouter() const [form] = Form.useForm<{ termsAccepted: boolean }>() const termsAccepted = Form.useWatch('termsAccepted', form) - const modal = useModal() + const transactionModal = useModal() const { deployProject, isDeploying, deployTransactionPending } = useDeployProject() const nftRewards = useAppSelector( @@ -79,9 +80,8 @@ export const ReviewDeployPage = () => { const handleStartOverClicked = useCallback(() => { router.push('/create') goToPage?.('projectDetails') - modal.close() dispatch(editingV2ProjectActions.resetState()) - }, [dispatch, goToPage, modal, router]) + }, [dispatch, goToPage, router]) const onFinish = useCallback(async () => { if (chainUnsupported) { @@ -93,11 +93,14 @@ export const ReviewDeployPage = () => { return } + transactionModal.open() await deployProject({ - onProjectDeployed: deployedProjectId => + onProjectDeployed: deployedProjectId => { router.push({ query: { deployedProjectId } }, '/create', { shallow: true, - }), + }) + transactionModal.close() + }, }) }, [ chainUnsupported, @@ -106,6 +109,7 @@ export const ReviewDeployPage = () => { deployProject, isConnected, router, + transactionModal, ]) const [activeKey, setActiveKey] = useState( @@ -226,7 +230,20 @@ export const ReviewDeployPage = () => { Made a mistake?{' '} - + + emitConfirmationDeletionModal({ + description: ( + + Starting over will erase all currently saved progress. + + ), + okText: Yes, start over, + cancelText: No, keep editing, + onConfirm: handleStartOverClicked, + }) + } + > Start over . @@ -234,22 +251,9 @@ export const ReviewDeployPage = () => { - - Are you sure? - - } - okText={t`Yes, start over`} - cancelText={t`No, keep editing`} - open={modal.visible} - onOk={handleStartOverClicked} - onCancel={modal.close} - > - Starting over will erase all currently saved progress. - ) } diff --git a/src/components/ErrorNotificationButtons.tsx b/src/components/ErrorNotificationButtons.tsx index 32d4c2881c..7142d046c3 100644 --- a/src/components/ErrorNotificationButtons.tsx +++ b/src/components/ErrorNotificationButtons.tsx @@ -1,7 +1,7 @@ import { WarningOutlined } from '@ant-design/icons' import { Trans } from '@lingui/macro' import { Button } from 'antd' -import LanguageProvider from 'contexts/Language/LanguageProvider' +import { LanguageProvider } from 'contexts/Language/LanguageProvider' import { helpPagePath } from 'utils/routes' import ExternalLink from './ExternalLink' diff --git a/src/components/Navbar/components/DropdownMenu.tsx b/src/components/Navbar/components/DropdownMenu.tsx index 63cc234e35..04862eae4d 100644 --- a/src/components/Navbar/components/DropdownMenu.tsx +++ b/src/components/Navbar/components/DropdownMenu.tsx @@ -15,6 +15,7 @@ type LinkItem = { id: string label: ReactNode href: string + locale?: string isExternal?: boolean } @@ -130,6 +131,7 @@ export const DropdownMenu = ({ {item.label} diff --git a/src/components/Navbar/components/NavLanguageSelector.tsx b/src/components/Navbar/components/NavLanguageSelector.tsx index 0e08d88b36..4af481b0a6 100644 --- a/src/components/Navbar/components/NavLanguageSelector.tsx +++ b/src/components/Navbar/components/NavLanguageSelector.tsx @@ -1,9 +1,8 @@ import { LanguageIcon } from '@heroicons/react/24/solid' -import { Trans } from '@lingui/macro' +import { useLingui } from '@lingui/react' import { SUPPORTED_LANGUAGES } from 'constants/locale' -import { useCallback, useMemo } from 'react' +import { useRouter } from 'next/router' import { twMerge } from 'tailwind-merge' -import { reloadWindow } from 'utils/windowUtils' import { DropdownMenu } from './DropdownMenu' // Language select tool seen in top nav @@ -12,16 +11,10 @@ export default function NavLanguageSelector({ }: { className?: string }) { - // Sets the new language with localStorage and reloads the page - const setLanguage = useCallback((newLanguage: string) => { - localStorage.setItem('lang', newLanguage) - reloadWindow() - }, []) - - const currentLanguage = useMemo( - () => localStorage.getItem('lang') ?? 'en', - [], - ) + const router = useRouter() + const { + i18n: { locale }, + } = useLingui() return ( - {SUPPORTED_LANGUAGES[currentLanguage].short} + {SUPPORTED_LANGUAGES[locale].short} } items={Object.values(SUPPORTED_LANGUAGES).map(lang => ({ id: lang.code, label: lang.long, - onClick: () => { - setLanguage(lang.code) + // TODO: We want to use the bottom but due to a bug in t macros we cant + // locale: lang.code, + // href: pathname, + onClick: async () => { + await router.push(router.asPath, router.asPath, { locale: lang.code }) + router.reload() }, }))} /> diff --git a/src/components/ProjectDashboard/components/Cart/components/SummaryCollapsedView.test.tsx b/src/components/ProjectDashboard/components/Cart/components/SummaryCollapsedView.test.tsx index 02a6261611..8012cd6c03 100644 --- a/src/components/ProjectDashboard/components/Cart/components/SummaryCollapsedView.test.tsx +++ b/src/components/ProjectDashboard/components/Cart/components/SummaryCollapsedView.test.tsx @@ -7,6 +7,8 @@ import { V2V3_CURRENCY_ETH } from 'utils/v2v3/currency' import { useCartSummary } from '../hooks/useCartSummary' import { SummaryCollapsedView } from './SummaryCollapsedView' +jest.mock('contexts/Language/LanguageProvider') + jest.mock('use-resize-observer', () => ({ __esModule: true, default: jest.fn(() => ({ diff --git a/src/components/ProjectDashboard/components/Cart/components/__snapshots__/SummaryExpandedView.test.tsx.snap b/src/components/ProjectDashboard/components/Cart/components/__snapshots__/SummaryExpandedView.test.tsx.snap index cc9ef58342..9f505f6a3e 100644 --- a/src/components/ProjectDashboard/components/Cart/components/__snapshots__/SummaryExpandedView.test.tsx.snap +++ b/src/components/ProjectDashboard/components/Cart/components/__snapshots__/SummaryExpandedView.test.tsx.snap @@ -45,7 +45,7 @@ exports[`SummaryExpandedView should render correctly 1`] = ` class="flex min-w-0 items-center" >
🧃 diff --git a/src/components/ProjectDashboard/components/ui/ConfirmationDeletionModal.tsx b/src/components/ProjectDashboard/components/ui/ConfirmationDeletionModal.tsx index 15a8d99b69..5ae0e5d398 100644 --- a/src/components/ProjectDashboard/components/ui/ConfirmationDeletionModal.tsx +++ b/src/components/ProjectDashboard/components/ui/ConfirmationDeletionModal.tsx @@ -1,4 +1,3 @@ -import { t } from '@lingui/macro' import { JuiceModal, ModalOnCancelFn, @@ -10,12 +9,16 @@ export const ConfirmationDeletionModal = ({ initialOpenState = false, title, description, + okText, + cancelText, onOk, onCancel, }: { initialOpenState?: boolean title: ReactNode description?: ReactNode + okText?: ReactNode + cancelText?: ReactNode onOk?: ModalOnOkFn onCancel?: ModalOnCancelFn }) => { @@ -26,7 +29,8 @@ export const ConfirmationDeletionModal = ({ title={title} className="max-w-sm" buttonPosition="stretch" - okText={t`Remove`} + okText={okText ?? 'Remove'} + cancelText={cancelText ?? 'Cancel'} okButtonClassName="bg-error-600 hover:bg-error-700 border-error-600 text-white" cancelButtonClassName="border-grey-300 text-grey-700 hover:border-grey-400 dark:border-slate-600 dark:text-slate-200 dark:hover:border-slate-500" open={open} diff --git a/src/components/ProjectDashboard/utils/modals.tsx b/src/components/ProjectDashboard/utils/modals.tsx index 6ce2eeddaf..0dbd071bc8 100644 --- a/src/components/ProjectDashboard/utils/modals.tsx +++ b/src/components/ProjectDashboard/utils/modals.tsx @@ -1,18 +1,31 @@ -import { t } from '@lingui/macro' +import { Trans } from '@lingui/macro' import { ModalOnCancelFn, ModalOnOkFn } from 'components/modals/JuiceModal' +import { LanguageProvider } from 'contexts/Language/LanguageProvider' import { ReactNode } from 'react' import { createRoot } from 'react-dom/client' import { ConfirmationDeletionModal } from '../components/ui/ConfirmationDeletionModal' +type EmitConfirmationDeletionModalProps = { + description?: ReactNode + okText?: ReactNode + cancelText?: ReactNode + onConfirm: () => void +} & ( + | { + type?: string + } + | { + title?: ReactNode + } +) + export const emitConfirmationDeletionModal = ({ - type, description, + okText, + cancelText, onConfirm, -}: { - type: string - description?: ReactNode - onConfirm: () => void -}) => { + ...props +}: EmitConfirmationDeletionModalProps) => { const modalRoot = document.createElement('div') const root = createRoot(modalRoot) document.body.appendChild(modalRoot) @@ -34,16 +47,26 @@ export const emitConfirmationDeletionModal = ({ }, 500) } - const title = t`Are you sure you want to remove ${type}?` + const title = (() => { + if ('title' in props) return props.title + if ('type' in props) { + return Are you sure you want to remove ${props.type}? + } + return Are you sure? + })() root.render( - , + + + , ) } diff --git a/src/components/ProjectLogo.tsx b/src/components/ProjectLogo.tsx index fcc7783412..1b1587d631 100644 --- a/src/components/ProjectLogo.tsx +++ b/src/components/ProjectLogo.tsx @@ -26,7 +26,6 @@ export default function ProjectLogo({ fallback?: string | JSX.Element | null }) { const [srcLoadError, setSrcLoadError] = useState(false) - const [loading, setLoading] = useState(true) const imageSrc = useMemo(() => { if (!projectId) return undefined @@ -55,7 +54,6 @@ export default function ProjectLogo({ className={twMerge( 'flex h-20 w-20 items-center justify-center overflow-hidden rounded-lg text-4xl', 'bg-smoke-100 dark:bg-slate-700', - loading ? 'animate-pulse' : undefined, className, )} > @@ -65,7 +63,6 @@ export default function ProjectLogo({ src={imageSrc} alt={name + ' logo'} onError={() => setSrcLoadError(true)} - onLoad={() => setLoading(false)} loading={lazyLoad ? 'lazy' : undefined} crossOrigin="anonymous" title={name} diff --git a/src/components/common/CoreAppWrapper/CoreAppWrapper.tsx b/src/components/common/CoreAppWrapper/CoreAppWrapper.tsx index 4c9aca9f51..1e37757cea 100644 --- a/src/components/common/CoreAppWrapper/CoreAppWrapper.tsx +++ b/src/components/common/CoreAppWrapper/CoreAppWrapper.tsx @@ -8,19 +8,11 @@ import ReactQueryProvider from 'contexts/ReactQueryProvider' import { ThemeProvider } from 'contexts/Theme/ThemeProvider' import TxHistoryProvider from 'contexts/Transaction/TxHistoryProvider' import { installJuiceboxWindowObject } from 'lib/juicebox' -import dynamic from 'next/dynamic' import { useRouter } from 'next/router' import React, { useEffect } from 'react' import { twJoin } from 'tailwind-merge' import { redirectTo } from 'utils/windowUtils' -const LanguageProvider = dynamic( - () => import('contexts/Language/LanguageProvider'), - { - ssr: false, - }, -) - /** * Contains all the core app providers used by each page. * @@ -35,19 +27,17 @@ export const AppWrapper: React.FC< return ( - - - - - - - <_Wrapper hideNav={hideNav}>{children} - - - - - - + + + + + + <_Wrapper hideNav={hideNav}>{children} + + + + + ) diff --git a/src/components/v2v3/V2V3Project/ManageNftsSection/RedeemNftsModal/RedeemNftsModal.tsx b/src/components/v2v3/V2V3Project/ManageNftsSection/RedeemNftsModal/RedeemNftsModal.tsx index 1e4766e4f8..7245119d90 100644 --- a/src/components/v2v3/V2V3Project/ManageNftsSection/RedeemNftsModal/RedeemNftsModal.tsx +++ b/src/components/v2v3/V2V3Project/ManageNftsSection/RedeemNftsModal/RedeemNftsModal.tsx @@ -8,54 +8,24 @@ import { MemoFormInput } from 'components/Project/PayProjectForm/MemoFormInput' import { RedeemingNft } from 'components/ProjectDashboard/components/NftRewardsPanel/hooks/useJB721DelegateTokenToNftReward' import { REDEMPTION_RATE_EXPLANATION } from 'components/strings' import TooltipLabel from 'components/TooltipLabel' -import { - IJB721Delegate_V3_2_INTERFACE_ID, - IJB721Delegate_V3_INTERFACE_ID, -} from 'constants/nftRewards' import { JB721DelegateContractsContext } from 'contexts/NftRewards/JB721DelegateContracts/JB721DelegateContractsContext' import { V2V3ProjectContext } from 'contexts/v2v3/Project/V2V3ProjectContext' -import { BigNumber, constants } from 'ethers' -import { defaultAbiCoder } from 'ethers/lib/utils.js' +import { BigNumber } from 'ethers' import { useNftAccountBalance } from 'hooks/JB721Delegate/useNftAccountBalance' import { useETHReceivedFromNftRedeem } from 'hooks/v2v3/contractReader/useETHReceivedFromNftRedeem' import { useRedeemTokensTx } from 'hooks/v2v3/transactor/useRedeemTokensTx' import { useWallet } from 'hooks/Wallet' import { JB721DelegateVersion } from 'models/v2v3/contracts' import { useContext, useState } from 'react' +import { + encodeJB721DelegateV3_2RedeemMetadata, + encodeJB721DelegateV3_4RedeemMetadata, + encodeJB721DelegateV3RedeemMetadata, +} from 'utils/encodeJb721DelegateMetadata/encodeJb721DelegateMetadata' import { emitErrorNotification } from 'utils/notifications' import { formatRedemptionRate } from 'utils/v2v3/math' import { RedeemNftCard } from './RedeemNftCard' -function encodeJB721DelegateV3RedeemMetadata(tokenIdsToRedeem: string[]) { - const args = [ - constants.HashZero, - IJB721Delegate_V3_INTERFACE_ID, - tokenIdsToRedeem, - ] - - const encoded = defaultAbiCoder.encode( - ['bytes32', 'bytes4', 'uint256[]'], - args, - ) - - return encoded -} - -function encodeJB721DelegateV3_2RedeemMetadata(tokenIdsToRedeem: string[]) { - const args = [ - constants.HashZero, - IJB721Delegate_V3_2_INTERFACE_ID, - tokenIdsToRedeem, - ] - - const encoded = defaultAbiCoder.encode( - ['bytes32', 'bytes4', 'uint256[]'], - args, - ) - - return encoded -} - export function RedeemNftsModal({ open, onCancel, @@ -111,10 +81,14 @@ export function RedeemNftsModal({ minReturnedTokens: BigNumber.from(0), memo, metadata: - jb721DelegateVersion === JB721DelegateVersion.JB721DELEGATE_V3_2 || - jb721DelegateVersion === JB721DelegateVersion.JB721DELEGATE_V3_3 + jb721DelegateVersion === JB721DelegateVersion.JB721DELEGATE_V3 || + jb721DelegateVersion === JB721DelegateVersion.JB721DELEGATE_V3_1 + ? encodeJB721DelegateV3RedeemMetadata(tokenIdsToRedeem) + : jb721DelegateVersion === + JB721DelegateVersion.JB721DELEGATE_V3_2 || + jb721DelegateVersion === JB721DelegateVersion.JB721DELEGATE_V3_3 ? encodeJB721DelegateV3_2RedeemMetadata(tokenIdsToRedeem) - : encodeJB721DelegateV3RedeemMetadata(tokenIdsToRedeem), + : encodeJB721DelegateV3_4RedeemMetadata(tokenIdsToRedeem), }, { // step 1 diff --git a/src/constants/nftRewards.ts b/src/constants/nftRewards.ts index 514b955be2..70801a33e1 100644 --- a/src/constants/nftRewards.ts +++ b/src/constants/nftRewards.ts @@ -1,7 +1,14 @@ import { ONE_BILLION } from './numbers' export const MAX_NFT_REWARD_TIERS = 69 + export const IJB721Delegate_V3_INTERFACE_ID = '0xb3bcbb79' +export const IJB721TieredDelegate_V3_INTERFACE_ID = '0xf34282c8' + export const IJB721Delegate_V3_2_INTERFACE_ID = '0xfbb38e03' export const IJBTiered721Delegate_V3_2_INTERFACE_ID = '0xf8b169f8' + +export const IJBTiered721Delegate_V3_4_PAY_ID = '0x37323150' // "721P", encoded as bytes4 +export const IJBTiered721Delegate_V3_4_REDEEM_ID = '0x37323152' // "721R", encoded as bytes4 + export const DEFAULT_NFT_MAX_SUPPLY = ONE_BILLION - 1 diff --git a/src/contexts/Language/LanguageProvider.tsx b/src/contexts/Language/LanguageProvider.tsx index 98f14fea92..15699b9efb 100644 --- a/src/contexts/Language/LanguageProvider.tsx +++ b/src/contexts/Language/LanguageProvider.tsx @@ -1,60 +1,33 @@ -import { i18n } from '@lingui/core' -import { - detect, - fromNavigator, - fromStorage, - fromUrl, -} from '@lingui/detect-locale' +import { Messages } from '@lingui/core' import { I18nProvider } from '@lingui/react' -import defaultLocale from 'locales/en/messages' -import { ReactNode } from 'react' +import { useLingUiInit } from 'hooks/useLinguiInit' +import React from 'react' -import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from 'constants/locale' - -const getLocale = (): string => { - if (typeof window === 'undefined') return DEFAULT_LOCALE - - let locale = - detect(fromUrl('lang'), fromStorage('lang'), fromNavigator()) ?? - DEFAULT_LOCALE - - if (!SUPPORTED_LOCALES.includes(locale)) { - locale = DEFAULT_LOCALE - } - - return locale -} - -const activateDefaultLocale = () => { - const { messages } = defaultLocale - i18n.load(DEFAULT_LOCALE, messages) - i18n.activate(DEFAULT_LOCALE) +export type I18nProviderProps = { + children: React.ReactNode + i18n?: { messages: Messages; locale: string } } -const dynamicActivate = async (locale: string) => { - try { - const { messages } = await import(`../../locales/${locale}/messages`) +let i18nSingleton: { messages: Messages; locale: string } | undefined - i18n.load(locale, messages) - i18n.activate(locale) - } catch (e) { - console.error(`Error loading locale "${locale}:"`, e) - // fall back to default locale - activateDefaultLocale() +export const LanguageProvider: React.FC = ({ + children, + i18n: _i18n, +}) => { + if (_i18n) { + i18nSingleton = _i18n + } else { + _i18n = i18nSingleton } -} -const locale = getLocale() -if (locale === DEFAULT_LOCALE) { - activateDefaultLocale() -} else { - dynamicActivate(locale) -} + if (!_i18n) + throw new Error( + 'i18n must be provided at least once. This is usually done in _app.tsx', + ) + + const messages = _i18n?.messages ?? [] + const locale = _i18n?.locale ?? 'en' + const i18n = useLingUiInit(messages, locale) -export default function LanguageProvider({ - children, -}: { - children: ReactNode -}) { return {children} } diff --git a/src/contexts/Language/__mocks__/LanguageProvider.tsx b/src/contexts/Language/__mocks__/LanguageProvider.tsx new file mode 100644 index 0000000000..9788b09780 --- /dev/null +++ b/src/contexts/Language/__mocks__/LanguageProvider.tsx @@ -0,0 +1,7 @@ +// generate mock for LanguageProvider + +import { I18nProviderProps } from '../LanguageProvider' + +export const LanguageProvider: React.FC = ({ children }) => { + return
{children}
+} diff --git a/src/hooks/JB721Delegate/contractReader/useNftCollectionMetadataUri.ts b/src/hooks/JB721Delegate/contractReader/useNftCollectionMetadataUri.ts index 4db64eede0..d64ef86315 100644 --- a/src/hooks/JB721Delegate/contractReader/useNftCollectionMetadataUri.ts +++ b/src/hooks/JB721Delegate/contractReader/useNftCollectionMetadataUri.ts @@ -27,13 +27,14 @@ export function useNftCollectionMetadataUri( functionName: 'contractURI', args: version === JB721DelegateVersion.JB721DELEGATE_V3_2 || - JB721DelegateVersion.JB721DELEGATE_V3_3 + JB721DelegateVersion.JB721DELEGATE_V3_3 || + JB721DelegateVersion.JB721DELEGATE_V3_4 ? undefined : null, }) - return version === JB721DelegateVersion.JB721DELEGATE_V3_2 || - version === JB721DelegateVersion.JB721DELEGATE_V3_3 - ? v3_2_response - : v3response + return version === JB721DelegateVersion.JB721DELEGATE_V3 || + version === JB721DelegateVersion.JB721DELEGATE_V3_1 + ? v3response + : v3_2_response } diff --git a/src/hooks/JB721Delegate/contractReader/useNftTiers.ts b/src/hooks/JB721Delegate/contractReader/useNftTiers.ts index 0c1dc7533c..45edc22d48 100644 --- a/src/hooks/JB721Delegate/contractReader/useNftTiers.ts +++ b/src/hooks/JB721Delegate/contractReader/useNftTiers.ts @@ -43,6 +43,15 @@ function buildArgs( 0, // _startingId limit ?? MAX_NFT_REWARD_TIERS, ] + + case JB721DelegateVersion.JB721DELEGATE_V3_4: // unchanged + return [ + dataSourceAddress, + [], // _categories + false, // _includeResolvedUri, return in each tier a result from a tokenUriResolver if one is included in the delegate + 0, // _startingId + limit ?? MAX_NFT_REWARD_TIERS, + ] default: return null } @@ -71,10 +80,10 @@ export function useNftTiers({ return useV2ContractReader({ contract: JB721TieredDelegateStore, functionName: - version === JB721DelegateVersion.JB721DELEGATE_V3_2 || - version === JB721DelegateVersion.JB721DELEGATE_V3_3 - ? 'tiersOf' - : 'tiers', + version === JB721DelegateVersion.JB721DELEGATE_V3 || + version === JB721DelegateVersion.JB721DELEGATE_V3_1 + ? 'tiers' + : 'tiersOf', args, }) } diff --git a/src/hooks/JB721Delegate/contracts/useJB721DelegateContractAddress.ts b/src/hooks/JB721Delegate/contracts/useJB721DelegateContractAddress.ts index 68019d09cf..c3c7324a88 100644 --- a/src/hooks/JB721Delegate/contracts/useJB721DelegateContractAddress.ts +++ b/src/hooks/JB721Delegate/contracts/useJB721DelegateContractAddress.ts @@ -1,8 +1,33 @@ import { readNetwork } from 'constants/networks' import { ForgeDeploy, addressFor } from 'forge-run-parser' +import { NetworkName } from 'models/networkName' import { JB721DelegateVersion } from 'models/v2v3/contracts' import { useEffect, useState } from 'react' +/** + * Some addresses aren't in the forge deployment manifests, so we have to hardcode them here. + */ +const ADDRESSES: { + [k in JB721DelegateVersion]?: { + [k in NetworkName]?: { + [k: string]: string + } + } +} = { + [JB721DelegateVersion.JB721DELEGATE_V3_4]: { + [NetworkName.goerli]: { + JBTiered721DelegateStore: '0x155B49f303443a3334bB2EF42E10C628438a0656', // the store from 3.3 + JBTiered721DelegateProjectDeployer: + '0xB5870d8eeb195E09Ac47641121889CCdBbA3E8FE', // this is in the forge deployment manifest, but the name isn't specified because of a failed verification + }, + [NetworkName.mainnet]: { + JBTiered721DelegateStore: '0x615B5b50F1Fc591AAAb54e633417640d6F2773Fd', // the store from 3.3 + JBTiered721DelegateProjectDeployer: + '0xFbD1B7dE4082826Bf4BaA68D020eFA5c2707Fb3e', + }, + }, +} + async function loadJB721DelegateDeployment(version: JB721DelegateVersion) { return (await import( `@jbx-protocol/juice-721-delegate-v${version}/broadcast/Deploy.s.sol/${readNetwork.chainId}/run-latest.json` @@ -13,10 +38,13 @@ export async function loadJB721DelegateAddress( contractName: string, version: JB721DelegateVersion, ) { - const deployment = await loadJB721DelegateDeployment(version) + const hardcodedAddress = + ADDRESSES[version]?.[readNetwork.name]?.[contractName] + if (hardcodedAddress) return hardcodedAddress - const address = addressFor(contractName, deployment) - return address! + const forgeGeployment = await loadJB721DelegateDeployment(version) + const forgeAddress = addressFor(contractName, forgeGeployment) + return forgeAddress! } export function useJB721DelegateContractAddress({ diff --git a/src/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts b/src/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts index 1b0b7b67b0..10a3909190 100644 --- a/src/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts +++ b/src/hooks/JB721Delegate/transactor/useLaunchProjectWithNftsTx.ts @@ -21,7 +21,6 @@ import { JB_721_TIER_PARAMS_V3_2, JB_DEPLOY_TIERED_721_DELEGATE_DATA_V3_1, } from 'models/nftRewards' -import { JB721DelegateVersion } from 'models/v2v3/contracts' import { JBPayDataSourceFundingCycleMetadata } from 'models/v2v3/fundingCycle' import { useContext } from 'react' import { DEFAULT_MUST_START_AT_OR_AFTER } from 'redux/slices/editingV2Project' @@ -56,38 +55,26 @@ type JB721DelegateLaunchProjectData = JB721DelegateLaunchFundingCycleData & { } } -function buildArgs( - version: JB721DelegateVersion, - { - owner, - deployTiered721DelegateData, - launchProjectData, - JBControllerAddress, - }: { - owner: string - JBControllerAddress: string - deployTiered721DelegateData: - | JBDeployTiered721DelegateData - | JB_DEPLOY_TIERED_721_DELEGATE_DATA_V3_1 - launchProjectData: JB721DelegateLaunchProjectData - }, -) { +function buildArgs({ + owner, + deployTiered721DelegateData, + launchProjectData, + JBControllerAddress, +}: { + owner: string + JBControllerAddress: string + deployTiered721DelegateData: + | JBDeployTiered721DelegateData + | JB_DEPLOY_TIERED_721_DELEGATE_DATA_V3_1 + launchProjectData: JB721DelegateLaunchProjectData +}) { const baseArgs = [ owner, deployTiered721DelegateData, //_deployTiered721DelegateData launchProjectData, // _launchProjectData ] - if (version === JB721DelegateVersion.JB721DELEGATE_V3) { - return baseArgs - } - if ( - version === JB721DelegateVersion.JB721DELEGATE_V3_1 || - version === JB721DelegateVersion.JB721DELEGATE_V3_2 || - version === JB721DelegateVersion.JB721DELEGATE_V3_3 - ) { - return [...baseArgs, JBControllerAddress] // v1.1 requires us to pass the controller address in - } + return [...baseArgs, JBControllerAddress] } export function useLaunchProjectWithNftsTx(): TransactorInstance { @@ -211,7 +198,7 @@ export function useLaunchProjectWithNftsTx(): TransactorInstance { + const isClient = typeof window !== 'undefined' + + if (!isClient && locale !== i18n.locale) { + // there is single instance of i18n on the server + i18n.loadAndActivate({ locale, messages }) + } + if (isClient && i18n.locale === undefined) { + // first client render + i18n.loadAndActivate({ locale, messages }) + } + + useEffect(() => { + const localeDidChange = locale !== i18n.locale + if (localeDidChange) { + i18n.loadAndActivate({ locale, messages }) + } + }, [locale, messages]) + + return i18n +} diff --git a/src/hooks/v2v3/transactor/useReconfigureNftCollectionMetadata.ts b/src/hooks/v2v3/transactor/useReconfigureNftCollectionMetadata.ts index 798bef4b7e..9b8dd9c1da 100644 --- a/src/hooks/v2v3/transactor/useReconfigureNftCollectionMetadata.ts +++ b/src/hooks/v2v3/transactor/useReconfigureNftCollectionMetadata.ts @@ -48,10 +48,10 @@ export function useReconfigureNftCollectionMetadata(): TransactorInstance { ) } } else { - uri = process.env.GRAPHQL_SCHEMA_SUBGRAPH_URL + uri = process.env.SUBGRAPH_URL if (!uri) { - throw new Error( - 'GRAPHQL_SCHEMA_SUBGRAPH_URL environment variable not defined', - ) + throw new Error('SUBGRAPH_URL environment variable not defined') } } diff --git a/src/locales/messages.pot b/src/locales/messages.pot index 5b9569680e..f6b0815014 100644 --- a/src/locales/messages.pot +++ b/src/locales/messages.pot @@ -968,6 +968,9 @@ msgstr "" msgid "You are eligible for {0} <0/> (NFT)" msgstr "" +msgid "Are you sure you want to remove ${0}?" +msgstr "" + msgid "How SharkDAO raised over 1,000 ETH to buy 6 Nouns NFTs and become the largest sub-DAO of Nouns DAO" msgstr "" @@ -1373,9 +1376,6 @@ msgstr "" msgid "100% transparent" msgstr "" -msgid "Are you sure you want to remove {type}?" -msgstr "" - msgid "Edit your project's NFTs." msgstr "" @@ -4484,9 +4484,6 @@ msgstr "" msgid "Percentage to reserve" msgstr "" -msgid "Remove" -msgstr "" - msgid "All assets" msgstr "" diff --git a/src/locales/utils.ts b/src/locales/utils.ts new file mode 100644 index 0000000000..8c7e998b14 --- /dev/null +++ b/src/locales/utils.ts @@ -0,0 +1,5 @@ +export async function loadCatalog(locale: string) { + const { messages } = await import(`@lingui/loader!./${locale}/messages.po`) + + return messages +} diff --git a/src/models/v2v3/contracts.ts b/src/models/v2v3/contracts.ts index 49aa516bf5..9143350832 100644 --- a/src/models/v2v3/contracts.ts +++ b/src/models/v2v3/contracts.ts @@ -63,4 +63,5 @@ export enum JB721DelegateVersion { JB721DELEGATE_V3_1 = '3-1', JB721DELEGATE_V3_2 = '3-2', JB721DELEGATE_V3_3 = '3-3', + JB721DELEGATE_V3_4 = '3-4', } diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 67de047a0a..aa442530eb 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,4 +1,5 @@ import { Head } from 'components/common' +import { LanguageProvider } from 'contexts/Language/LanguageProvider' import SupabaseSessionProvider from 'contexts/SupabaseSession/SupabaseSessionProvider' import { initWeb3Onboard, useInitWallet } from 'hooks/Wallet' import type { AppProps } from 'next/app' @@ -15,13 +16,19 @@ export default function MyApp({ Component, pageProps }: AppProps) { // Currently, init() must be called *here* (as opposed to AppWrapper), or else it breaks when navigating between pages. useInitWallet() + if (!pageProps.i18n) { + console.error( + 'Missing i18n prop - please ensure that page has globalGetServerSideProps', + ) + } + return ( - <> + {/* Default HEAD - overwritten by specific page SEO */} - + ) } diff --git a/src/pages/about/index.tsx b/src/pages/about/index.tsx index 647ec3fade..1bac5b0ffb 100644 --- a/src/pages/about/index.tsx +++ b/src/pages/about/index.tsx @@ -1,5 +1,6 @@ import { AboutDashboard } from 'components/AboutDashboard' import { AppWrapper, Head } from 'components/common' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function AboutPage() { return ( @@ -17,3 +18,5 @@ export default function AboutPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/account/[addressOrEnsName]/edit.tsx b/src/pages/account/[addressOrEnsName]/edit.tsx index f8103df9ae..861e0c0fac 100644 --- a/src/pages/account/[addressOrEnsName]/edit.tsx +++ b/src/pages/account/[addressOrEnsName]/edit.tsx @@ -9,6 +9,7 @@ import { User } from 'models/database' import { GetServerSideProps, InferGetServerSidePropsType } from 'next' import { Database } from 'types/database.types' import { isEqualAddress } from 'utils/address' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' type AccountSettingsType = { initialSession: Session @@ -18,6 +19,8 @@ type AccountSettingsType = { export const getServerSideProps: GetServerSideProps< AccountSettingsType > = async context => { + const global = await globalGetServerSideProps(context) + const supabase = createServerSupabaseClient(context) const { data: { session }, @@ -28,6 +31,7 @@ export const getServerSideProps: GetServerSideProps< typeof context.params.addressOrEnsName !== 'string' ) { return { + ...global, redirect: { destination: '/', permanent: false, @@ -39,6 +43,7 @@ export const getServerSideProps: GetServerSideProps< ) if (!pair) { return { + ...global, redirect: { destination: '/', permanent: false, @@ -56,6 +61,7 @@ export const getServerSideProps: GetServerSideProps< if (!user.data) { return { + ...global, redirect: { destination: '/', permanent: false, @@ -70,6 +76,7 @@ export const getServerSideProps: GetServerSideProps< console.info('Error occurred on signout', e) } return { + ...global, redirect: { destination: '/', permanent: false, @@ -78,7 +85,10 @@ export const getServerSideProps: GetServerSideProps< } return { + ...global, props: { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ...((global as any).props || {}), initialSession: session, user: user.data, }, diff --git a/src/pages/account/[addressOrEnsName]/index.tsx b/src/pages/account/[addressOrEnsName]/index.tsx index df9e42db3b..704c065ce5 100644 --- a/src/pages/account/[addressOrEnsName]/index.tsx +++ b/src/pages/account/[addressOrEnsName]/index.tsx @@ -4,8 +4,10 @@ import Loading from 'components/Loading' import { AppWrapper, SEO } from 'components/common' import { isAddress } from 'ethers/lib/utils' import { resolveAddress } from 'lib/api/ens' +import { loadCatalog } from 'locales/utils' import { Profile } from 'models/database' -import { useRouter } from 'next/router' +import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next' +import { useMemo } from 'react' import { useQuery } from 'react-query' import { truncateEthAddress } from 'utils/format/formatAddress' @@ -47,14 +49,17 @@ function _AccountPage({ addressOrEnsName }: { addressOrEnsName: string }) { ) } -export default function AccountPage() { - const router = useRouter() - const { addressOrEnsName } = router.query as { addressOrEnsName: string } +export default function AccountPage({ + addressOrEnsName, +}: InferGetStaticPropsType) { + const addressFound = useMemo( + () => isAddress(addressOrEnsName) || addressOrEnsName.endsWith('eth'), + [addressOrEnsName], + ) return ( - {addressOrEnsName && - (isAddress(addressOrEnsName) || addressOrEnsName.endsWith('eth')) ? ( + {addressOrEnsName && addressFound ? ( <_AccountPage addressOrEnsName={addressOrEnsName as string} /> ) : (
Not found
@@ -62,3 +67,26 @@ export default function AccountPage() {
) } + +export const getStaticPaths: GetStaticPaths = async () => { + return { + paths: [], + fallback: 'blocking', + } +} + +export const getStaticProps: GetStaticProps<{ + addressOrEnsName: string +}> = async context => { + const locale = context.locale as string + const messages = await loadCatalog(locale) + const i18n = { locale, messages } + + const { addressOrEnsName } = context.params as { addressOrEnsName: string } + return { + props: { + addressOrEnsName, + i18n, + }, + } +} diff --git a/src/pages/activity/index.tsx b/src/pages/activity/index.tsx index 69e9341364..7fcf572e90 100644 --- a/src/pages/activity/index.tsx +++ b/src/pages/activity/index.tsx @@ -1,6 +1,7 @@ import { Trans } from '@lingui/macro' import { PaymentsFeed } from 'components/Activity' import { AppWrapper } from 'components/common' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function ActivityPage() { return ( @@ -18,3 +19,5 @@ export default function ActivityPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/api/juicebox/jb-721-delegate/IJBDelegatesRegistry.json b/src/pages/api/juicebox/jb-721-delegate/IJBDelegatesRegistry.json index 57416acaae..fc48bdab57 100644 --- a/src/pages/api/juicebox/jb-721-delegate/IJBDelegatesRegistry.json +++ b/src/pages/api/juicebox/jb-721-delegate/IJBDelegatesRegistry.json @@ -1,5 +1,40 @@ { "abi": [ + { + "inputs": [ + { + "internalType": "contract IJBDelegatesRegistry", + "name": "_oldRegistry", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "JBDelegatesRegistry_incompatibleDelegate", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_delegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "DelegateAdded", + "type": "event" + }, { "inputs": [ { @@ -59,31 +94,96 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [], + "name": "oldRegistry", + "outputs": [ + { + "internalType": "contract IJBDelegatesRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" } ], "bytecode": { - "object": "0x", - "sourceMap": "", + "object": "0x60a060405234801561001057600080fd5b506040516106cc3803806106cc83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161063561009760003960008181609a0152818160f5015261014401526106356000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063416dc732146100515780635bcfd2121461008057806397b67d4a14610095578063aceea1e4146100bc575b600080fd5b61006461005f3660046104f9565b6100cf565b6040516001600160a01b03909116815260200160405180910390f35b61009361008e36600461051d565b6101b7565b005b6100647f000000000000000000000000000000000000000000000000000000000000000081565b6100936100ca366004610549565b6101d4565b6001600160a01b03808216600090815260208190526040902054168015801561012057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b156101b2576040516320b6e39960e11b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063416dc73290602401602060405180830381865afa15801561018b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101af91906105d2565b90505b919050565b60006101c38383610260565b90506101cf818461048a565b505050565b600060ff60f81b858585856040516101ed9291906105ef565b604051908190038120610234949392916020016001600160f81b031994909416845260609290921b6001600160601b03191660018401526015830152603582015260550190565b6040516020818303038152906040528051906020012060001c9050610259818661048a565b5050505050565b60006060826000036102bb57604051606b60f91b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152600160ff1b60368201526037015b6040516020818303038152906040529050610476565b607f831161030a57604051606b60f91b6020820152602560fa1b60218201526001600160601b0319606086901b16602282015260f884901b6001600160f81b03191660368201526037016102a5565b60ff83116103635760405160d760f81b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152608160f81b603682015260f884901b6001600160f81b03191660378201526038016102a5565b61ffff83116103bd57604051601b60fb1b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152604160f91b60368201526001600160f01b031960f085901b1660378201526039016102a5565b62ffffff83116104185760405160d960f81b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152608360f81b60368201526001600160e81b031960e885901b166037820152603a016102a5565b604051606d60f91b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152602160fa1b60368201526001600160e01b031960e085901b166037820152603b0160405160208183030381529060405290505b805160209091012060008190529392505050565b6001600160a01b0382811660008181526020819052604080822080546001600160a01b0319169486169485179055517f12dade473695d73bd34e031c850d5e815fa17a42b1b5ba13ff72de2497c5e3099190a35050565b6001600160a01b03811681146104f657600080fd5b50565b60006020828403121561050b57600080fd5b8135610516816104e1565b9392505050565b6000806040838503121561053057600080fd5b823561053b816104e1565b946020939093013593505050565b6000806000806060858703121561055f57600080fd5b843561056a816104e1565b935060208501359250604085013567ffffffffffffffff8082111561058e57600080fd5b818701915087601f8301126105a257600080fd5b8135818111156105b157600080fd5b8860208285010111156105c357600080fd5b95989497505060200194505050565b6000602082840312156105e457600080fd5b8151610516816104e1565b818382376000910190815291905056fea26469706673582212201a2e2ccbb47cb0cf186d0076b4a78c2e244273eef6e6615137de9f6227fa858864736f6c63430008140033", + "sourceMap": "588:7903:22:-:0;;;2664:90;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;2721:26:22;;;588:7903;;14:320:26;114:6;167:2;155:9;146:7;142:23;138:32;135:52;;;183:1;180;173:12;135:52;209:16;;-1:-1:-1;;;;;254:31:26;;244:42;;234:70;;300:1;297;290:12;234:70;323:5;14:320;-1:-1:-1;;;14:320:26:o;:::-;588:7903:22;;;;;;;;;;;;;;;;;;;;;;", "linkReferences": {} }, "deployedBytecode": { - "object": "0x", - "sourceMap": "", - "linkReferences": {} + "object": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063416dc732146100515780635bcfd2121461008057806397b67d4a14610095578063aceea1e4146100bc575b600080fd5b61006461005f3660046104f9565b6100cf565b6040516001600160a01b03909116815260200160405180910390f35b61009361008e36600461051d565b6101b7565b005b6100647f000000000000000000000000000000000000000000000000000000000000000081565b6100936100ca366004610549565b6101d4565b6001600160a01b03808216600090815260208190526040902054168015801561012057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615155b156101b2576040516320b6e39960e11b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063416dc73290602401602060405180830381865afa15801561018b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101af91906105d2565b90505b919050565b60006101c38383610260565b90506101cf818461048a565b505050565b600060ff60f81b858585856040516101ed9291906105ef565b604051908190038120610234949392916020016001600160f81b031994909416845260609290921b6001600160601b03191660018401526015830152603582015260550190565b6040516020818303038152906040528051906020012060001c9050610259818661048a565b5050505050565b60006060826000036102bb57604051606b60f91b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152600160ff1b60368201526037015b6040516020818303038152906040529050610476565b607f831161030a57604051606b60f91b6020820152602560fa1b60218201526001600160601b0319606086901b16602282015260f884901b6001600160f81b03191660368201526037016102a5565b60ff83116103635760405160d760f81b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152608160f81b603682015260f884901b6001600160f81b03191660378201526038016102a5565b61ffff83116103bd57604051601b60fb1b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152604160f91b60368201526001600160f01b031960f085901b1660378201526039016102a5565b62ffffff83116104185760405160d960f81b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152608360f81b60368201526001600160e81b031960e885901b166037820152603a016102a5565b604051606d60f91b6020820152602560fa1b60218201526001600160601b0319606086901b166022820152602160fa1b60368201526001600160e01b031960e085901b166037820152603b0160405160208183030381529060405290505b805160209091012060008190529392505050565b6001600160a01b0382811660008181526020819052604080822080546001600160a01b0319169486169485179055517f12dade473695d73bd34e031c850d5e815fa17a42b1b5ba13ff72de2497c5e3099190a35050565b6001600160a01b03811681146104f657600080fd5b50565b60006020828403121561050b57600080fd5b8135610516816104e1565b9392505050565b6000806040838503121561053057600080fd5b823561053b816104e1565b946020939093013593505050565b6000806000806060858703121561055f57600080fd5b843561056a816104e1565b935060208501359250604085013567ffffffffffffffff8082111561058e57600080fd5b818701915087601f8301126105a257600080fd5b8135818111156105b157600080fd5b8860208285010111156105c357600080fd5b95989497505060200194505050565b6000602082840312156105e457600080fd5b8151610516816104e1565b818382376000910190815291905056fea26469706673582212201a2e2ccbb47cb0cf186d0076b4a78c2e244273eef6e6615137de9f6227fa858864736f6c63430008140033", + "sourceMap": "588:7903:22:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3411:391;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;566:32:26;;;548:51;;536:2;521:18;3411:391:22;;;;;;;4769:317;;;;;;:::i;:::-;;:::i;:::-;;1730:49;;;;;5812:500;;;;;;:::i;:::-;;:::i;3411:391::-;-1:-1:-1;;;;;3523:22:22;;;3482:17;3523:22;;;;;;;;;;;;3674:23;;:74;;;;-1:-1:-1;3701:11:22;-1:-1:-1;;;;;3701:47:22;;;3674:74;3671:124;;;3762:33;;-1:-1:-1;;;3762:33:22;;-1:-1:-1;;;;;566:32:26;;;3762:33:22;;;548:51:26;3762:11:22;:22;;;;521:18:26;;3762:33:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3750:45;;3671:124;3411:391;;;:::o;4769:317::-;4925:17;4945:31;4958:9;4969:6;4945:12;:31::i;:::-;4925:51;;5045:34;5058:9;5069;5045:12;:34::i;:::-;4843:243;4769:317;;:::o;5812:500::-;6016:17;6107:4;6100:12;;6126:9;6149:5;6178:9;;6168:20;;;;;;;:::i;:::-;;;;;;;;;6070:128;;;;;;;-1:-1:-1;;;;;;2722:26:26;;;;2710:39;;2786:2;2782:15;;;;-1:-1:-1;;;;;;2778:53:26;2774:1;2765:11;;2758:74;2857:2;2848:12;;2841:28;2894:2;2885:12;;2878:28;2931:2;2922:12;;2499:441;6070:128:22;;;;;;;;;;;;;6060:139;;;;;;6052:148;;6016:186;;6271:34;6284:9;6295;6271:12;:34::i;:::-;5918:394;5812:500;;;;:::o;7496:993::-;7571:16;7599:17;7629:6;7639:4;7629:14;7626:726;;7661:67;;-1:-1:-1;;;7661:67:22;;;3184:28:26;-1:-1:-1;;;3228:11:26;;;3221:36;-1:-1:-1;;;;;;3294:2:26;3290:15;;;3286:53;3273:11;;;3266:74;-1:-1:-1;;;3356:12:26;;;3349:37;3402:12;;7661:67:22;;;;;;;;;;;;;7654:74;;7626:726;;;7756:4;7746:6;:14;7743:609;;7773:68;;-1:-1:-1;;;7773:68:22;;;3662:28:26;-1:-1:-1;;;3706:11:26;;;3699:36;-1:-1:-1;;;;;;3772:2:26;3768:15;;;3764:53;3751:11;;;3744:74;3644:3;3852:16;;;-1:-1:-1;;;;;;3848:25:26;3834:12;;;3827:47;3890:12;;7773:68:22;3425:483:26;7743:609:22;7869:4;7859:6;:14;7856:496;;7886:82;;-1:-1:-1;;;7886:82:22;;;4176:28:26;-1:-1:-1;;;4220:11:26;;;4213:36;-1:-1:-1;;;;;;4286:2:26;4282:15;;;4278:53;4265:11;;;4258:74;-1:-1:-1;;;4348:12:26;;;4341:37;4158:3;4412:16;;;-1:-1:-1;;;;;;4408:25:26;4394:12;;;4387:47;4450:12;;7886:82:22;3913:555:26;7856:496:22;7996:6;7986;:16;7983:369;;8013:83;;-1:-1:-1;;;8013:83:22;;;4738:28:26;-1:-1:-1;;;4782:11:26;;;4775:36;-1:-1:-1;;;;;;4848:2:26;4844:15;;;4840:53;4827:11;;;4820:74;-1:-1:-1;;;4910:12:26;;;4903:37;-1:-1:-1;;;;;;4996:3:26;4974:16;;;4970:38;4956:12;;;4949:60;5025:12;;8013:83:22;4473:570:26;7983:369:22;8124:8;8114:6;:18;8111:241;;8141:83;;-1:-1:-1;;;8141:83:22;;;5313:28:26;-1:-1:-1;;;5357:11:26;;;5350:36;-1:-1:-1;;;;;;5423:2:26;5419:15;;;5415:53;5402:11;;;5395:74;-1:-1:-1;;;5485:12:26;;;5478:37;-1:-1:-1;;;;;;5571:3:26;5549:16;;;5545:41;5531:12;;;5524:63;5603:12;;8141:83:22;5048:573:26;8111:241:22;8269:83;;-1:-1:-1;;;8269:83:22;;;5891:28:26;-1:-1:-1;;;5935:11:26;;;5928:36;-1:-1:-1;;;;;;6001:2:26;5997:15;;;5993:53;5980:11;;;5973:74;-1:-1:-1;;;6063:12:26;;;6056:37;-1:-1:-1;;;;;;6149:3:26;6127:16;;;6123:43;6109:12;;;6102:65;6183:12;;8269:83:22;;;;;;;;;;;;8262:90;;8111:241;8377:15;;;;;;;8362:12;8425:15;;;8377;7496:993;-1:-1:-1;;;7496:993:22:o;6805:207::-;-1:-1:-1;;;;;6920:22:22;;;:11;:22;;;;;;;;;;;:34;;-1:-1:-1;;;;;;6920:34:22;;;;;;;;;6970:35;;;6920:11;6970:35;6805:207;;:::o;14:131:26:-;-1:-1:-1;;;;;89:31:26;;79:42;;69:70;;135:1;132;125:12;69:70;14:131;:::o;150:247::-;209:6;262:2;250:9;241:7;237:23;233:32;230:52;;;278:1;275;268:12;230:52;317:9;304:23;336:31;361:5;336:31;:::i;:::-;386:5;150:247;-1:-1:-1;;;150:247:26:o;610:315::-;678:6;686;739:2;727:9;718:7;714:23;710:32;707:52;;;755:1;752;745:12;707:52;794:9;781:23;813:31;838:5;813:31;:::i;:::-;863:5;915:2;900:18;;;;887:32;;-1:-1:-1;;;610:315:26:o;1168:794::-;1256:6;1264;1272;1280;1333:2;1321:9;1312:7;1308:23;1304:32;1301:52;;;1349:1;1346;1339:12;1301:52;1388:9;1375:23;1407:31;1432:5;1407:31;:::i;:::-;1457:5;-1:-1:-1;1509:2:26;1494:18;;1481:32;;-1:-1:-1;1564:2:26;1549:18;;1536:32;1587:18;1617:14;;;1614:34;;;1644:1;1641;1634:12;1614:34;1682:6;1671:9;1667:22;1657:32;;1727:7;1720:4;1716:2;1712:13;1708:27;1698:55;;1749:1;1746;1739:12;1698:55;1789:2;1776:16;1815:2;1807:6;1804:14;1801:34;;;1831:1;1828;1821:12;1801:34;1876:7;1871:2;1862:6;1858:2;1854:15;1850:24;1847:37;1844:57;;;1897:1;1894;1887:12;1844:57;1168:794;;;;-1:-1:-1;;1928:2:26;1920:11;;-1:-1:-1;;;1168:794:26:o;1967:251::-;2037:6;2090:2;2078:9;2069:7;2065:23;2061:32;2058:52;;;2106:1;2103;2096:12;2058:52;2138:9;2132:16;2157:31;2182:5;2157:31;:::i;2223:271::-;2406:6;2398;2393:3;2380:33;2362:3;2432:16;;2457:13;;;2432:16;2223:271;-1:-1:-1;2223:271:26:o", + "linkReferences": {}, + "immutableReferences": { + "25707": [ + { + "start": 154, + "length": 32 + }, + { + "start": 245, + "length": 32 + }, + { + "start": 324, + "length": 32 + } + ] + } }, "methodIdentifiers": { "addDelegate(address,uint256)": "5bcfd212", "addDelegateCreate2(address,bytes32,bytes)": "aceea1e4", - "deployerOf(address)": "416dc732" + "deployerOf(address)": "416dc732", + "oldRegistry()": "97b67d4a" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"addDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_bytecode\",\"type\":\"bytes\"}],\"name\":\"addDelegateCreate2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegate\",\"type\":\"address\"}],\"name\":\"deployerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/IJBDelegatesRegistry.sol\":\"IJBDelegatesRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@jbx-protocol/=node_modules/@jbx-protocol/\",\":@juice-delegate-registry/=src/\",\":@openzeppelin/=node_modules/@openzeppelin/\",\":@paulrberg/=node_modules/@paulrberg/\",\":ds-test/=lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\",\":prb-math/=node_modules/prb-math/\"]},\"sources\":{\"src/interfaces/IJBDelegatesRegistry.sol\":{\"keccak256\":\"0x5559fcd3983e7572b15d9a00d15c031aad22078f349760729893664bc2013c4c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fde585c6320af838560bfa4a6ecfd6c742859c73dac4a35dde3cd68a55121979\",\"dweb:/ipfs/QmSq7owwxRXBq4nghTwhMRJ6pPkxMXpsVHCCCeAWVf6cXw\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IJBDelegatesRegistry\",\"name\":\"_oldRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"JBDelegatesRegistry_incompatibleDelegate\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_delegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"DelegateAdded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"addDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_bytecode\",\"type\":\"bytes\"}],\"name\":\"addDelegateCreate2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegate\",\"type\":\"address\"}],\"name\":\"deployerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oldRegistry\",\"outputs\":[{\"internalType\":\"contract IJBDelegatesRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Mostly for front-end integration purposes. The delegate address is computed from the deployer address and the nonce used to deploy the delegate. \",\"kind\":\"dev\",\"methods\":{\"addDelegate(address,uint256)\":{\"details\":\"frontend might retrieve the correct nonce, for both contract and eoa, using ethers provider.getTransactionCount(address) or web3js web3.eth.getTransactionCount just *before* the delegate deployment (if adding a delegate at a later time, manual nonce counting might be needed)\",\"params\":{\"_deployer\":\"The address of the deployer of a given delegate\",\"_nonce\":\"The nonce used to deploy the delegate\"}},\"addDelegateCreate2(address,bytes32,bytes)\":{\"details\":\"_salt is based on the delegate deployer own internal logic while the deployment bytecode can be retrieved in the deployment transaction (off-chain) or via abi.encodePacked(type(delegateContract).creationCode, abi.encode(constructorArguments)) (on-chain)\",\"params\":{\"_bytecode\":\"The *deployment* bytecode used to deploy the delegate (ie including constructor and its arguments)\",\"_deployer\":\"The address of the contract deployer\",\"_salt\":\"An unique salt used to deploy the delegate\"}},\"deployerOf(address)\":{\"details\":\"This function prototype mimick the mapping getter from the previous registry, in order to keep the interface unchanged\",\"params\":{\"_delegate\":\"The delegate address\"},\"returns\":{\"_deployer\":\"The deployer address\"}}},\"title\":\"JBDelegatesRegistry\",\"version\":1},\"userdoc\":{\"errors\":{\"JBDelegatesRegistry_incompatibleDelegate()\":[{\"notice\":\"Throws if the delegate is not compatible with the Juicebox protocol (based on ERC165)\"}]},\"events\":{\"DelegateAdded(address,address)\":{\"notice\":\"Emitted when a deployed delegate is added\"}},\"kind\":\"user\",\"methods\":{\"addDelegate(address,uint256)\":{\"notice\":\"Add a delegate to the registry (needs to implement erc165, a delegate type and deployed using create)\"},\"addDelegateCreate2(address,bytes32,bytes)\":{\"notice\":\"Add a delegate to the registry (needs to implement erc165, a delegate type and deployed using create2)\"},\"deployerOf(address)\":{\"notice\":\"Get the deployer of a delegate\"},\"oldRegistry()\":{\"notice\":\"The previous registry, used for retrocompatibility\"}},\"notice\":\"This contract is used to register deployers of Juicebox Delegates It is the deployer responsability to register their delegates in this registry and make sure the delegate implements IERC165\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/JBDelegatesRegistry.sol\":\"JBDelegatesRegistry\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@jbx-protocol/=node_modules/@jbx-protocol/\",\":@juice-delegate-registry/=src/\",\":@openzeppelin/=node_modules/@openzeppelin/\",\":@paulrberg/=node_modules/@paulrberg/\",\":ds-test/=lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\",\":prb-math/=node_modules/prb-math/\"]},\"sources\":{\"src/JBDelegatesRegistry.sol\":{\"keccak256\":\"0x3a6a687c9b8944d1a760b440b06e9f74993ea3302b904073928f7746fe7587c0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9e13f3e6b1ea82b129e8425715f796a57ac8637af7b1f1f7525c98e8f7866e53\",\"dweb:/ipfs/QmcHwVLyNXoB5H2xCcaDaTxLXVdxrybCRouwPep6egwH2r\"]},\"src/interfaces/IJBDelegatesRegistry.sol\":{\"keccak256\":\"0x5559fcd3983e7572b15d9a00d15c031aad22078f349760729893664bc2013c4c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fde585c6320af838560bfa4a6ecfd6c742859c73dac4a35dde3cd68a55121979\",\"dweb:/ipfs/QmSq7owwxRXBq4nghTwhMRJ6pPkxMXpsVHCCCeAWVf6cXw\"]}},\"version\":1}", "metadata": { "compiler": { - "version": "0.8.17+commit.8df45f5f" + "version": "0.8.20+commit.a1b79de6" }, "language": "Solidity", "output": { "abi": [ + { + "inputs": [ + { + "internalType": "contract IJBDelegatesRegistry", + "name": "_oldRegistry", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "type": "error", + "name": "JBDelegatesRegistry_incompatibleDelegate" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegate", + "type": "address", + "indexed": true + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address", + "indexed": true + } + ], + "type": "event", + "name": "DelegateAdded", + "anonymous": false + }, { "inputs": [ { @@ -141,16 +241,67 @@ "type": "address" } ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "oldRegistry", + "outputs": [ + { + "internalType": "contract IJBDelegatesRegistry", + "name": "", + "type": "address" + } + ] } ], "devdoc": { "kind": "dev", - "methods": {}, + "methods": { + "addDelegate(address,uint256)": { + "details": "frontend might retrieve the correct nonce, for both contract and eoa, using ethers provider.getTransactionCount(address) or web3js web3.eth.getTransactionCount just *before* the delegate deployment (if adding a delegate at a later time, manual nonce counting might be needed)", + "params": { + "_deployer": "The address of the deployer of a given delegate", + "_nonce": "The nonce used to deploy the delegate" + } + }, + "addDelegateCreate2(address,bytes32,bytes)": { + "details": "_salt is based on the delegate deployer own internal logic while the deployment bytecode can be retrieved in the deployment transaction (off-chain) or via abi.encodePacked(type(delegateContract).creationCode, abi.encode(constructorArguments)) (on-chain)", + "params": { + "_bytecode": "The *deployment* bytecode used to deploy the delegate (ie including constructor and its arguments)", + "_deployer": "The address of the contract deployer", + "_salt": "An unique salt used to deploy the delegate" + } + }, + "deployerOf(address)": { + "details": "This function prototype mimick the mapping getter from the previous registry, in order to keep the interface unchanged", + "params": { + "_delegate": "The delegate address" + }, + "returns": { + "_deployer": "The deployer address" + } + } + }, "version": 1 }, "userdoc": { "kind": "user", - "methods": {}, + "methods": { + "addDelegate(address,uint256)": { + "notice": "Add a delegate to the registry (needs to implement erc165, a delegate type and deployed using create)" + }, + "addDelegateCreate2(address,bytes32,bytes)": { + "notice": "Add a delegate to the registry (needs to implement erc165, a delegate type and deployed using create2)" + }, + "deployerOf(address)": { + "notice": "Get the deployer of a delegate" + }, + "oldRegistry()": { + "notice": "The previous registry, used for retrocompatibility" + } + }, "version": 1 } }, @@ -172,11 +323,19 @@ "bytecodeHash": "ipfs" }, "compilationTarget": { - "src/interfaces/IJBDelegatesRegistry.sol": "IJBDelegatesRegistry" + "src/JBDelegatesRegistry.sol": "JBDelegatesRegistry" }, "libraries": {} }, "sources": { + "src/JBDelegatesRegistry.sol": { + "keccak256": "0x3a6a687c9b8944d1a760b440b06e9f74993ea3302b904073928f7746fe7587c0", + "urls": [ + "bzz-raw://9e13f3e6b1ea82b129e8425715f796a57ac8637af7b1f1f7525c98e8f7866e53", + "dweb:/ipfs/QmcHwVLyNXoB5H2xCcaDaTxLXVdxrybCRouwPep6egwH2r" + ], + "license": "MIT" + }, "src/interfaces/IJBDelegatesRegistry.sol": { "keccak256": "0x5559fcd3983e7572b15d9a00d15c031aad22078f349760729893664bc2013c4c", "urls": [ @@ -189,50 +348,821 @@ "version": 1 }, "ast": { - "absolutePath": "src/interfaces/IJBDelegatesRegistry.sol", - "id": 26172, + "absolutePath": "src/JBDelegatesRegistry.sol", + "id": 26020, "exportedSymbols": { - "IJBDelegatesRegistry": [26171] + "IJBDelegatesRegistry": [26045], + "JBDelegatesRegistry": [26019] }, "nodeType": "SourceUnit", - "src": "32:317:24", + "src": "32:8459:22", "nodes": [ { - "id": 26147, + "id": 25688, "nodeType": "PragmaDirective", - "src": "32:23:24", + "src": "32:24:22", + "nodes": [], + "literals": ["solidity", "^", "0.8", ".19"] + }, + { + "id": 25690, + "nodeType": "ImportDirective", + "src": "58:77:22", "nodes": [], - "literals": ["solidity", "^", "0.8", ".0"] + "absolutePath": "src/interfaces/IJBDelegatesRegistry.sol", + "file": "./interfaces/IJBDelegatesRegistry.sol", + "nameLocation": "-1:-1:-1", + "scope": 26020, + "sourceUnit": 26046, + "symbolAliases": [ + { + "foreign": { + "id": 25689, + "name": "IJBDelegatesRegistry", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 26045, + "src": "67:20:22", + "typeDescriptions": {} + }, + "nameLocation": "-1:-1:-1" + } + ], + "unitAlias": "" }, { - "id": 26171, + "id": 26019, "nodeType": "ContractDefinition", - "src": "57:292:24", + "src": "588:7903:22", "nodes": [ { - "id": 26154, + "id": 25696, + "nodeType": "ErrorDefinition", + "src": "1104:49:22", + "nodes": [], + "documentation": { + "id": 25694, + "nodeType": "StructuredDocumentation", + "src": "987:112:22", + "text": " @notice Throws if the delegate is not compatible with the Juicebox protocol (based on ERC165)" + }, + "errorSelector": "2d47a410", + "name": "JBDelegatesRegistry_incompatibleDelegate", + "nameLocation": "1110:40:22", + "parameters": { + "id": 25695, + "nodeType": "ParameterList", + "parameters": [], + "src": "1150:2:22" + } + }, + { + "id": 25703, + "nodeType": "EventDefinition", + "src": "1232:74:22", + "nodes": [], + "anonymous": false, + "documentation": { + "id": 25697, + "nodeType": "StructuredDocumentation", + "src": "1159:68:22", + "text": " @notice Emitted when a deployed delegate is added" + }, + "eventSelector": "12dade473695d73bd34e031c850d5e815fa17a42b1b5ba13ff72de2497c5e309", + "name": "DelegateAdded", + "nameLocation": "1238:13:22", + "parameters": { + "id": 25702, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 25699, + "indexed": true, + "mutability": "mutable", + "name": "_delegate", + "nameLocation": "1268:9:22", + "nodeType": "VariableDeclaration", + "scope": 25703, + "src": "1252:25:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 25698, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1252:7:22", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 25701, + "indexed": true, + "mutability": "mutable", + "name": "_deployer", + "nameLocation": "1295:9:22", + "nodeType": "VariableDeclaration", + "scope": 25703, + "src": "1279:25:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 25700, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1279:7:22", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "1251:54:22" + } + }, + { + "id": 25707, + "nodeType": "VariableDeclaration", + "src": "1730:49:22", + "nodes": [], + "constant": false, + "documentation": { + "id": 25704, + "nodeType": "StructuredDocumentation", + "src": "1648:77:22", + "text": " @notice The previous registry, used for retrocompatibility" + }, + "functionSelector": "97b67d4a", + "mutability": "immutable", + "name": "oldRegistry", + "nameLocation": "1768:11:22", + "scope": 26019, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + }, + "typeName": { + "id": 25706, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 25705, + "name": "IJBDelegatesRegistry", + "nameLocations": ["1730:20:22"], + "nodeType": "IdentifierPath", + "referencedDeclaration": 26045, + "src": "1730:20:22" + }, + "referencedDeclaration": 26045, + "src": "1730:20:22", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + } + }, + "visibility": "public" + }, + { + "id": 25712, + "nodeType": "VariableDeclaration", + "src": "2249:68:22", + "nodes": [], + "constant": false, + "documentation": { + "id": 25708, + "nodeType": "StructuredDocumentation", + "src": "2122:122:22", + "text": " @notice Track which deployer deployed a delegate, based on a\n proactive deployer update" + }, + "mutability": "mutable", + "name": "_deployerOf", + "nameLocation": "2306:11:22", + "scope": 26019, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_address_$", + "typeString": "mapping(address => address)" + }, + "typeName": { + "id": 25711, + "keyName": "_delegate", + "keyNameLocation": "2265:9:22", + "keyType": { + "id": 25709, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2257:7:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "2249:47:22", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_address_$", + "typeString": "mapping(address => address)" + }, + "valueName": "_deployer", + "valueNameLocation": "2286:9:22", + "valueType": { + "id": 25710, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2278:7:22", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + }, + "visibility": "internal" + }, + { + "id": 25723, "nodeType": "FunctionDefinition", - "src": "94:81:24", + "src": "2664:90:22", "nodes": [], + "body": { + "id": 25722, + "nodeType": "Block", + "src": "2711:43:22", + "nodes": [], + "statements": [ + { + "expression": { + "id": 25720, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25718, + "name": "oldRegistry", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25707, + "src": "2721:11:22", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 25719, + "name": "_oldRegistry", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25715, + "src": "2735:12:22", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + } + }, + "src": "2721:26:22", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + } + }, + "id": 25721, + "nodeType": "ExpressionStatement", + "src": "2721:26:22" + } + ] + }, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "parameters": { + "id": 25716, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 25715, + "mutability": "mutable", + "name": "_oldRegistry", + "nameLocation": "2697:12:22", + "nodeType": "VariableDeclaration", + "scope": 25723, + "src": "2676:33:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + }, + "typeName": { + "id": 25714, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 25713, + "name": "IJBDelegatesRegistry", + "nameLocations": ["2676:20:22"], + "nodeType": "IdentifierPath", + "referencedDeclaration": 26045, + "src": "2676:20:22" + }, + "referencedDeclaration": 26045, + "src": "2676:20:22", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + } + }, + "visibility": "internal" + } + ], + "src": "2675:35:22" + }, + "returnParameters": { + "id": 25717, + "nodeType": "ParameterList", + "parameters": [], + "src": "2711:0:22" + }, + "scope": 26019, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "id": 25762, + "nodeType": "FunctionDefinition", + "src": "3411:391:22", + "nodes": [], + "body": { + "id": 25761, + "nodeType": "Block", + "src": "3501:301:22", + "nodes": [], + "statements": [ + { + "expression": { + "id": 25736, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25732, + "name": "_deployer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25730, + "src": "3511:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "baseExpression": { + "id": 25733, + "name": "_deployerOf", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25712, + "src": "3523:11:22", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_address_$", + "typeString": "mapping(address => address)" + } + }, + "id": 25735, + "indexExpression": { + "id": 25734, + "name": "_delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25726, + "src": "3535:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3523:22:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3511:34:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 25737, + "nodeType": "ExpressionStatement", + "src": "3511:34:22" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 25752, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 25743, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 25738, + "name": "_deployer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25730, + "src": "3674:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 25741, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3695:1:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 25740, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3687:7:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 25739, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3687:7:22", + "typeDescriptions": {} + } + }, + "id": 25742, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3687:10:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3674:23:22", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + }, + "id": 25751, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 25744, + "name": "oldRegistry", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25707, + "src": "3701:11:22", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30", + "id": 25748, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3745:1:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 25747, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3737:7:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 25746, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "3737:7:22", + "typeDescriptions": {} + } + }, + "id": 25749, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3737:10:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 25745, + "name": "IJBDelegatesRegistry", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 26045, + "src": "3716:20:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IJBDelegatesRegistry_$26045_$", + "typeString": "type(contract IJBDelegatesRegistry)" + } + }, + "id": 25750, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3716:32:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + } + }, + "src": "3701:47:22", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3674:74:22", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 25760, + "nodeType": "IfStatement", + "src": "3671:124:22", + "trueBody": { + "expression": { + "id": 25758, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25753, + "name": "_deployer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25730, + "src": "3750:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 25756, + "name": "_delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25726, + "src": "3785:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "id": 25754, + "name": "oldRegistry", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25707, + "src": "3762:11:22", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IJBDelegatesRegistry_$26045", + "typeString": "contract IJBDelegatesRegistry" + } + }, + "id": 25755, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3774:10:22", + "memberName": "deployerOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 26028, + "src": "3762:22:22", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_address_$", + "typeString": "function (address) view external returns (address)" + } + }, + "id": 25757, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3762:33:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3750:45:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 25759, + "nodeType": "ExpressionStatement", + "src": "3750:45:22" + } + } + ] + }, + "baseFunctions": [26028], + "documentation": { + "id": 25724, + "nodeType": "StructuredDocumentation", + "src": "3096:310:22", + "text": " @notice Get the deployer of a delegate\n @dev This function prototype mimick the mapping getter from the previous\n registry, in order to keep the interface unchanged\n @param _delegate The delegate address\n @return _deployer The deployer address" + }, "functionSelector": "416dc732", - "implemented": false, + "implemented": true, "kind": "function", "modifiers": [], "name": "deployerOf", - "nameLocation": "103:10:24", + "nameLocation": "3420:10:22", + "overrides": { + "id": 25728, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "3464:8:22" + }, "parameters": { - "id": 26150, + "id": 25727, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 26149, + "id": 25726, "mutability": "mutable", "name": "_delegate", - "nameLocation": "122:9:24", + "nameLocation": "3439:9:22", "nodeType": "VariableDeclaration", - "scope": 26154, - "src": "114:17:24", + "scope": 25762, + "src": "3431:17:22", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -240,10 +1170,10 @@ "typeString": "address" }, "typeName": { - "id": 26148, + "id": 25725, "name": "address", "nodeType": "ElementaryTypeName", - "src": "114:7:24", + "src": "3431:7:22", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -253,21 +1183,21 @@ "visibility": "internal" } ], - "src": "113:19:24" + "src": "3430:19:22" }, "returnParameters": { - "id": 26153, + "id": 25731, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 26152, + "id": 25730, "mutability": "mutable", "name": "_deployer", - "nameLocation": "164:9:24", + "nameLocation": "3490:9:22", "nodeType": "VariableDeclaration", - "scope": 26154, - "src": "156:17:24", + "scope": 25762, + "src": "3482:17:22", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -275,10 +1205,10 @@ "typeString": "address" }, "typeName": { - "id": 26151, + "id": 25729, "name": "address", "nodeType": "ElementaryTypeName", - "src": "156:7:24", + "src": "3482:7:22", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -288,37 +1218,229 @@ "visibility": "internal" } ], - "src": "155:19:24" + "src": "3481:19:22" }, - "scope": 26171, + "scope": 26019, "stateMutability": "view", "virtual": false, "visibility": "external" }, { - "id": 26161, + "id": 25784, "nodeType": "FunctionDefinition", - "src": "180:65:24", + "src": "4769:317:22", "nodes": [], + "body": { + "id": 25783, + "nodeType": "Block", + "src": "4843:243:22", + "nodes": [], + "statements": [ + { + "assignments": [25772], + "declarations": [ + { + "constant": false, + "id": 25772, + "mutability": "mutable", + "name": "_delegate", + "nameLocation": "4933:9:22", + "nodeType": "VariableDeclaration", + "scope": 25783, + "src": "4925:17:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 25771, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4925:7:22", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 25777, + "initialValue": { + "arguments": [ + { + "id": 25774, + "name": "_deployer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25765, + "src": "4958:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 25775, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25767, + "src": "4969:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 25773, + "name": "_addressFrom", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 26018, + "src": "4945:12:22", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_address_$_t_uint256_$returns$_t_address_$", + "typeString": "function (address,uint256) pure returns (address)" + } + }, + "id": 25776, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4945:31:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4925:51:22" + }, + { + "expression": { + "arguments": [ + { + "id": 25779, + "name": "_delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25772, + "src": "5058:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 25780, + "name": "_deployer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25765, + "src": "5069:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 25778, + "name": "_addDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25847, + "src": "5045:12:22", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 25781, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "5045:34:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 25782, + "nodeType": "ExpressionStatement", + "src": "5045:34:22" + } + ] + }, + "baseFunctions": [26035], + "documentation": { + "id": 25763, + "nodeType": "StructuredDocumentation", + "src": "4144:620:22", + "text": " @notice Add a delegate to the registry (needs to implement erc165, a delegate type and deployed using create)\n @param _deployer The address of the deployer of a given delegate\n @param _nonce The nonce used to deploy the delegate\n @dev frontend might retrieve the correct nonce, for both contract and eoa, using \n ethers provider.getTransactionCount(address) or web3js web3.eth.getTransactionCount just *before* the\n delegate deployment (if adding a delegate at a later time, manual nonce counting might be needed)" + }, "functionSelector": "5bcfd212", - "implemented": false, + "implemented": true, "kind": "function", "modifiers": [], "name": "addDelegate", - "nameLocation": "189:11:24", + "nameLocation": "4778:11:22", + "overrides": { + "id": 25769, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "4834:8:22" + }, "parameters": { - "id": 26159, + "id": 25768, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 26156, + "id": 25765, "mutability": "mutable", "name": "_deployer", - "nameLocation": "209:9:24", + "nameLocation": "4798:9:22", "nodeType": "VariableDeclaration", - "scope": 26161, - "src": "201:17:24", + "scope": 25784, + "src": "4790:17:22", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -326,10 +1448,10 @@ "typeString": "address" }, "typeName": { - "id": 26155, + "id": 25764, "name": "address", "nodeType": "ElementaryTypeName", - "src": "201:7:24", + "src": "4790:7:22", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -340,13 +1462,13 @@ }, { "constant": false, - "id": 26158, + "id": 25767, "mutability": "mutable", "name": "_nonce", - "nameLocation": "228:6:24", + "nameLocation": "4817:6:22", "nodeType": "VariableDeclaration", - "scope": 26161, - "src": "220:14:24", + "scope": 25784, + "src": "4809:14:22", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -354,10 +1476,10 @@ "typeString": "uint256" }, "typeName": { - "id": 26157, + "id": 25766, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "220:7:24", + "src": "4809:7:22", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -366,43 +1488,540 @@ "visibility": "internal" } ], - "src": "200:35:24" + "src": "4789:35:22" }, "returnParameters": { - "id": 26160, + "id": 25770, "nodeType": "ParameterList", "parameters": [], - "src": "244:0:24" + "src": "4843:0:22" }, - "scope": 26171, + "scope": 26019, "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { - "id": 26170, + "id": 25827, "nodeType": "FunctionDefinition", - "src": "250:97:24", + "src": "5812:500:22", "nodes": [], + "body": { + "id": 25826, + "nodeType": "Block", + "src": "5918:394:22", + "nodes": [], + "statements": [ + { + "assignments": [25796], + "declarations": [ + { + "constant": false, + "id": 25796, + "mutability": "mutable", + "name": "_delegate", + "nameLocation": "6024:9:22", + "nodeType": "VariableDeclaration", + "scope": 25826, + "src": "6016:17:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 25795, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6016:7:22", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 25820, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30786666", + "id": 25808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6107:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "0xff" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + } + ], + "id": 25807, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6100:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25806, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "6100:6:22", + "typeDescriptions": {} + } + }, + "id": 25809, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6100:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "id": 25810, + "name": "_deployer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25787, + "src": "6126:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 25811, + "name": "_salt", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25789, + "src": "6149:5:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "arguments": [ + { + "id": 25813, + "name": "_bytecode", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25791, + "src": "6178:9:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes calldata" + } + ], + "id": 25812, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "6168:9:22", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 25814, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6168:20:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "id": 25804, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "6070:3:22", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 25805, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "6074:12:22", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "6070:16:22", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 25815, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6070:128:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 25803, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "6060:9:22", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 25816, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6060:139:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 25802, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6052:7:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 25801, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6052:7:22", + "typeDescriptions": {} + } + }, + "id": 25817, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6052:148:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 25800, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6044:7:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": { + "id": 25799, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "6044:7:22", + "typeDescriptions": {} + } + }, + "id": 25818, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6044:157:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + ], + "id": 25798, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6036:7:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": { + "id": 25797, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6036:7:22", + "typeDescriptions": {} + } + }, + "id": 25819, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6036:166:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6016:186:22" + }, + { + "expression": { + "arguments": [ + { + "id": 25822, + "name": "_delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25796, + "src": "6284:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 25823, + "name": "_deployer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25787, + "src": "6295:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 25821, + "name": "_addDelegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25847, + "src": "6271:12:22", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 25824, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6271:34:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 25825, + "nodeType": "ExpressionStatement", + "src": "6271:34:22" + } + ] + }, + "baseFunctions": [26044], + "documentation": { + "id": 25785, + "nodeType": "StructuredDocumentation", + "src": "5092:715:22", + "text": " @notice Add a delegate to the registry (needs to implement erc165, a delegate type and deployed using create2)\n @param _deployer The address of the contract deployer\n @param _salt An unique salt used to deploy the delegate\n @param _bytecode The *deployment* bytecode used to deploy the delegate (ie including constructor and its arguments)\n @dev _salt is based on the delegate deployer own internal logic while the deployment bytecode can be retrieved in\n the deployment transaction (off-chain) or via\n abi.encodePacked(type(delegateContract).creationCode, abi.encode(constructorArguments)) (on-chain)" + }, "functionSelector": "aceea1e4", - "implemented": false, + "implemented": true, "kind": "function", "modifiers": [], "name": "addDelegateCreate2", - "nameLocation": "259:18:24", + "nameLocation": "5821:18:22", + "overrides": { + "id": 25793, + "nodeType": "OverrideSpecifier", + "overrides": [], + "src": "5909:8:22" + }, "parameters": { - "id": 26168, + "id": 25792, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 26163, + "id": 25787, "mutability": "mutable", "name": "_deployer", - "nameLocation": "286:9:24", + "nameLocation": "5848:9:22", "nodeType": "VariableDeclaration", - "scope": 26170, - "src": "278:17:24", + "scope": 25827, + "src": "5840:17:22", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -410,10 +2029,10 @@ "typeString": "address" }, "typeName": { - "id": 26162, + "id": 25786, "name": "address", "nodeType": "ElementaryTypeName", - "src": "278:7:24", + "src": "5840:7:22", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -424,13 +2043,13 @@ }, { "constant": false, - "id": 26165, + "id": 25789, "mutability": "mutable", "name": "_salt", - "nameLocation": "305:5:24", + "nameLocation": "5867:5:22", "nodeType": "VariableDeclaration", - "scope": 26170, - "src": "297:13:24", + "scope": 25827, + "src": "5859:13:22", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -438,10 +2057,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 26164, + "id": 25788, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "297:7:24", + "src": "5859:7:22", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -451,13 +2070,13 @@ }, { "constant": false, - "id": 26167, + "id": 25791, "mutability": "mutable", "name": "_bytecode", - "nameLocation": "327:9:24", + "nameLocation": "5889:9:22", "nodeType": "VariableDeclaration", - "scope": 26170, - "src": "312:24:24", + "scope": 25827, + "src": "5874:24:22", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { @@ -465,10 +2084,10 @@ "typeString": "bytes" }, "typeName": { - "id": 26166, + "id": 25790, "name": "bytes", "nodeType": "ElementaryTypeName", - "src": "312:5:24", + "src": "5874:5:22", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" @@ -477,34 +2096,2855 @@ "visibility": "internal" } ], - "src": "277:60:24" + "src": "5839:60:22" }, "returnParameters": { - "id": 26169, + "id": 25794, "nodeType": "ParameterList", "parameters": [], - "src": "346:0:24" + "src": "5918:0:22" }, - "scope": 26171, + "scope": 26019, "stateMutability": "nonpayable", "virtual": false, "visibility": "external" + }, + { + "id": 25847, + "nodeType": "FunctionDefinition", + "src": "6805:207:22", + "nodes": [], + "body": { + "id": 25846, + "nodeType": "Block", + "src": "6874:138:22", + "nodes": [], + "statements": [ + { + "expression": { + "id": 25839, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 25835, + "name": "_deployerOf", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25712, + "src": "6920:11:22", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_address_$", + "typeString": "mapping(address => address)" + } + }, + "id": 25837, + "indexExpression": { + "id": 25836, + "name": "_delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25830, + "src": "6932:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "6920:22:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 25838, + "name": "_deployer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25832, + "src": "6945:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "6920:34:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 25840, + "nodeType": "ExpressionStatement", + "src": "6920:34:22" + }, + { + "eventCall": { + "arguments": [ + { + "id": 25842, + "name": "_delegate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25830, + "src": "6984:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "id": 25843, + "name": "_deployer", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25832, + "src": "6995:9:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 25841, + "name": "DelegateAdded", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25703, + "src": "6970:13:22", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", + "typeString": "function (address,address)" + } + }, + "id": 25844, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "6970:35:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 25845, + "nodeType": "EmitStatement", + "src": "6965:40:22" + } + ] + }, + "documentation": { + "id": 25828, + "nodeType": "StructuredDocumentation", + "src": "6654:146:22", + "text": " @notice Add a delegate to the mapping\n @param _delegate the delegate address\n @param _deployer the deployer address" + }, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_addDelegate", + "nameLocation": "6814:12:22", + "parameters": { + "id": 25833, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 25830, + "mutability": "mutable", + "name": "_delegate", + "nameLocation": "6835:9:22", + "nodeType": "VariableDeclaration", + "scope": 25847, + "src": "6827:17:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 25829, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6827:7:22", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 25832, + "mutability": "mutable", + "name": "_deployer", + "nameLocation": "6854:9:22", + "nodeType": "VariableDeclaration", + "scope": 25847, + "src": "6846:17:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 25831, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6846:7:22", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "6826:38:22" + }, + "returnParameters": { + "id": 25834, + "nodeType": "ParameterList", + "parameters": [], + "src": "6874:0:22" + }, + "scope": 26019, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "internal" + }, + { + "id": 26018, + "nodeType": "FunctionDefinition", + "src": "7496:993:22", + "nodes": [], + "body": { + "id": 26017, + "nodeType": "Block", + "src": "7589:900:22", + "nodes": [], + "statements": [ + { + "assignments": [25858], + "declarations": [ + { + "constant": false, + "id": 25858, + "mutability": "mutable", + "name": "data", + "nameLocation": "7612:4:22", + "nodeType": "VariableDeclaration", + "scope": 26017, + "src": "7599:17:22", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 25857, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "7599:5:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 25859, + "nodeType": "VariableDeclarationStatement", + "src": "7599:17:22" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 25862, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 25860, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "7629:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30783030", + "id": 25861, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7639:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0x00" + }, + "src": "7629:14:22", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 25884, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 25882, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "7746:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "hexValue": "30783766", + "id": 25883, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7756:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_127_by_1", + "typeString": "int_const 127" + }, + "value": "0x7f" + }, + "src": "7746:14:22", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 25906, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 25904, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "7859:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "hexValue": "30786666", + "id": 25905, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7869:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "0xff" + }, + "src": "7859:14:22", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 25932, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 25930, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "7986:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "hexValue": "307866666666", + "id": 25931, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7996:6:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_65535_by_1", + "typeString": "int_const 65535" + }, + "value": "0xffff" + }, + "src": "7986:16:22", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 25958, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 25956, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "8114:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "hexValue": "3078666666666666", + "id": 25957, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8124:8:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_16777215_by_1", + "typeString": "int_const 16777215" + }, + "value": "0xffffff" + }, + "src": "8114:18:22", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "expression": { + "id": 26003, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25982, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25858, + "src": "8262:4:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30786461", + "id": 25987, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8293:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_218_by_1", + "typeString": "int_const 218" + }, + "value": "0xda" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_218_by_1", + "typeString": "int_const 218" + } + ], + "id": 25986, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8286:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25985, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "8286:6:22", + "typeDescriptions": {} + } + }, + "id": 25988, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8286:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "hexValue": "30783934", + "id": 25991, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8307:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + }, + "value": "0x94" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + } + ], + "id": 25990, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8300:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25989, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "8300:6:22", + "typeDescriptions": {} + } + }, + "id": 25992, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8300:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "id": 25993, + "name": "_origin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25850, + "src": "8314:7:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "hexValue": "30783834", + "id": 25996, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8330:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_132_by_1", + "typeString": "int_const 132" + }, + "value": "0x84" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_132_by_1", + "typeString": "int_const 132" + } + ], + "id": 25995, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8323:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25994, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "8323:6:22", + "typeDescriptions": {} + } + }, + "id": 25997, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8323:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "id": 26000, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "8344:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 25999, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8337:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint32_$", + "typeString": "type(uint32)" + }, + "typeName": { + "id": 25998, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "8337:6:22", + "typeDescriptions": {} + } + }, + "id": 26001, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8337:14:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + ], + "expression": { + "id": 25983, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "8269:3:22", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 25984, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8273:12:22", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "8269:16:22", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 26002, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8269:83:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "8262:90:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 26004, + "nodeType": "ExpressionStatement", + "src": "8262:90:22" + }, + "id": 26005, + "nodeType": "IfStatement", + "src": "8111:241:22", + "trueBody": { + "expression": { + "id": 25980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25959, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25858, + "src": "8134:4:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30786439", + "id": 25964, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8165:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_217_by_1", + "typeString": "int_const 217" + }, + "value": "0xd9" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_217_by_1", + "typeString": "int_const 217" + } + ], + "id": 25963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8158:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25962, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "8158:6:22", + "typeDescriptions": {} + } + }, + "id": 25965, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8158:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "hexValue": "30783934", + "id": 25968, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8179:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + }, + "value": "0x94" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + } + ], + "id": 25967, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8172:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25966, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "8172:6:22", + "typeDescriptions": {} + } + }, + "id": 25969, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8172:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "id": 25970, + "name": "_origin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25850, + "src": "8186:7:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "hexValue": "30783833", + "id": 25973, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8202:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_131_by_1", + "typeString": "int_const 131" + }, + "value": "0x83" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_131_by_1", + "typeString": "int_const 131" + } + ], + "id": 25972, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8195:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25971, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "8195:6:22", + "typeDescriptions": {} + } + }, + "id": 25974, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8195:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "id": 25977, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "8216:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 25976, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8209:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint24_$", + "typeString": "type(uint24)" + }, + "typeName": { + "id": 25975, + "name": "uint24", + "nodeType": "ElementaryTypeName", + "src": "8209:6:22", + "typeDescriptions": {} + } + }, + "id": 25978, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8209:14:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + ], + "expression": { + "id": 25960, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "8141:3:22", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 25961, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8145:12:22", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "8141:16:22", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 25979, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8141:83:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "8134:90:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 25981, + "nodeType": "ExpressionStatement", + "src": "8134:90:22" + } + }, + "id": 26006, + "nodeType": "IfStatement", + "src": "7983:369:22", + "trueBody": { + "expression": { + "id": 25954, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25933, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25858, + "src": "8006:4:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30786438", + "id": 25938, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8037:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_216_by_1", + "typeString": "int_const 216" + }, + "value": "0xd8" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_216_by_1", + "typeString": "int_const 216" + } + ], + "id": 25937, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8030:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25936, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "8030:6:22", + "typeDescriptions": {} + } + }, + "id": 25939, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8030:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "hexValue": "30783934", + "id": 25942, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8051:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + }, + "value": "0x94" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + } + ], + "id": 25941, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8044:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25940, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "8044:6:22", + "typeDescriptions": {} + } + }, + "id": 25943, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8044:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "id": 25944, + "name": "_origin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25850, + "src": "8058:7:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "hexValue": "30783832", + "id": 25947, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8074:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_130_by_1", + "typeString": "int_const 130" + }, + "value": "0x82" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_130_by_1", + "typeString": "int_const 130" + } + ], + "id": 25946, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8067:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25945, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "8067:6:22", + "typeDescriptions": {} + } + }, + "id": 25948, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8067:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "id": 25951, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "8088:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 25950, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "8081:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint16_$", + "typeString": "type(uint16)" + }, + "typeName": { + "id": 25949, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "8081:6:22", + "typeDescriptions": {} + } + }, + "id": 25952, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8081:14:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + ], + "expression": { + "id": 25934, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "8013:3:22", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 25935, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "8017:12:22", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "8013:16:22", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 25953, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8013:83:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "8006:90:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 25955, + "nodeType": "ExpressionStatement", + "src": "8006:90:22" + } + }, + "id": 26007, + "nodeType": "IfStatement", + "src": "7856:496:22", + "trueBody": { + "expression": { + "id": 25928, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25907, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25858, + "src": "7879:4:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30786437", + "id": 25912, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7910:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_215_by_1", + "typeString": "int_const 215" + }, + "value": "0xd7" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_215_by_1", + "typeString": "int_const 215" + } + ], + "id": 25911, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7903:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25910, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "7903:6:22", + "typeDescriptions": {} + } + }, + "id": 25913, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7903:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "hexValue": "30783934", + "id": 25916, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7924:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + }, + "value": "0x94" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + } + ], + "id": 25915, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7917:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25914, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "7917:6:22", + "typeDescriptions": {} + } + }, + "id": 25917, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7917:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "id": 25918, + "name": "_origin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25850, + "src": "7931:7:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "hexValue": "30783831", + "id": 25921, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7947:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_129_by_1", + "typeString": "int_const 129" + }, + "value": "0x81" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_129_by_1", + "typeString": "int_const 129" + } + ], + "id": 25920, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7940:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25919, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "7940:6:22", + "typeDescriptions": {} + } + }, + "id": 25922, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7940:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "id": 25925, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "7960:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 25924, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7954:5:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 25923, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "7954:5:22", + "typeDescriptions": {} + } + }, + "id": 25926, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7954:13:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "expression": { + "id": 25908, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "7886:3:22", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 25909, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7890:12:22", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "7886:16:22", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 25927, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7886:82:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "7879:89:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 25929, + "nodeType": "ExpressionStatement", + "src": "7879:89:22" + } + }, + "id": 26008, + "nodeType": "IfStatement", + "src": "7743:609:22", + "trueBody": { + "expression": { + "id": 25902, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25885, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25858, + "src": "7766:4:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30786436", + "id": 25890, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7797:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_214_by_1", + "typeString": "int_const 214" + }, + "value": "0xd6" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_214_by_1", + "typeString": "int_const 214" + } + ], + "id": 25889, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7790:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25888, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "7790:6:22", + "typeDescriptions": {} + } + }, + "id": 25891, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7790:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "hexValue": "30783934", + "id": 25894, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7811:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + }, + "value": "0x94" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + } + ], + "id": 25893, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7804:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25892, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "7804:6:22", + "typeDescriptions": {} + } + }, + "id": 25895, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7804:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "id": 25896, + "name": "_origin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25850, + "src": "7818:7:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "id": 25899, + "name": "_nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25852, + "src": "7833:6:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 25898, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7827:5:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 25897, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "7827:5:22", + "typeDescriptions": {} + } + }, + "id": 25900, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7827:13:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "expression": { + "id": 25886, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "7773:3:22", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 25887, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7777:12:22", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "7773:16:22", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 25901, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7773:68:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "7766:75:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 25903, + "nodeType": "ExpressionStatement", + "src": "7766:75:22" + } + }, + "id": 26009, + "nodeType": "IfStatement", + "src": "7626:726:22", + "trueBody": { + "expression": { + "id": 25880, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25863, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25858, + "src": "7654:4:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "30786436", + "id": 25868, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7685:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_214_by_1", + "typeString": "int_const 214" + }, + "value": "0xd6" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_214_by_1", + "typeString": "int_const 214" + } + ], + "id": 25867, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7678:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25866, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "7678:6:22", + "typeDescriptions": {} + } + }, + "id": 25869, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7678:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "arguments": [ + { + "hexValue": "30783934", + "id": 25872, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7699:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + }, + "value": "0x94" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_148_by_1", + "typeString": "int_const 148" + } + ], + "id": 25871, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7692:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25870, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "7692:6:22", + "typeDescriptions": {} + } + }, + "id": 25873, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7692:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + }, + { + "id": 25874, + "name": "_origin", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25850, + "src": "7706:7:22", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "arguments": [ + { + "hexValue": "30783830", + "id": 25877, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7722:4:22", + "typeDescriptions": { + "typeIdentifier": "t_rational_128_by_1", + "typeString": "int_const 128" + }, + "value": "0x80" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_128_by_1", + "typeString": "int_const 128" + } + ], + "id": 25876, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7715:6:22", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes1_$", + "typeString": "type(bytes1)" + }, + "typeName": { + "id": 25875, + "name": "bytes1", + "nodeType": "ElementaryTypeName", + "src": "7715:6:22", + "typeDescriptions": {} + } + }, + "id": 25878, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7715:12:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_bytes1", + "typeString": "bytes1" + } + ], + "expression": { + "id": 25864, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "7661:3:22", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 25865, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "7665:12:22", + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "src": "7661:16:22", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 25879, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "7661:67:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "src": "7654:74:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 25881, + "nodeType": "ExpressionStatement", + "src": "7654:74:22" + } + }, + { + "assignments": [26011], + "declarations": [ + { + "constant": false, + "id": 26011, + "mutability": "mutable", + "name": "hash", + "nameLocation": "8370:4:22", + "nodeType": "VariableDeclaration", + "scope": 26017, + "src": "8362:12:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 26010, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "8362:7:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 26015, + "initialValue": { + "arguments": [ + { + "id": 26013, + "name": "data", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25858, + "src": "8387:4:22", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 26012, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -8, + "src": "8377:9:22", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 26014, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "8377:15:22", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8362:30:22" + }, + { + "AST": { + "nodeType": "YulBlock", + "src": "8411:72:22", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "8432:1:22", + "type": "", + "value": "0" + }, + { + "name": "hash", + "nodeType": "YulIdentifier", + "src": "8435:4:22" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "8425:6:22" + }, + "nodeType": "YulFunctionCall", + "src": "8425:15:22" + }, + "nodeType": "YulExpressionStatement", + "src": "8425:15:22" + }, + { + "nodeType": "YulAssignment", + "src": "8453:20:22", + "value": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "8471:1:22", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mload", + "nodeType": "YulIdentifier", + "src": "8465:5:22" + }, + "nodeType": "YulFunctionCall", + "src": "8465:8:22" + }, + "variableNames": [ + { + "name": "_address", + "nodeType": "YulIdentifier", + "src": "8453:8:22" + } + ] + } + ] + }, + "evmVersion": "paris", + "externalReferences": [ + { + "declaration": 25855, + "isOffset": false, + "isSlot": false, + "src": "8453:8:22", + "valueSize": 1 + }, + { + "declaration": 26011, + "isOffset": false, + "isSlot": false, + "src": "8435:4:22", + "valueSize": 1 + } + ], + "id": 26016, + "nodeType": "InlineAssembly", + "src": "8402:81:22" + } + ] + }, + "documentation": { + "id": 25848, + "nodeType": "StructuredDocumentation", + "src": "7018:473:22", + "text": " @notice Compute the address of a contract deployed using create1, by an address at a given nonce\n @param _origin The address of the deployer\n @param _nonce The nonce used to deploy the contract\n @dev Taken from https://ethereum.stackexchange.com/a/87840/68134 - this wouldn't work for nonce > 2**32,\n if someone do reach that nonce please: 1) ping us, because wow 2) use another deployer" + }, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "_addressFrom", + "nameLocation": "7505:12:22", + "parameters": { + "id": 25853, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 25850, + "mutability": "mutable", + "name": "_origin", + "nameLocation": "7526:7:22", + "nodeType": "VariableDeclaration", + "scope": 26018, + "src": "7518:15:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 25849, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7518:7:22", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 25852, + "mutability": "mutable", + "name": "_nonce", + "nameLocation": "7540:6:22", + "nodeType": "VariableDeclaration", + "scope": 26018, + "src": "7535:11:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 25851, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7535:4:22", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "7517:30:22" + }, + "returnParameters": { + "id": 25856, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 25855, + "mutability": "mutable", + "name": "_address", + "nameLocation": "7579:8:22", + "nodeType": "VariableDeclaration", + "scope": 26018, + "src": "7571:16:22", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 25854, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "7571:7:22", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "7570:18:22" + }, + "scope": 26019, + "stateMutability": "pure", + "virtual": false, + "visibility": "internal" } ], "abstract": false, - "baseContracts": [], - "canonicalName": "IJBDelegatesRegistry", + "baseContracts": [ + { + "baseName": { + "id": 25692, + "name": "IJBDelegatesRegistry", + "nameLocations": ["620:20:22"], + "nodeType": "IdentifierPath", + "referencedDeclaration": 26045, + "src": "620:20:22" + }, + "id": 25693, + "nodeType": "InheritanceSpecifier", + "src": "620:20:22" + } + ], + "canonicalName": "JBDelegatesRegistry", "contractDependencies": [], - "contractKind": "interface", - "fullyImplemented": false, - "linearizedBaseContracts": [26171], - "name": "IJBDelegatesRegistry", - "nameLocation": "67:20:24", - "scope": 26172, - "usedErrors": [] + "contractKind": "contract", + "documentation": { + "id": 25691, + "nodeType": "StructuredDocumentation", + "src": "137:450:22", + "text": " @title JBDelegatesRegistry\n @notice This contract is used to register deployers of Juicebox Delegates\n It is the deployer responsability to register their\n delegates in this registry and make sure the delegate implements IERC165\n @dev Mostly for front-end integration purposes. The delegate address is computed\n from the deployer address and the nonce used to deploy the delegate.\n " + }, + "fullyImplemented": true, + "linearizedBaseContracts": [26019, 26045], + "name": "JBDelegatesRegistry", + "nameLocation": "597:19:22", + "scope": 26020, + "usedErrors": [25696], + "usedEvents": [25703] } ], "license": "MIT" }, - "id": 24 + "id": 22 } diff --git a/src/pages/api/juicebox/jb-721-delegate/[dataSourceAddress].ts b/src/pages/api/juicebox/jb-721-delegate/[dataSourceAddress].ts index 874acd5f53..cfe5efd72f 100644 --- a/src/pages/api/juicebox/jb-721-delegate/[dataSourceAddress].ts +++ b/src/pages/api/juicebox/jb-721-delegate/[dataSourceAddress].ts @@ -1,4 +1,5 @@ import { readNetwork } from 'constants/networks' +import { IJB721TieredDelegate_V3_INTERFACE_ID } from 'constants/nftRewards' import { readProvider } from 'constants/readProvider' import { Contract } from 'ethers' import { ForgeDeploy, addressFor } from 'forge-run-parser' @@ -10,8 +11,6 @@ import { NextApiRequest, NextApiResponse } from 'next' import { isEqualAddress, isZeroAddress } from 'utils/address' import JBDelegatesRegistryJson from './IJBDelegatesRegistry.json' -const IJB721TieredDelegate_V3_INTERFACE_ID = '0xf34282c8' - const logger = getLogger('api/juicebox/jb-721-delegate/[dataSourceAddress]') async function loadJBDelegatesRegistryDeployments() { @@ -39,11 +38,20 @@ async function fetchDeployerOf(dataSourceAddress: string) { readProvider, ) - const deployerAddress = await JBDelegatesRegistry.deployerOf( - dataSourceAddress, + // theres 2 registries, so need to check if the dataSourceAddress might be in the old one + const oldRegistry = await JBDelegatesRegistry.oldRegistry() + const OldJBDelegatesRegistry = new Contract( + oldRegistry, + JBDelegatesRegistryJson.abi, + readProvider, ) - return deployerAddress + const [deployerAddress, deployerAddressOldRegistry] = await Promise.all([ + JBDelegatesRegistry.deployerOf(dataSourceAddress), + OldJBDelegatesRegistry.deployerOf(dataSourceAddress), + ]) + + return deployerAddress || deployerAddressOldRegistry } async function isJB721DelegateV3(dataSourceAddress: string) { @@ -92,7 +100,7 @@ async function isJB721DelegateV3_2(deployerAddress: string) { } async function isJB721DelegateV3_3(deployerAddress: string) { - const deployerV3_2Address = await loadJB721DelegateAddress( + const deployerV3_3Address = await loadJB721DelegateAddress( 'JBTiered721DelegateDeployer', JB721DelegateVersion.JB721DELEGATE_V3_3, ) @@ -100,7 +108,20 @@ async function isJB721DelegateV3_3(deployerAddress: string) { return ( Boolean(deployerAddress) && !isZeroAddress(deployerAddress) && - isEqualAddress(deployerV3_2Address, deployerAddress) + isEqualAddress(deployerV3_3Address, deployerAddress) + ) +} + +async function isJB721DelegateV3_4(deployerAddress: string) { + const deployerV3_4Address = await loadJB721DelegateAddress( + 'JBTiered721DelegateDeployer', + JB721DelegateVersion.JB721DELEGATE_V3_4, + ) + + return ( + Boolean(deployerAddress) && + !isZeroAddress(deployerAddress) && + isEqualAddress(deployerV3_4Address, deployerAddress) ) } @@ -109,14 +130,18 @@ async function fetchJB721DelegateVersion(dataSourceAddress: string) { if (isV3) return JB721DelegateVersion.JB721DELEGATE_V3 const deployerAddress = await fetchDeployerOf(dataSourceAddress) - const [isV3_1, isV3_2, isV3_3] = await Promise.all([ + const [isV3_1, isV3_2, isV3_3, isV3_4] = await Promise.all([ isJB721DelegateV3_1(deployerAddress), isJB721DelegateV3_2(deployerAddress), isJB721DelegateV3_3(deployerAddress), + isJB721DelegateV3_4(deployerAddress), ]) if (isV3_1) return JB721DelegateVersion.JB721DELEGATE_V3_1 if (isV3_2) return JB721DelegateVersion.JB721DELEGATE_V3_2 if (isV3_3) return JB721DelegateVersion.JB721DELEGATE_V3_3 + if (isV3_4) return JB721DelegateVersion.JB721DELEGATE_V3_4 + + return null } const handler = async (req: NextApiRequest, res: NextApiResponse) => { diff --git a/src/pages/contact/index.tsx b/src/pages/contact/index.tsx index ea273d80ec..3c3abdc96f 100644 --- a/src/pages/contact/index.tsx +++ b/src/pages/contact/index.tsx @@ -1,6 +1,7 @@ import { Contact } from 'components/Contact' import { Footer } from 'components/Footer' import { AppWrapper, Head } from 'components/common' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function ContactPage() { return ( @@ -18,3 +19,5 @@ export default function ContactPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index 8909587c19..bcec01e98a 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -6,6 +6,7 @@ import { V2V3ContractsProvider } from 'contexts/v2v3/Contracts/V2V3ContractsProv import { V2V3CurrencyProvider } from 'contexts/v2v3/V2V3CurrencyProvider' import { Provider } from 'react-redux' import store from 'redux/store' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function V2CreatePage() { return ( @@ -31,3 +32,5 @@ export default function V2CreatePage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/experimental/color/index.tsx b/src/pages/experimental/color/index.tsx deleted file mode 100644 index 2335823e11..0000000000 --- a/src/pages/experimental/color/index.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { ThemeConfig } from 'tailwindcss/types/config.js' -import * as a from '../../../../tailwind.config.js' - -export default function Colors() { - if (!a.theme) return null - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const swatch = themeToSwatch(a.theme as any) - - return ( -
- {swatch.map(gradient => ( - - ))} -
- ) -} - -const ColorGradient = ({ gradient }: { gradient: Gradient }) => { - if (gradient.colors.length === 0) return null - return ( - <> -
-

{gradient.name}

-
-
- {gradient.colors.map(({ name, color }) => ( - - ))} -
- - ) -} - -const ColorSquare = ({ name, color }: Color) => { - return ( -
-
-
-
{name}
-
{color}
-
-
- ) -} - -function themeToSwatch(theme: ThemeConfig): Swatch { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const colors = theme?.colors as Record - const swatch: Swatch = Object.entries(colors) - .map(([color, keys]) => { - if (color === 'extend') return null - return { - name: color, - colors: Object.entries(keys).map(([key, value]) => ({ - name: key, - color: value, - })), - } - }) - .filter(Boolean) as Swatch - return swatch -} - -type Swatch = Gradient[] -type Gradient = { name: string; colors: Color[] } -type Color = { name: string; color: string } diff --git a/src/pages/experimental/flags/index.tsx b/src/pages/experimental/flags/index.tsx index 9c3ef53cc0..e705e5f42f 100644 --- a/src/pages/experimental/flags/index.tsx +++ b/src/pages/experimental/flags/index.tsx @@ -5,6 +5,7 @@ import { readNetwork } from 'constants/networks' import Head from 'next/head' import { useCallback, useState } from 'react' import { featureFlagEnabled, setFeatureFlag } from 'utils/featureFlags' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function FlagsPage() { const [, updateState] = useState({}) @@ -49,3 +50,5 @@ export default function FlagsPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/index.tsx b/src/pages/index.tsx index ab7e4bc2ab..95c09e3c90 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,6 +1,7 @@ import { AppWrapper } from 'components/common' import { HomePage } from 'components/Home' import { AnnouncementsProvider } from 'contexts/Announcements/AnnouncementsProvider' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function LandingPage() { return ( @@ -11,3 +12,5 @@ export default function LandingPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/legal/index.tsx b/src/pages/legal/index.tsx index 6dad968fc5..c5ba3dbc8c 100644 --- a/src/pages/legal/index.tsx +++ b/src/pages/legal/index.tsx @@ -1,6 +1,7 @@ import { Footer } from 'components/Footer/Footer' import { Legal } from 'components/Legal' import { AppWrapper, Head } from 'components/common' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function LegalPage() { return ( @@ -17,3 +18,5 @@ export default function LegalPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/p/[handle]/index.tsx b/src/pages/p/[handle]/index.tsx index 070883b16c..c3c50dcf56 100644 --- a/src/pages/p/[handle]/index.tsx +++ b/src/pages/p/[handle]/index.tsx @@ -8,6 +8,7 @@ import { V1ProjectProvider } from 'contexts/v1/Project/V1ProjectProvider' import { V1UserProvider } from 'contexts/v1/User/V1UserProvider' import { V1CurrencyProvider } from 'contexts/v1/V1CurrencyProvider' import { V1ProjectMetadataProvider } from 'contexts/v1/V1ProjectMetadataProvider' +import { loadCatalog } from 'locales/utils' import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next' import { useRouter } from 'next/router' import { useContext } from 'react' @@ -25,7 +26,20 @@ export const getStaticPaths: GetStaticPaths = async context => { } export const getStaticProps: GetStaticProps = async context => { - return getV1StaticProps(context) + const locale = context.locale as string + const messages = await loadCatalog(locale) + const i18n = { locale, messages } + + const v1Props = await getV1StaticProps(context) + + return { + ...v1Props, + props: { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ...(v1Props as any).props, + i18n, + }, + } } export default function V1HandlePage({ diff --git a/src/pages/p/[handle]/safe/index.tsx b/src/pages/p/[handle]/safe/index.tsx index a82e4a734a..330ba3ab1d 100644 --- a/src/pages/p/[handle]/safe/index.tsx +++ b/src/pages/p/[handle]/safe/index.tsx @@ -1,11 +1,12 @@ -import { AppWrapper } from 'components/common' import { ProjectSafeDashboard } from 'components/ProjectSafeDashboard' +import { AppWrapper } from 'components/common' import { V1ProjectContext } from 'contexts/v1/Project/V1ProjectContext' -import { useRouter } from 'next/router' +import { V1ProjectProvider } from 'contexts/v1/Project/V1ProjectProvider' import { V1UserProvider } from 'contexts/v1/User/V1UserProvider' import { V1ProjectMetadataProvider } from 'contexts/v1/V1ProjectMetadataProvider' -import { V1ProjectProvider } from 'contexts/v1/Project/V1ProjectProvider' +import { useRouter } from 'next/router' import { useContext } from 'react' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' function V1ProjectSafeDashboard({ handle }: { handle: string }) { const { owner } = useContext(V1ProjectContext) @@ -36,3 +37,5 @@ export default function V1ProjectSafeDashboardPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/privacy.tsx b/src/pages/privacy.tsx index 0f1a1d10f2..78b440d479 100644 --- a/src/pages/privacy.tsx +++ b/src/pages/privacy.tsx @@ -1,6 +1,7 @@ import { AppWrapper } from 'components/common' import ExternalLink from 'components/ExternalLink' import Link from 'next/link' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function PrivacyPolicyPage() { return ( @@ -73,3 +74,5 @@ function PrivacyPolicy() {
) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/projects/index.tsx b/src/pages/projects/index.tsx index d6045da579..8b92e4ef9b 100644 --- a/src/pages/projects/index.tsx +++ b/src/pages/projects/index.tsx @@ -1,5 +1,6 @@ import { ProjectsView } from 'components/Projects/ProjectsView' import { AppWrapper } from 'components/common' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function ProjectsPage() { return ( @@ -8,3 +9,5 @@ export default function ProjectsPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/success-stories/constitutiondao.tsx b/src/pages/success-stories/constitutiondao.tsx index 577c457f24..f532a4965f 100644 --- a/src/pages/success-stories/constitutiondao.tsx +++ b/src/pages/success-stories/constitutiondao.tsx @@ -10,6 +10,7 @@ import { CONSTITUTION_FUNDING_CONFIG, } from 'constants/successStoryProjects' import Image from 'next/image' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function ConstitutionDAOPage() { const constitutionSuccessStoryProject = CASE_STUDY_PROJECTS[0] @@ -106,3 +107,5 @@ export default function ConstitutionDAOPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/success-stories/moondao.tsx b/src/pages/success-stories/moondao.tsx index d73ec42021..28da591597 100644 --- a/src/pages/success-stories/moondao.tsx +++ b/src/pages/success-stories/moondao.tsx @@ -10,6 +10,7 @@ import { MOONDAO_FUNDING_CONFIG, } from 'constants/successStoryProjects' import Image from 'next/image' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function MoonDAOPage() { const moonDAOSuccessStoryProject = CASE_STUDY_PROJECTS[1] @@ -114,3 +115,5 @@ export default function MoonDAOPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/success-stories/sharkdao.tsx b/src/pages/success-stories/sharkdao.tsx index eb56035b5b..dce2d635cd 100644 --- a/src/pages/success-stories/sharkdao.tsx +++ b/src/pages/success-stories/sharkdao.tsx @@ -10,6 +10,7 @@ import { SHARKDAO_FUNDING_CONFIG, } from 'constants/successStoryProjects' import Image from 'next/image' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function SharkDAOPage() { const sharkDAOSuccessStoryProject = CASE_STUDY_PROJECTS[2] @@ -133,3 +134,5 @@ export default function SharkDAOPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/success-stories/studiodao.tsx b/src/pages/success-stories/studiodao.tsx index 367826567a..396ae006d8 100644 --- a/src/pages/success-stories/studiodao.tsx +++ b/src/pages/success-stories/studiodao.tsx @@ -10,6 +10,7 @@ import { STUDIODAO_FUNDING_CONFIG, } from 'constants/successStoryProjects' import Image from 'next/image' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function StudioDAOPage() { const studioDAOSuccessStoryProject = CASE_STUDY_PROJECTS[3] @@ -117,3 +118,5 @@ export default function StudioDAOPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/v2/p/[projectId]/contracts/index.tsx b/src/pages/v2/p/[projectId]/contracts/index.tsx index 05ce812863..bc98e38a4a 100644 --- a/src/pages/v2/p/[projectId]/contracts/index.tsx +++ b/src/pages/v2/p/[projectId]/contracts/index.tsx @@ -3,6 +3,7 @@ import { V2V3ProjectContractsDashboard } from 'components/v2v3/V2V3Project/V2V3P import { TransactionProvider } from 'contexts/Transaction/TransactionProvider' import { V2V3ProjectPageProvider } from 'contexts/v2v3/V2V3ProjectPageProvider' import { useRouter } from 'next/router' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function V2V3ProjectContractsPage() { const router = useRouter() @@ -22,3 +23,5 @@ export default function V2V3ProjectContractsPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/v2/p/[projectId]/index.tsx b/src/pages/v2/p/[projectId]/index.tsx index 1ab2a1baba..aef545be06 100644 --- a/src/pages/v2/p/[projectId]/index.tsx +++ b/src/pages/v2/p/[projectId]/index.tsx @@ -6,9 +6,10 @@ import { PV_V2 } from 'constants/pv' import { AnnouncementsProvider } from 'contexts/Announcements/AnnouncementsProvider' import { V2V3ProjectPageProvider } from 'contexts/v2v3/V2V3ProjectPageProvider' import { paginateDepleteProjectsQueryCall } from 'lib/apollo/paginateDepleteProjectsQuery' +import { loadCatalog } from 'locales/utils' import { ProjectMetadata } from 'models/projectMetadata' import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next' -import { Suspense, lazy } from 'react' +import React, { PropsWithChildren, Suspense, lazy } from 'react' import { featureFlagEnabled } from 'utils/featureFlags' import { cidFromUrl, ipfsPublicGatewayUrl } from 'utils/ipfs' import { @@ -37,12 +38,18 @@ export const getStaticPaths: GetStaticPaths = async () => { } export const getStaticProps: GetStaticProps< - ProjectPageProps + ProjectPageProps & { i18n: unknown } > = async context => { + const locale = context.locale as string + const messages = await loadCatalog(locale) + const i18n = { locale, messages } + if (!context.params) throw new Error('params not supplied') const projectId = parseInt(context.params.projectId as string) - const props = await getProjectStaticProps(projectId) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const props = (await getProjectStaticProps(projectId)) as any + props.props.i18n = i18n return { ...props, @@ -86,19 +93,34 @@ export default function V2ProjectPage({ <> - - - - {newProjectPageEnabled ? ( - }> - - - ) : ( - - )} - - - + <_Wrapper> + + + + {newProjectPageEnabled ? ( + }> + + + ) : ( + + )} + + + + ) } + +// This is a hack to avoid SSR for now. At the moment when this is not applied to this page, you will see a rehydration error. +const _Wrapper: React.FC = ({ children }) => { + const [hasMounted, setHasMounted] = React.useState(false) + React.useEffect(() => { + setHasMounted(true) + }, []) + if (!hasMounted) { + return null + } + + return <>{children} +} diff --git a/src/pages/v2/p/[projectId]/safe/index.tsx b/src/pages/v2/p/[projectId]/safe/index.tsx index 58a2d02890..7475419b8e 100644 --- a/src/pages/v2/p/[projectId]/safe/index.tsx +++ b/src/pages/v2/p/[projectId]/safe/index.tsx @@ -1,11 +1,12 @@ -import { AppWrapper } from 'components/common' import { ProjectSafeDashboard } from 'components/ProjectSafeDashboard' +import { AppWrapper } from 'components/common' +import { TransactionProvider } from 'contexts/Transaction/TransactionProvider' import { ProjectMetadataContext } from 'contexts/shared/ProjectMetadataContext' import { V2V3ProjectContext } from 'contexts/v2v3/Project/V2V3ProjectContext' -import { useRouter } from 'next/router' -import { TransactionProvider } from 'contexts/Transaction/TransactionProvider' import { V2V3ProjectPageProvider } from 'contexts/v2v3/V2V3ProjectPageProvider' +import { useRouter } from 'next/router' import { useContext } from 'react' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' import { v2v3ProjectRoute } from 'utils/routes' function V2V3ProjectSafeDashboard() { @@ -38,3 +39,5 @@ export default function V2V3ProjectSafeDashboardPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/v2/p/[projectId]/settings/[settingsPage].tsx b/src/pages/v2/p/[projectId]/settings/[settingsPage].tsx index af82d5f542..d2e4f4af51 100644 --- a/src/pages/v2/p/[projectId]/settings/[settingsPage].tsx +++ b/src/pages/v2/p/[projectId]/settings/[settingsPage].tsx @@ -2,6 +2,7 @@ import { ProjectSettingsContent } from 'components/v2v3/V2V3Project/V2V3ProjectS import { V2V3SettingsPageKey } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/ProjectSettingsDashboard' import { V2V3SettingsProvider } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/V2V3SettingsProvider' import { useRouter } from 'next/router' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function V2V3CycleSettingsPage() { const router = useRouter() @@ -17,3 +18,5 @@ export default function V2V3CycleSettingsPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/pages/v2/p/[projectId]/settings/index.tsx b/src/pages/v2/p/[projectId]/settings/index.tsx index d03dd0a5e2..89d29798ef 100644 --- a/src/pages/v2/p/[projectId]/settings/index.tsx +++ b/src/pages/v2/p/[projectId]/settings/index.tsx @@ -1,5 +1,6 @@ import { ProjectSettingsDashboard } from 'components/v2v3/V2V3Project/V2V3ProjectSettings' import { V2V3SettingsProvider } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/V2V3SettingsProvider' +import globalGetServerSideProps from 'utils/next-server/globalGetServerSideProps' export default function V2V3ProjectSettingsPage() { return ( @@ -8,3 +9,5 @@ export default function V2V3ProjectSettingsPage() { ) } + +export const getServerSideProps = globalGetServerSideProps diff --git a/src/types/environment.d.ts b/src/types/environment.d.ts index d3de2da739..60a803891e 100644 --- a/src/types/environment.d.ts +++ b/src/types/environment.d.ts @@ -19,7 +19,7 @@ declare global { // Ask in Discord for the goerli subgraph url // for both SCHEMA and SUBGRAPH_URL NEXT_PUBLIC_SUBGRAPH_URL: string - GRAPHQL_SCHEMA_SUBGRAPH_URL: string + SUBGRAPH_URL: string NEXT_PUBLIC_BASE_URL: PublicBaseURLS diff --git a/src/utils/encodeJb721DelegateMetadata/encodeJb721DelegateMetadata.ts b/src/utils/encodeJb721DelegateMetadata/encodeJb721DelegateMetadata.ts index d9f82afa46..c779ffb46c 100644 --- a/src/utils/encodeJb721DelegateMetadata/encodeJb721DelegateMetadata.ts +++ b/src/utils/encodeJb721DelegateMetadata/encodeJb721DelegateMetadata.ts @@ -1,9 +1,13 @@ import { + IJB721Delegate_V3_2_INTERFACE_ID, IJB721Delegate_V3_INTERFACE_ID, IJBTiered721Delegate_V3_2_INTERFACE_ID, + IJBTiered721Delegate_V3_4_PAY_ID, + IJBTiered721Delegate_V3_4_REDEEM_ID, } from 'constants/nftRewards' import { DEFAULT_ALLOW_OVERSPENDING } from 'constants/transactionDefaults' import { constants, utils } from 'ethers' +import { createMetadata } from 'juicebox-metadata-helper' import { JB721DelegateVersion } from 'models/v2v3/contracts' export interface JB721DELAGATE_V3_PAY_METADATA { @@ -44,6 +48,10 @@ export function encodeJb721DelegateMetadata( return encodeJB721DelegateV3_2PayMetadata( metadata as JB721DELAGATE_V3_2_PAY_METADATA, ) + case JB721DelegateVersion.JB721DELEGATE_V3_4: + return encodeJB721DelegateV3_4PayMetadata( + metadata as JB721DELAGATE_V3_2_PAY_METADATA, + ) default: throw new Error(`Invalid delegate version: ${version}`) } @@ -113,3 +121,66 @@ function encodeJB721DelegateV3_2PayMetadata( return encoded } + +function encodeJB721DelegateV3_4PayMetadata( + metadata: JB721DELAGATE_V3_2_PAY_METADATA | undefined, +) { + if (!metadata) return undefined + + const args = [ + metadata.allowOverspending ?? DEFAULT_ALLOW_OVERSPENDING, + metadata.tierIdsToMint, + ] + + const encoded = utils.defaultAbiCoder.encode(['bool', 'uint16[]'], args) + const result = createMetadata([IJBTiered721Delegate_V3_4_PAY_ID], [encoded]) + + return result +} + +export function encodeJB721DelegateV3RedeemMetadata( + tokenIdsToRedeem: string[], +) { + const args = [ + constants.HashZero, + IJB721Delegate_V3_INTERFACE_ID, + tokenIdsToRedeem, + ] + + const encoded = utils.defaultAbiCoder.encode( + ['bytes32', 'bytes4', 'uint256[]'], + args, + ) + + return encoded +} + +export function encodeJB721DelegateV3_2RedeemMetadata( + tokenIdsToRedeem: string[], +) { + const args = [ + constants.HashZero, + IJB721Delegate_V3_2_INTERFACE_ID, + tokenIdsToRedeem, + ] + + const encoded = utils.defaultAbiCoder.encode( + ['bytes32', 'bytes4', 'uint256[]'], + args, + ) + + return encoded +} + +export function encodeJB721DelegateV3_4RedeemMetadata( + tokenIdsToRedeem: string[], +) { + const args = [tokenIdsToRedeem] + const encoded = utils.defaultAbiCoder.encode(['uint256[]'], args) + const result = createMetadata( + [IJBTiered721Delegate_V3_4_REDEEM_ID], + [encoded], + ) + + return result +} diff --git a/src/utils/next-server/globalGetServerSideProps.ts b/src/utils/next-server/globalGetServerSideProps.ts new file mode 100644 index 0000000000..4824abe8c4 --- /dev/null +++ b/src/utils/next-server/globalGetServerSideProps.ts @@ -0,0 +1,23 @@ +import { loadCatalog } from 'locales/utils' +import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next' + +/** + * `getServerSideProps` for all pages. + * + * This is a global getServerSideProps that is used for all pages. It is used + * to load the i18n catalog for the page. + * + * @param ctx + * @returns + */ +export default async function globalGetServerSideProps( + ctx: GetServerSidePropsContext, +): Promise> { + const locale = ctx.locale as string + const messages = await loadCatalog(locale) + return { + props: { + i18n: { messages, locale }, + }, + } +} diff --git a/src/utils/nftRewards.ts b/src/utils/nftRewards.ts index 5eee05aecf..67ee9ce755 100644 --- a/src/utils/nftRewards.ts +++ b/src/utils/nftRewards.ts @@ -325,18 +325,15 @@ export function buildJB721TierParams({ | JB_721_TIER_PARAMS_V3_1 | JB_721_TIER_PARAMS_V3_2 => { const rewardTier = sortedRewardTiers[index] + if (version === JB721DelegateVersion.JB721DELEGATE_V3) { + return nftRewardTierToJB721TierParamsV3(rewardTier, cid) + } if (version === JB721DelegateVersion.JB721DELEGATE_V3_1) { return nftRewardTierToJB721TierParamsV3_1(rewardTier, cid) } - if ( - version === JB721DelegateVersion.JB721DELEGATE_V3_2 || - version === JB721DelegateVersion.JB721DELEGATE_V3_3 - ) { - return nftRewardTierToJB721TierParamsV3_2(rewardTier, cid) - } - // default return v1 params - return nftRewardTierToJB721TierParamsV3(rewardTier, cid) + // default return v3.2 params (unchanged in 3.3, 3.4) + return nftRewardTierToJB721TierParamsV3_2(rewardTier, cid) }, ) .slice() // clone object @@ -346,7 +343,8 @@ export function buildJB721TierParams({ // bit bongy, sorry! if ( version === JB721DelegateVersion.JB721DELEGATE_V3_2 || - version === JB721DelegateVersion.JB721DELEGATE_V3_3 + version === JB721DelegateVersion.JB721DELEGATE_V3_3 || + version === JB721DelegateVersion.JB721DELEGATE_V3_4 ) { if ( (a as JB_721_TIER_PARAMS_V3_2).price.gt( diff --git a/src/utils/projectPageLoaders.ts b/src/utils/projectPageLoaders.ts index 795b5f43bb..ed692770dd 100644 --- a/src/utils/projectPageLoaders.ts +++ b/src/utils/projectPageLoaders.ts @@ -48,7 +48,7 @@ export const getV1StaticProps: GetStaticProps< console.error( `Failed to load metadata uri for ${JSON.stringify(context.params)}`, ) - return { notFound: true } + return { notFound: true, props: undefined } } try { @@ -63,7 +63,7 @@ export const getV1StaticProps: GetStaticProps< // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { if (e?.response?.status === 404) { - return { notFound: true } + return { notFound: true, props: undefined } } throw e } diff --git a/yarn.lock b/yarn.lock index 6d0e924c8b..83870d05b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,11 @@ resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.2.0.tgz#e1a84fca468f4b337816fcb7f0964beb620ba855" integrity sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA== +"@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== + "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" @@ -1859,6 +1864,30 @@ debug "^3.1.0" lodash.once "^4.1.1" +"@dethcrypto/eth-sdk-client@^0.1.6": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@dethcrypto/eth-sdk-client/-/eth-sdk-client-0.1.6.tgz#900c0b541523a9c77db0ad9608e74480ef6b4913" + integrity sha512-Iv2xdcxernDINyLsuet9bfySXoFXhNGXmP9GEabpaFjK1AGUTVTurEEQObbu1RTIPNqx0+l2vu9fd14RLpCsqg== + +"@dethcrypto/eth-sdk@^0.3.4": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@dethcrypto/eth-sdk/-/eth-sdk-0.3.4.tgz#aebda60bb3b818cdcec15ae30a74fc8a6b89967f" + integrity sha512-LCHbb+S2+BQm8dxumeAQEk7s8spLwdkuBnXbATEgvxfdLd7kyvF+QF7GJqpToXwT2LLNg6Mb8fe6UrbpoL8LiQ== + dependencies: + "@typechain/ethers-v5" "^10.0.0" + chalk "^4.1.2" + commander "^8.3.0" + debug "^4.3.2" + fs-extra "^10.0.0" + glob "7.1.7" + got "^11.8.2" + lodash "^4.17.21" + mkdirp "^1.0.4" + ora "^5.4.1" + tmp-promise "^3.0.3" + typechain "8.0.0" + zod "^3.11.5" + "@discordjs/builders@^1.6.3": version "1.6.3" resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.6.3.tgz#994b4fe57e77b47096f74bb5a1f664870a930a43" @@ -3582,6 +3611,18 @@ "@paulrberg/contracts" "^3.7.0" prb-math "^2.4.3" +"@jbx-protocol/juice-721-delegate-v3-4@npm:@jbx-protocol/juice-721-delegate@8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@jbx-protocol/juice-721-delegate/-/juice-721-delegate-8.0.0.tgz#99a636424436c7443412bf1cf9a38b3ba39f0351" + integrity sha512-6w5SiZccGp1IyfZNrRuUm2Nika2bYc4H3LoHCE7sM27wZXhoJUGOzIUggYXwMMS6XF/82VfLi1lRqtyaSpXcTQ== + dependencies: + "@jbx-protocol/juice-contracts-v3" "^5.0.0" + "@jbx-protocol/juice-delegate-metadata-lib" "https://github.com/jbx-protocol/juice-delegate-metadata-lib.git" + "@jbx-protocol/juice-delegates-registry" "^1.0.3" + "@jbx-protocol/juice-ownable" "https://github.com/jbx-protocol/juice-ownable" + "@openzeppelin/contracts" "^4.9.2" + "@prb/math" "^4.0.1" + "@jbx-protocol/juice-721-delegate-v3@npm:@jbx-protocol/juice-721-delegate@3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@jbx-protocol/juice-721-delegate/-/juice-721-delegate-3.0.0.tgz#9a53e8fb6cbffba7889de7cc766791b124c0d2b4" @@ -3592,7 +3633,7 @@ "@paulrberg/contracts" "^3.7.0" prb-math "^2.4.3" -"@jbx-protocol/juice-contracts-v3@5.0.0": +"@jbx-protocol/juice-contracts-v3@5.0.0", "@jbx-protocol/juice-contracts-v3@^5.0.0": version "5.0.0" resolved "https://registry.yarnpkg.com/@jbx-protocol/juice-contracts-v3/-/juice-contracts-v3-5.0.0.tgz#019139c6c6a461e7b7093f58ae1c0ceb10220acd" integrity sha512-9flESdrOHDN9y/fiUyeJoh55DHlJHOlVpWhCsIPEamksoVtz6KOInJ727lp8YWAGJdH3U1sHisWSL30nwhIFOg== @@ -3606,10 +3647,17 @@ resolved "https://registry.yarnpkg.com/@jbx-protocol/juice-contracts-v3/-/juice-contracts-v3-2.0.5.tgz#b75e5547d3ffe660a3fb9124e5e747fc52b5d642" integrity sha512-pQSJbzz96nzHc2HDlN0Xx6uJufnRPAiUsilSwGRLjX38KZaeOtC7LU+YY0G5OHpH8tQPyAC/G/m5EwjpObIh3A== -"@jbx-protocol/juice-delegates-registry@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@jbx-protocol/juice-delegates-registry/-/juice-delegates-registry-1.0.0.tgz#d7c3a3e7744b49f1a3349c438ce76f3b1739713f" - integrity sha512-HslMIDivkn6Zx663DBwrQHR1SfAet5sM1lAznlMvuWF2i5dhulYBPdkrreT1G0xjLU8hUZjb8quoj6Cey9QzXQ== +"@jbx-protocol/juice-delegate-metadata-lib@https://github.com/jbx-protocol/juice-delegate-metadata-lib.git": + version "1.0.1" + resolved "https://github.com/jbx-protocol/juice-delegate-metadata-lib.git#da5a4b405dd77812ee819145a5c71885119339d3" + dependencies: + ds-test "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0" + forge-std "https://github.com/foundry-rs/forge-std.git#e8a047e3f40f13fa37af6fe14e6e06283d9a060e" + +"@jbx-protocol/juice-delegates-registry@1.0.3", "@jbx-protocol/juice-delegates-registry@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@jbx-protocol/juice-delegates-registry/-/juice-delegates-registry-1.0.3.tgz#9b8ff159b74ffc7f8c0272da690f0ca0ef46902a" + integrity sha512-jsvhhXKu7AF93Ji1JdOpM3kwp07uVT6IaSwR59NpdA1M9QcHkn0G4+MFuvsCZ4mUhKBn/8aR0z93eM3ouWQqCA== dependencies: "@jbx-protocol/juice-contracts-v3" "^2.0.3" "@openzeppelin/contracts" "^4.8.0" @@ -4184,6 +4232,46 @@ resolved "https://registry.yarnpkg.com/@lingui/babel-plugin-extract-messages/-/babel-plugin-extract-messages-4.1.2.tgz#68f52ff847e596e16acf089ff1d758928db28a6a" integrity sha512-FhdfV9XS3MUkQkmYK6SC4q6i2qQhk3HfVG5bhThukB8dHn6iK0sytBK9uL7BLsV4TJR6YKi3mDTO4MMWreYHHw== +"@lingui/babel-plugin-extract-messages@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@lingui/babel-plugin-extract-messages/-/babel-plugin-extract-messages-4.4.0.tgz#3f4e003fddc89d5a8071bfe2d15d18d1628e346a" + integrity sha512-0pu4bgQCGEa1e7a6qwB9pEEMpq8GzI4LW6V9YaraXUexusahJpnfKP81PIBsm8zj06OlYK5oI2AflkOmGMCiBA== + +"@lingui/cli@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@lingui/cli/-/cli-4.4.0.tgz#ef143e2de21916a8f4c1b67b2a86e3ddcd8c90d4" + integrity sha512-9mamvFfzXoaa7kSyshfCrHdK54oAhGB3P7S5M8QjHxUINaQn8naRhZ1AEFoW6rw8Jy2I27XplJsuQrdgxkd+Zw== + dependencies: + "@babel/core" "^7.21.0" + "@babel/generator" "^7.21.1" + "@babel/parser" "^7.21.2" + "@babel/runtime" "^7.21.0" + "@babel/types" "^7.21.2" + "@lingui/babel-plugin-extract-messages" "4.4.0" + "@lingui/conf" "4.4.0" + "@lingui/core" "4.4.0" + "@lingui/format-po" "4.4.0" + "@lingui/message-utils" "4.4.0" + babel-plugin-macros "^3.0.1" + chalk "^4.1.0" + chokidar "3.5.1" + cli-table "0.3.6" + commander "^10.0.0" + convert-source-map "^2.0.0" + date-fns "^2.16.1" + esbuild "^0.17.10" + glob "^7.1.4" + inquirer "^7.3.3" + micromatch "4.0.2" + normalize-path "^3.0.0" + ora "^5.1.0" + pathe "^1.1.0" + pkg-up "^3.1.0" + pofile "^1.1.4" + pseudolocale "^2.0.0" + ramda "^0.27.1" + source-map "^0.8.0-beta.0" + "@lingui/cli@^4.0.0": version "4.1.2" resolved "https://registry.yarnpkg.com/@lingui/cli/-/cli-4.1.2.tgz#39811b2dcb61b0a4c8df79cdd74a8eed2ed71e7f" @@ -4231,6 +4319,18 @@ jiti "^1.17.1" lodash.get "^4.4.2" +"@lingui/conf@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@lingui/conf/-/conf-4.4.0.tgz#0cf0506a26e393aefb36f0565c3e9dc4a7fd800b" + integrity sha512-mIAGh5eeWJm5jYM/ag4lbktxlS/73iANOahMM3q5OlEfIVvBzoinwSONRQEVsIgLT1SI6ULbqvVaI42VF5WrAw== + dependencies: + "@babel/runtime" "^7.20.13" + chalk "^4.1.0" + cosmiconfig "^8.0.0" + jest-validate "^29.4.3" + jiti "^1.17.1" + lodash.get "^4.4.2" + "@lingui/core@4.1.2": version "4.1.2" resolved "https://registry.yarnpkg.com/@lingui/core/-/core-4.1.2.tgz#94bf8d539d8a67b0216aa705919d16b4b29b8cd6" @@ -4239,6 +4339,15 @@ "@babel/runtime" "^7.20.13" "@lingui/message-utils" "4.1.2" +"@lingui/core@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@lingui/core/-/core-4.4.0.tgz#d043c2770673d70bafa6b850cfeec3c859844085" + integrity sha512-0ngEP+g4bt6f3cNqEzkU5796VkEEamxNXF/JD/QV9Ftxp8QBw91WqAoHjNYs3aYZOctCsRBR7FlvRQ6o2fDWDg== + dependencies: + "@babel/runtime" "^7.20.13" + "@lingui/message-utils" "4.4.0" + unraw "^2.0.1" + "@lingui/detect-locale@^4.0.0": version "4.1.2" resolved "https://registry.yarnpkg.com/@lingui/detect-locale/-/detect-locale-4.1.2.tgz#dae1fb73ce88d09ab6ca0f728b36e8774e595cc7" @@ -4254,6 +4363,25 @@ date-fns "^2.29.3" pofile "^1.1.4" +"@lingui/format-po@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@lingui/format-po/-/format-po-4.4.0.tgz#37f119545d39a625698877a2e0ca5bb27b9ea967" + integrity sha512-FRk9HD199Klknv+zccytddHfnSJwns6Fv3ZHvm8hoB9VLKnO0RBMR2f3mqw+MYPvSYGtTIxVQXLGISva7nFG4A== + dependencies: + "@lingui/conf" "4.4.0" + "@lingui/message-utils" "4.4.0" + date-fns "^2.29.3" + pofile "^1.1.4" + +"@lingui/loader@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@lingui/loader/-/loader-4.4.0.tgz#ec1d316ba9337b5274c83f9cd94b7b002664e6e6" + integrity sha512-MDsfuZjG2/bju13/b3PEzxcD45JJBR1Q+i2fKkVtgyiVjh2UUvYeg4PgCQwsbWCblRQ4L9bpTcgbI+yFW8Zb7w== + dependencies: + "@babel/runtime" "^7.20.13" + "@lingui/cli" "4.4.0" + "@lingui/conf" "4.4.0" + "@lingui/macro@^4.0.0": version "4.1.2" resolved "https://registry.yarnpkg.com/@lingui/macro/-/macro-4.1.2.tgz#8f4d27355d72c1d5dc8dc74ef247746877aec73c" @@ -4272,6 +4400,13 @@ dependencies: "@messageformat/parser" "^5.0.0" +"@lingui/message-utils@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@lingui/message-utils/-/message-utils-4.4.0.tgz#88a7ff9c0ca10fdce25374a92fc27b932a96778a" + integrity sha512-SScnNuemsyHx2vyLvLsHgmAaCBHwnaAxUg3LkKoulqXe2Po8CmLBh1/28oNQ20ZhjwadUmy0unGalp9qqEBOkw== + dependencies: + "@messageformat/parser" "^5.0.0" + "@lingui/react@^4.0.0": version "4.1.2" resolved "https://registry.yarnpkg.com/@lingui/react/-/react-4.1.2.tgz#763bd93c75e8790f7534fdb0d98bf37f7607f1ab" @@ -4280,6 +4415,11 @@ "@babel/runtime" "^7.20.13" "@lingui/core" "4.1.2" +"@lingui/swc-plugin@4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@lingui/swc-plugin/-/swc-plugin-4.0.4.tgz#1e6e753b8aae50edd929eb4905db24a186513dca" + integrity sha512-xRnR96Mqi6zwGlVfGJMfoM8QykBbUz/sSnwmcFL9BZ8Y9YBZxzLAVf4t1BbiIQsAs+pMYu/HfujTBD4y/r1ucA== + "@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" @@ -4518,7 +4658,14 @@ resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/semver-v6/-/semver-v6-6.3.3.tgz#ea6d23ade78a325f7a52750aab1526b02b628c29" integrity sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg== -"@noble/curves@^1.0.0": +"@noble/curves@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.1.0.tgz#f13fc667c89184bc04cccb9b11e8e7bae27d8c3d" + integrity sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA== + dependencies: + "@noble/hashes" "1.3.1" + +"@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== @@ -4530,6 +4677,16 @@ 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": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" + integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== + +"@noble/hashes@~1.3.0": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -4579,6 +4736,11 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.3.tgz#cbef3146bfc570849405f59cba18235da95a252a" integrity sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg== +"@openzeppelin/contracts@^4.9.2": + version "4.9.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" + integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== + "@parcel/watcher@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.1.0.tgz#5f32969362db4893922c526a842d8af7a8538545" @@ -4645,6 +4807,11 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== +"@prb/math@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@prb/math/-/math-4.0.1.tgz#bc90277f4f1c085c973f502455bf12c2b3b67666" + integrity sha512-ANTz2KMV+dMdZ57mWgDTR6jZo5uQzUczQEHCxd7CvJZZ9yafnfPhUUILHvvigIOZ85fZbTPVkC8YoRG1z5Qf7g== + "@rc-component/portal@^1.0.0-6", "@rc-component/portal@^1.0.0-8", "@rc-component/portal@^1.0.2": version "1.1.1" resolved "https://registry.yarnpkg.com/@rc-component/portal/-/portal-1.1.1.tgz#1a30ffe51c240b54360cba8e8bfc5d1f559325c4" @@ -4723,6 +4890,28 @@ resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.5.1.tgz#254521c188b49e8b2d4cc048b475fb2b38737fec" integrity sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA== +"@scure/base@~1.1.0": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.2.tgz#ff0cf51874aaf176490c9cb46e4df807a2e581d2" + integrity sha512-sSCrnIdaUZQHhBxZThMuk7Wm1TWzMD3uJNdGgx3JS23xSqevu0tAOsg8k66nL3R2NwQe65AI9GgqpPOgZys/eA== + +"@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" + "@sentry-internal/tracing@7.52.1": version "7.52.1" resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.52.1.tgz#c98823afd2f9814466fa26f24a1a54fe63b27c24" @@ -5398,6 +5587,14 @@ mkdirp "^1.0.4" path-browserify "^1.0.1" +"@typechain/ethers-v5@^10.0.0": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-10.2.1.tgz#50241e6957683281ecfa03fb5a6724d8a3ce2391" + integrity sha512-n3tQmCZjRE6IU4h6lqUGiQ1j866n5MTCBJreNEHHVWXa2u9GJTaeYyU1/k+1qLutkyw+sS6VAN+AbeiTqsxd/A== + dependencies: + lodash "^4.17.15" + ts-essentials "^7.0.1" + "@types/aria-query@^5.0.1": version "5.0.1" resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.1.tgz#3286741fb8f1e1580ac28784add4c7a1d49bdfbc" @@ -5783,6 +5980,11 @@ resolved "https://registry.yarnpkg.com/@types/phoenix/-/phoenix-1.5.6.tgz#fca4e7315c7f743bf6f04805588b7261b11818db" integrity sha512-e7jZ6I9uyRGsg7MNwQcarmBvRlbGb9DibbocE9crVnxqsy6C23RMxLWbJ2CQ3vgCW7taoL1L+F02EcjA6ld7XA== +"@types/prettier@^2.1.1": + version "2.7.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" + integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== + "@types/prettier@^2.1.5": version "2.7.2" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" @@ -6211,6 +6413,11 @@ resolved "https://registry.yarnpkg.com/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.2.tgz#84c5a3f8d648842cec5cc649b88df599af32ed88" integrity sha512-HIzRG7sy88UZjBJamssEczH5q7t5+axva19UbZLO6u0ySbYPrwzWiXBcC0WuHyhKKoeCyneH+FvYzKQq/zTtkQ== +"@wagmi/chains@1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@wagmi/chains/-/chains-1.7.0.tgz#8f6ad81cf867e1788417f7c978ca92bc083ecaf6" + integrity sha512-TKVeHv0GqP5sV1yQ8BDGYToAFezPnCexbbBpeH14x7ywi5a1dDStPffpt9x+ytE6LJWkZ6pAMs/HNWXBQ5Nqmw== + "@walletconnect/browser-utils@^1.8.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@walletconnect/browser-utils/-/browser-utils-1.8.0.tgz#33c10e777aa6be86c713095b5206d63d32df0951" @@ -6847,6 +7054,11 @@ abbrev@^1.0.0: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== +abitype@0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.3.tgz#294d25288ee683d72baf4e1fed757034e3c8c277" + integrity sha512-dz4qCQLurx97FQhnb/EIYTk/ldQ+oafEDUqC0VVIeQS1Q48/YWt/9YNfMmp9SLFqN41ktxny3c8aYxHjmFIB/w== + abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" @@ -7168,6 +7380,16 @@ aria-query@^5.0.0, aria-query@^5.1.3: dependencies: deep-equal "^2.0.5" +array-back@^3.0.1, array-back@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + +array-back@^4.0.1, array-back@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" + integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== + array-buffer-byte-length@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" @@ -8692,6 +8914,26 @@ comma-separated-tokens@^2.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== +command-line-args@^5.1.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.2.1.tgz#c44c32e437a57d7c51157696893c5909e9cec42e" + integrity sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg== + dependencies: + array-back "^3.1.0" + find-replace "^3.0.0" + lodash.camelcase "^4.3.0" + typical "^4.0.0" + +command-line-usage@^6.1.0: + version "6.1.3" + resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-6.1.3.tgz#428fa5acde6a838779dfa30e44686f4b6761d957" + integrity sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw== + dependencies: + array-back "^4.0.2" + chalk "^2.4.2" + table-layout "^1.0.2" + typical "^5.2.0" + commander@^10.0.0: version "10.0.1" resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" @@ -8717,6 +8959,11 @@ commander@^7.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== +commander@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + common-path-prefix@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0" @@ -9321,7 +9568,7 @@ deep-equal@^2.0.5: which-collection "^1.0.1" which-typed-array "^1.1.9" -deep-extend@^0.6.0: +deep-extend@^0.6.0, deep-extend@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== @@ -9699,6 +9946,10 @@ drbg.js@^1.0.1: create-hash "^1.1.2" create-hmac "^1.1.4" +"ds-test@https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0": + version "1.0.0" + resolved "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0" + dset@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.2.tgz#89c436ca6450398396dc6538ea00abc0c54cd45a" @@ -11290,6 +11541,13 @@ find-cache-dir@^4.0.0: common-path-prefix "^3.0.0" pkg-dir "^7.0.0" +find-replace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" + integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== + dependencies: + array-back "^3.0.1" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -11364,6 +11622,10 @@ forge-run-parser@^1.0.2: resolved "https://registry.yarnpkg.com/forge-run-parser/-/forge-run-parser-1.0.2.tgz#f23dd92a334b9c000abdfc8fce2c59662698f543" integrity sha512-BGQiS9Gp7q2rd3XUNHt5iJmLS7s/udGhRRWvyiqIxMUcnO62fzfHLkQ4+/jRLBCAQ7p5fXQUntJ0P9MxAPrwYA== +"forge-std@https://github.com/foundry-rs/forge-std.git#e8a047e3f40f13fa37af6fe14e6e06283d9a060e": + version "1.5.6" + resolved "https://github.com/foundry-rs/forge-std.git#e8a047e3f40f13fa37af6fe14e6e06283d9a060e" + form-data-encoder@1.7.1: version "1.7.1" resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.1.tgz#ac80660e4f87ee0d3d3c3638b7da8278ddb8ec96" @@ -11471,7 +11733,7 @@ fs-extra@^4.0.2: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^7.0.1: +fs-extra@^7.0.0, fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== @@ -11765,7 +12027,7 @@ got@12.1.0: p-cancelable "^3.0.0" responselike "^2.0.0" -got@^11.8.5: +got@^11.8.2, got@^11.8.5: version "11.8.6" resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== @@ -13874,6 +14136,16 @@ juice@^9.0.0: slick "^1.12.2" web-resource-inliner "^6.0.1" +juicebox-metadata-helper@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/juicebox-metadata-helper/-/juicebox-metadata-helper-0.1.7.tgz#c642729e93dca1d924901d14a714010ab0eb70ed" + integrity sha512-bP97KtDKOx6ztkOMlgpWxGm/qKy6Y2wFRHyH6psD9Wjfs9WhjEUIZf20obDz+osDCytCMPfWE0im1vFYmYuEaw== + dependencies: + "@dethcrypto/eth-sdk" "^0.3.4" + "@dethcrypto/eth-sdk-client" "^0.1.6" + ethers "^5.7.0" + viem "^1.5.3" + jwa@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" @@ -14211,6 +14483,11 @@ lodash.assign@^4.0.3, lodash.assign@^4.0.6: resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" integrity sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw== +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -16738,7 +17015,7 @@ prettier-plugin-tailwindcss@^0.1.13: resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.1.13.tgz#ca1071361dc7e2ed5d95a2ee36825ce45f814942" integrity sha512-/EKQURUrxLu66CMUg4+1LwGdxnz8of7IDvrSLqEtDqhLH61SAlNNUSr90UTvZaemujgl3OH/VHg+fyGltrNixw== -prettier@^2.4.0, prettier@^2.7.1, prettier@^2.8.3: +prettier@^2.3.1, prettier@^2.4.0, prettier@^2.7.1, prettier@^2.8.3: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== @@ -17849,6 +18126,11 @@ reduce-css-calc@^2.1.8: css-unit-converter "^1.1.1" postcss-value-parser "^3.3.0" +reduce-flatten@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" + integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== + redux-thunk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.2.tgz#b9d05d11994b99f7a91ea223e8b04cf0afa5ef3b" @@ -19035,6 +19317,11 @@ string-env-interpolation@1.0.1, string-env-interpolation@^1.0.1: resolved "https://registry.yarnpkg.com/string-env-interpolation/-/string-env-interpolation-1.0.1.tgz#ad4397ae4ac53fe6c91d1402ad6f6a52862c7152" integrity sha512-78lwMoCcn0nNu8LszbP1UA7g55OeE4v7rCeWnM5B453rnNr4aq+5it3FEYtZrSEiMvHZOZ9Jlqb0OD0M2VInqg== +string-format@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" + integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== + string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -19404,6 +19691,16 @@ synckit@^0.8.5: "@pkgr/utils" "^2.3.1" tslib "^2.5.0" +table-layout@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.2.tgz#c4038a1853b0136d63365a734b6931cf4fad4a04" + integrity sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A== + dependencies: + array-back "^4.0.1" + deep-extend "~0.6.0" + typical "^5.2.0" + wordwrapjs "^4.0.0" + table@^6.8.1: version "6.8.1" resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf" @@ -19630,6 +19927,13 @@ titleize@^3.0.0: resolved "https://registry.yarnpkg.com/titleize/-/titleize-3.0.0.tgz#71c12eb7fdd2558aa8a44b0be83b8a76694acd53" integrity sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ== +tmp-promise@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/tmp-promise/-/tmp-promise-3.0.3.tgz#60a1a1cc98c988674fcbfd23b6e3367bdeac4ce7" + integrity sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ== + dependencies: + tmp "^0.2.0" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -19637,7 +19941,7 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -tmp@~0.2.1: +tmp@^0.2.0, tmp@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== @@ -19755,6 +20059,21 @@ trough@^2.0.0: resolved "https://registry.yarnpkg.com/true-myth/-/true-myth-4.1.1.tgz#ff4ac9d5130276e34aa338757e2416ec19248ba2" integrity sha512-rqy30BSpxPznbbTcAcci90oZ1YR4DqvKcNXNerG5gQBU2v4jk0cygheiul5J6ExIMrgDVuanv/MkGfqZbKrNNg== +ts-command-line-args@^2.2.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz#e64456b580d1d4f6d948824c274cf6fa5f45f7f0" + integrity sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw== + dependencies: + chalk "^4.1.0" + command-line-args "^5.1.1" + command-line-usage "^6.1.0" + string-format "^2.0.0" + +ts-essentials@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.3.tgz#686fd155a02133eedcc5362dc8b5056cde3e5a38" + integrity sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ== + ts-invariant@^0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.10.3.tgz#3e048ff96e91459ffca01304dbc7f61c1f642f6c" @@ -19903,6 +20222,22 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== +typechain@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.0.0.tgz#a5dbe754717a7e16247df52b5285903de600e8ff" + integrity sha512-rqDfDYc9voVAhmfVfAwzg3VYFvhvs5ck1X9T/iWkX745Cul4t+V/smjnyqrbDzWDbzD93xfld1epg7Y/uFAesQ== + dependencies: + "@types/prettier" "^2.1.1" + debug "^4.3.1" + fs-extra "^7.0.0" + glob "7.1.7" + js-sha3 "^0.8.0" + lodash "^4.17.15" + mkdirp "^1.0.4" + prettier "^2.3.1" + ts-command-line-args "^2.2.0" + ts-essentials "^7.0.1" + typed-array-length@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" @@ -19934,6 +20269,16 @@ typescript@^4.6.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== +typical@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" + integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== + +typical@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" + integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== + u2f-api@0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/u2f-api/-/u2f-api-0.2.7.tgz#17bf196b242f6bf72353d9858e6a7566cc192720" @@ -20111,6 +20456,11 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== +unraw@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unraw/-/unraw-2.0.1.tgz#7b51dcdfb1e43d59d5e52cdb44d349d029edbaba" + integrity sha512-tdOvLfRzHolwYcHS6HIX860MkK9LQ4+oLuNwFYL7bpgTEO64PZrcQxkisgwJYCfF8sKiWLwwu1c83DvMkbefIQ== + untildify@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" @@ -20363,6 +20713,22 @@ victory-vendor@^36.6.8: d3-time "^3.0.0" d3-timer "^3.0.1" +viem@^1.5.3: + version "1.8.1" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.8.1.tgz#36e4e7db430b2a5b5535e455ad2a7da5ef63cca5" + integrity sha512-g+8dW8K6uae+3k/5pezSmlwo3/G+uEZiQsHlJooH86Z4PT3clgtU179iL/GNEcNGwafyJh/Iq/1e+FTbHQKH8Q== + dependencies: + "@adraffy/ens-normalize" "1.9.0" + "@noble/curves" "1.1.0" + "@noble/hashes" "1.3.0" + "@scure/bip32" "1.3.0" + "@scure/bip39" "1.2.0" + "@types/ws" "^8.5.4" + "@wagmi/chains" "1.7.0" + abitype "0.9.3" + isomorphic-ws "5.0.0" + ws "8.12.0" + w3c-xmlserializer@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073" @@ -20857,6 +21223,14 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== +wordwrapjs@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.1.tgz#d9790bccfb110a0fc7836b5ebce0937b37a8b98f" + integrity sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA== + dependencies: + reduce-flatten "^2.0.0" + typical "^5.2.0" + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -20923,6 +21297,11 @@ ws@7.5.3: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== +ws@8.12.0: + version "8.12.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.12.0.tgz#485074cc392689da78e1828a9ff23585e06cddd8" + integrity sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig== + ws@8.13.0, ws@^8.11.0, ws@^8.12.0, ws@^8.13.0, ws@^8.5.0: version "8.13.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" @@ -21229,6 +21608,11 @@ zod@3.21.4: resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db" integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== +zod@^3.11.5: + version "3.22.2" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.2.tgz#3add8c682b7077c05ac6f979fea6998b573e157b" + integrity sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg== + zwitch@^2.0.0, zwitch@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7"