Skip to content

Commit

Permalink
chore: remove JB deprecated contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
aeolianeth committed May 26, 2024
1 parent 8901b28 commit e70396b
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 196 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"@headlessui/react": "^1.7.18",
"@heroicons/react": "^2.0.17",
"@jbx-protocol/contracts-v1": "2.0.0",
"@jbx-protocol/contracts-v2-4.0.0": "npm:@jbx-protocol/[email protected]",
"@jbx-protocol/contracts-v2-latest": "npm:@jbx-protocol/[email protected]",
"@jbx-protocol/juice-721-delegate-v3": "npm:@jbx-protocol/[email protected]",
"@jbx-protocol/juice-721-delegate-v3-1": "npm:@jbx-protocol/[email protected]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import { V2V3ProjectHeaderActions } from '../V2V3ProjectHeaderActions/V2V3Projec
* Typically this list consists of contracts that are project-specific (e.g. PaymentTerminal, Controller etc.)
*/
const CONTRACT_EXCLUSIONS = [
V2V3ContractName.DeprecatedJBDirectory,
V2V3ContractName.DeprecatedJBSplitsStore,
V2V3ContractName.JBSingleTokenPaymentTerminalStore,
V2V3ContractName.JBFundAccessConstraintsStore,
...SUPPORTED_CONTROLLERS,
Expand Down
6 changes: 1 addition & 5 deletions src/hooks/JBPrices/loadJBPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ export async function loadJBPrices({
}

if (cv === CV_V3) {
if (readNetwork.name === NetworkName.goerli) {
contractJson = await import(
'@jbx-protocol/juice-contracts-v3/deployments/goerli/JBPrices.json'
)
} else if (readNetwork.name === NetworkName.sepolia) {
if (readNetwork.name === NetworkName.sepolia) {
contractJson = await import(
'@jbx-protocol/juice-contracts-v3/deployments/sepolia/JBPrices.json'
)
Expand Down
9 changes: 1 addition & 8 deletions src/hooks/v2v3/contractReader/useProjectControllerAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@ import useV2ContractReader from './useV2ContractReader'
export default function useProjectControllerAddress({
projectId,
contract,
useDeprecatedContract,
}: {
projectId?: number
contract?: ContractConfig<V2V3ContractName> | undefined
useDeprecatedContract?: boolean
}) {
if (!contract) {
contract = useDeprecatedContract
? V2V3ContractName.DeprecatedJBDirectory
: V2V3ContractName.JBDirectory
}
return useV2ContractReader<string>({
contract,
contract: contract ?? V2V3ContractName.JBDirectory,
functionName: 'controllerOf',
args: projectId ? [projectId] : null,
})
Expand Down
6 changes: 1 addition & 5 deletions src/hooks/v2v3/contractReader/useProjectSplits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,13 @@ export default function useProjectSplits({
projectId,
splitGroup,
domain,
useDeprecatedContract,
}: {
projectId: number | undefined
splitGroup: SplitGroup
domain: string | undefined
useDeprecatedContract?: boolean
}) {
return useV2ContractReader<Split[]>({
contract: useDeprecatedContract
? V2V3ContractName.DeprecatedJBSplitsStore
: V2V3ContractName.JBSplitsStore,
contract: V2V3ContractName.JBSplitsStore,
functionName: 'splitsOf',
args: projectId && domain ? [projectId, domain, splitGroup] : null,
formatter: useCallback((value: unknown): Split[] => {
Expand Down
6 changes: 1 addition & 5 deletions src/hooks/v2v3/contractReader/useProjectTerminals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ import useV2ContractReader from './useV2ContractReader'

export default function useProjectTerminals({
projectId,
useDeprecatedContract,
}: {
projectId?: number
useDeprecatedContract?: boolean
}) {
return useV2ContractReader<string[]>({
contract: useDeprecatedContract
? V2V3ContractName.DeprecatedJBDirectory
: V2V3ContractName.JBDirectory,
contract: V2V3ContractName.JBDirectory,
functionName: 'terminalsOf',
args: projectId ? [projectId] : null,
})
Expand Down
3 changes: 0 additions & 3 deletions src/models/v2v3/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ export enum V2V3ContractName {
JBETHPaymentTerminal3_1 = 'JBETHPaymentTerminal3_1',
JBETHPaymentTerminal3_1_1 = 'JBETHPaymentTerminal3_1_1',
JBETHPaymentTerminal3_1_2 = 'JBETHPaymentTerminal3_1_2',

DeprecatedJBSplitsStore = 'DeprecatedJBSplitsStore',
DeprecatedJBDirectory = 'DeprecatedJBDirectory',
}
export type V2V3Contracts = Record<V2V3ContractName, Contract>

Expand Down
12 changes: 0 additions & 12 deletions src/utils/v2v3/contractLoaders/JuiceboxV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,6 @@ export const loadJuiceboxV2Contract = async (
try {
let contractJson: ContractJson | undefined
switch (contractName) {
case V2V3ContractName.DeprecatedJBDirectory: {
contractJson = (await import(
`@jbx-protocol/contracts-v2-4.0.0/deployments/mainnet/JBDirectory.json`
)) as ContractJson
break
}
case V2V3ContractName.DeprecatedJBSplitsStore: {
contractJson = (await import(
`@jbx-protocol/contracts-v2-4.0.0/deployments/mainnet/JBSplitsStore.json`
)) as ContractJson
break
}
case V2V3ContractName.JBController: {
contractJson = (await import(
`@jbx-protocol/contracts-v2-latest/deployments/mainnet/JBController.json`
Expand Down
Loading

0 comments on commit e70396b

Please sign in to comment.