From f0b7d562626e1e3633c44419633726a02dee6fec Mon Sep 17 00:00:00 2001
From: Tom Quirk <12551741+tomquirk@users.noreply.github.com>
Date: Thu, 31 Aug 2023 19:29:36 +0200
Subject: [PATCH 1/7] feat: 721 delegate 3.4 support (#4041)
---
package.json | 4 +-
.../SummaryExpandedView.test.tsx.snap | 2 +-
src/components/ProjectLogo.tsx | 3 -
.../RedeemNftsModal/RedeemNftsModal.tsx | 52 +-
src/constants/nftRewards.ts | 7 +
.../useNftCollectionMetadataUri.ts | 11 +-
.../contractReader/useNftTiers.ts | 17 +-
.../useJB721DelegateContractAddress.ts | 34 +-
.../transactor/useLaunchProjectWithNftsTx.ts | 43 +-
.../useReconfigureNftCollectionMetadata.ts | 8 +-
src/models/v2v3/contracts.ts | 1 +
.../jb-721-delegate/IJBDelegatesRegistry.json | 4638 ++++++++++++++++-
.../jb-721-delegate/[dataSourceAddress].ts | 41 +-
.../encodeJb721DelegateMetadata.ts | 71 +
src/utils/nftRewards.ts | 16 +-
yarn.lock | 309 +-
16 files changed, 5042 insertions(+), 215 deletions(-)
diff --git a/package.json b/package.json
index 1827e6247a..aa493e9944 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",
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/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/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/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 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/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/nftRewards.ts b/src/utils/nftRewards.ts
index e444d9a3d0..d795111266 100644
--- a/src/utils/nftRewards.ts
+++ b/src/utils/nftRewards.ts
@@ -326,18 +326,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
@@ -347,7 +344,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/yarn.lock b/yarn.lock
index 6d0e924c8b..1f168c2412 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"
@@ -4518,7 +4566,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 +4585,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 +4644,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 +4715,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 +4798,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 +5495,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 +5888,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 +6321,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 +6962,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 +7288,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 +8822,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 +8867,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 +9476,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 +9854,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 +11449,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 +11530,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 +11641,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 +11935,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 +14044,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 +14391,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 +16923,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 +18034,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 +19225,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 +19599,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 +19835,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 +19849,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 +19967,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 +20130,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 +20177,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"
@@ -20363,6 +20616,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 +21126,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 +21200,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 +21511,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"
From c3dc7a41fe8303312ea8e8b10c44a2e52f82ac41 Mon Sep 17 00:00:00 2001
From: Tom Quirk <12551741+tomquirk@users.noreply.github.com>
Date: Thu, 31 Aug 2023 19:30:13 +0200
Subject: [PATCH 2/7] feat: bump default terminal and delegate
---
src/hooks/defaultContracts/useDefaultJB721Delegate.ts | 2 +-
src/hooks/defaultContracts/useDefaultJBETHPaymentTerminal.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hooks/defaultContracts/useDefaultJB721Delegate.ts b/src/hooks/defaultContracts/useDefaultJB721Delegate.ts
index ddf0ffacc9..32bb43a5ed 100644
--- a/src/hooks/defaultContracts/useDefaultJB721Delegate.ts
+++ b/src/hooks/defaultContracts/useDefaultJB721Delegate.ts
@@ -4,4 +4,4 @@ import { JB721DelegateVersion } from 'models/v2v3/contracts'
* The version of the JB721Delegate contracts (NFT Rewards) that should be used to launch projects, funding cycles, etc.
*/
export const DEFAULT_JB_721_DELEGATE_VERSION: JB721DelegateVersion =
- JB721DelegateVersion.JB721DELEGATE_V3_3
+ JB721DelegateVersion.JB721DELEGATE_V3_4
diff --git a/src/hooks/defaultContracts/useDefaultJBETHPaymentTerminal.ts b/src/hooks/defaultContracts/useDefaultJBETHPaymentTerminal.ts
index 0bf3ccf964..9767dda96c 100644
--- a/src/hooks/defaultContracts/useDefaultJBETHPaymentTerminal.ts
+++ b/src/hooks/defaultContracts/useDefaultJBETHPaymentTerminal.ts
@@ -7,5 +7,5 @@ import { useContext } from 'react'
export function useDefaultJBETHPaymentTerminal() {
const { contracts } = useContext(V2V3ContractsContext)
- return contracts?.JBETHPaymentTerminal3_1
+ return contracts?.JBETHPaymentTerminal3_1_2
}
From 2ea1b7a22c4ff681f75b776da7086f3e17034284 Mon Sep 17 00:00:00 2001
From: peripheralist <79433522+peripheralist@users.noreply.github.com>
Date: Thu, 31 Aug 2023 17:31:28 -0400
Subject: [PATCH 3/7] Consolidate subgraph URL env vars (#4010)
---
.example.env | 5 +----
.github/workflows/ci-run.yml | 2 +-
codegen.yml | 2 +-
doc/devops.md | 6 +++---
src/lib/apollo/subgraphUri.ts | 6 ++----
src/types/environment.d.ts | 2 +-
6 files changed, 9 insertions(+), 14 deletions(-)
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/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/src/lib/apollo/subgraphUri.ts b/src/lib/apollo/subgraphUri.ts
index 647043fb94..d82b4506a2 100644
--- a/src/lib/apollo/subgraphUri.ts
+++ b/src/lib/apollo/subgraphUri.ts
@@ -10,11 +10,9 @@ export const subgraphUri = () => {
)
}
} 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/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
From 02eb12e24ce98f02932f0406a110230d49682d4d Mon Sep 17 00:00:00 2001
From: wraeth-eth <104132113+wraeth-eth@users.noreply.github.com>
Date: Fri, 1 Sep 2023 08:57:44 +1000
Subject: [PATCH 4/7] refactor: use emit conf deletion modal in create (#4044)
## What does this PR do and why?
_Provide a description of what this PR does. Link to any relevant GitHub issues, Notion tasks or Discord discussions._
## Screenshots or screen recordings
_If applicable, provide screenshots or screen recordings to demonstrate the changes._
## Acceptance checklist
- [ ] I have evaluated the [Approval Guidelines](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#approval-guidelines) for this PR.
- [ ] (if relevant) I have tested this PR in [all supported browsers](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#supported-browsers).
- [ ] (if relevant) I have tested this PR in dark mode and light mode (if applicable).
---
.../pages/ReviewDeploy/ReviewDeployPage.tsx | 34 ++++++------
.../ui/ConfirmationDeletionModal.tsx | 8 ++-
.../ProjectDashboard/utils/modals.tsx | 53 +++++++++++++------
src/locales/messages.pot | 9 ++--
4 files changed, 64 insertions(+), 40 deletions(-)
diff --git a/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx b/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx
index fa647b7676..4f8ec2e422 100644
--- a/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx
+++ b/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx
@@ -1,10 +1,11 @@
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 TransactionModal from 'components/modals/TransactionModal'
+import { emitConfirmationDeletionModal } from 'components/ProjectDashboard/utils/modals'
import { TERMS_OF_SERVICE_URL } from 'constants/links'
import useMobile from 'hooks/useMobile'
import { useModal } from 'hooks/useModal'
@@ -226,7 +227,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
.
@@ -236,20 +250,6 @@ export const ReviewDeployPage = () => {
transactionPending={deployTransactionPending}
open={deployTransactionPending}
/>
-
- 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/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..3e82146cbd 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/locales/messages.pot b/src/locales/messages.pot
index d3b01ae130..816f2e4a88 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 ""
@@ -4487,9 +4487,6 @@ msgstr ""
msgid "Percentage to reserve"
msgstr ""
-msgid "Remove"
-msgstr ""
-
msgid "All assets"
msgstr ""
From afe57a5332664bf3b865a8533c8a4226115c7201 Mon Sep 17 00:00:00 2001
From: wraeth-eth <104132113+wraeth-eth@users.noreply.github.com>
Date: Fri, 1 Sep 2023 08:58:23 +1000
Subject: [PATCH 5/7] wraethdao/jb-717-close-button-on-create-modal-doesnt-work
(#4045)
## What does this PR do and why?
Closes [JB-717 : Close button on create modal doesnt work](https://linear.app/peel/issue/JB-717/close-button-on-create-modal-doesnt-work)
## Screenshots or screen recordings
_If applicable, provide screenshots or screen recordings to demonstrate the changes._
## Acceptance checklist
- [ ] I have evaluated the [Approval Guidelines](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#approval-guidelines) for this PR.
- [ ] (if relevant) I have tested this PR in [all supported browsers](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#supported-browsers).
- [ ] (if relevant) I have tested this PR in dark mode and light mode (if applicable).
---
.../pages/ReviewDeploy/ReviewDeployPage.tsx | 20 +++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx b/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx
index 4f8ec2e422..e4567c8815 100644
--- a/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx
+++ b/src/components/Create/components/pages/ReviewDeploy/ReviewDeployPage.tsx
@@ -4,12 +4,12 @@ import { Checkbox, Form } from 'antd'
import { Callout } from 'components/Callout'
import { useDeployProject } from 'components/Create/hooks/DeployProject'
import ExternalLink from 'components/ExternalLink'
-import TransactionModal from 'components/modals/TransactionModal'
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'
@@ -63,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(
@@ -80,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) {
@@ -94,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,
@@ -107,6 +109,7 @@ export const ReviewDeployPage = () => {
deployProject,
isConnected,
router,
+ transactionModal,
])
const [activeKey, setActiveKey] = useState(
@@ -248,7 +251,8 @@ export const ReviewDeployPage = () => {
>
)
From f776a497bf774014a13f41999ef21128d4e1fc9f Mon Sep 17 00:00:00 2001
From: wraeth-eth <104132113+wraeth-eth@users.noreply.github.com>
Date: Fri, 1 Sep 2023 09:05:24 +1000
Subject: [PATCH 6/7] remove experiemental/color (#4049)
## What does this PR do and why?
_Provide a description of what this PR does. Link to any relevant GitHub issues, Notion tasks or Discord discussions._
## Screenshots or screen recordings
_If applicable, provide screenshots or screen recordings to demonstrate the changes._
## Acceptance checklist
- [ ] I have evaluated the [Approval Guidelines](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#approval-guidelines) for this PR.
- [ ] (if relevant) I have tested this PR in [all supported browsers](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#supported-browsers).
- [ ] (if relevant) I have tested this PR in dark mode and light mode (if applicable).
---
src/pages/experimental/color/index.tsx | 66 --------------------------
1 file changed, 66 deletions(-)
delete mode 100644 src/pages/experimental/color/index.tsx
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 (
-
- )
-}
-
-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 }
From dc43f7fea5fb9d819b3dca93503190026292950a Mon Sep 17 00:00:00 2001
From: wraeth-eth <104132113+wraeth-eth@users.noreply.github.com>
Date: Fri, 1 Sep 2023 09:06:26 +1000
Subject: [PATCH 7/7] unblock lingui and allow for SSR on almost all pages
(#3999)
## What does this PR do and why?
The big kahuna - this breaks lingui out into SSR and will not block for client side compilation/rendering
## Screenshots or screen recordings
_If applicable, provide screenshots or screen recordings to demonstrate the changes._
## Acceptance checklist
- [ ] I have evaluated the [Approval Guidelines](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#approval-guidelines) for this PR.
- [ ] (if relevant) I have tested this PR in [all supported browsers](https://github.com/jbx-protocol/juice-interface/blob/main/CONTRIBUTING.md#supported-browsers).
- [ ] (if relevant) I have tested this PR in dark mode and light mode (if applicable).
---
.linguirc.json | 19 ----
lingui.config.js | 25 +++++
next.config.js | 19 +++-
package.json | 2 +
src/components/ErrorNotificationButtons.tsx | 2 +-
.../Navbar/components/DropdownMenu.tsx | 2 +
.../Navbar/components/NavLanguageSelector.tsx | 29 +++---
.../components/SummaryCollapsedView.test.tsx | 2 +
.../ProjectDashboard/utils/modals.tsx | 2 +-
.../common/CoreAppWrapper/CoreAppWrapper.tsx | 32 +++---
src/contexts/Language/LanguageProvider.tsx | 73 +++++---------
.../Language/__mocks__/LanguageProvider.tsx | 7 ++
src/hooks/useLinguiInit.ts | 26 +++++
src/locales/utils.ts | 5 +
src/pages/_app.tsx | 11 ++-
src/pages/about/index.tsx | 3 +
src/pages/account/[addressOrEnsName]/edit.tsx | 10 ++
.../account/[addressOrEnsName]/index.tsx | 40 ++++++--
src/pages/activity/index.tsx | 3 +
src/pages/contact/index.tsx | 3 +
src/pages/create/index.tsx | 3 +
src/pages/experimental/flags/index.tsx | 3 +
src/pages/index.tsx | 3 +
src/pages/legal/index.tsx | 3 +
src/pages/p/[handle]/index.tsx | 16 ++-
src/pages/p/[handle]/safe/index.tsx | 9 +-
src/pages/privacy.tsx | 3 +
src/pages/projects/index.tsx | 3 +
src/pages/success-stories/constitutiondao.tsx | 3 +
src/pages/success-stories/moondao.tsx | 3 +
src/pages/success-stories/sharkdao.tsx | 3 +
src/pages/success-stories/studiodao.tsx | 3 +
.../v2/p/[projectId]/contracts/index.tsx | 3 +
src/pages/v2/p/[projectId]/index.tsx | 54 ++++++++---
src/pages/v2/p/[projectId]/safe/index.tsx | 9 +-
.../p/[projectId]/settings/[settingsPage].tsx | 3 +
src/pages/v2/p/[projectId]/settings/index.tsx | 3 +
.../next-server/globalGetServerSideProps.ts | 23 +++++
src/utils/projectPageLoaders.ts | 4 +-
yarn.lock | 97 +++++++++++++++++++
40 files changed, 424 insertions(+), 142 deletions(-)
delete mode 100644 .linguirc.json
create mode 100644 lingui.config.js
create mode 100644 src/contexts/Language/__mocks__/LanguageProvider.tsx
create mode 100644 src/hooks/useLinguiInit.ts
create mode 100644 src/locales/utils.ts
create mode 100644 src/utils/next-server/globalGetServerSideProps.ts
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/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 aa493e9944..8f9015ff1f 100644
--- a/package.json
+++ b/package.json
@@ -162,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/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/utils/modals.tsx b/src/components/ProjectDashboard/utils/modals.tsx
index 3e82146cbd..0dbd071bc8 100644
--- a/src/components/ProjectDashboard/utils/modals.tsx
+++ b/src/components/ProjectDashboard/utils/modals.tsx
@@ -1,6 +1,6 @@
import { Trans } from '@lingui/macro'
import { ModalOnCancelFn, ModalOnOkFn } from 'components/modals/JuiceModal'
-import LanguageProvider from 'contexts/Language/LanguageProvider'
+import { LanguageProvider } from 'contexts/Language/LanguageProvider'
import { ReactNode } from 'react'
import { createRoot } from 'react-dom/client'
import { ConfirmationDeletionModal } from '../components/ui/ConfirmationDeletionModal'
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/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/useLinguiInit.ts b/src/hooks/useLinguiInit.ts
new file mode 100644
index 0000000000..507f31f753
--- /dev/null
+++ b/src/hooks/useLinguiInit.ts
@@ -0,0 +1,26 @@
+// https://github.com/lingui/js-lingui/pull/1541
+
+import { i18n, Messages } from '@lingui/core'
+import { useEffect } from 'react'
+
+export const useLingUiInit = (messages: Messages, locale: string) => {
+ 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/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/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/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/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/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/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 1f168c2412..83870d05b4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4232,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"
@@ -4279,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"
@@ -4287,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"
@@ -4302,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"
@@ -4320,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"
@@ -4328,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"
@@ -20364,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"