-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99604b9
commit cbb870f
Showing
40 changed files
with
1,079 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export enum JB721DelegateVersion { | ||
JB721DELEGATE_V3 = '3', | ||
JB721DELEGATE_V3_1 = '3-1', | ||
JB721DELEGATE_V3_2 = '3-2', | ||
JB721DELEGATE_V3_3 = '3-3', | ||
JB721DELEGATE_V3_4 = '3-4', | ||
JB721DELEGATE_V4 = '4', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...packages/v2v3/contexts/NftRewards/JB721DelegateContracts/JB721DelegateContractsContext.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/packages/v2v3/hooks/JB721Delegate/JB721DelegateVersion/useJB721DelegateVersion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/packages/v2v3/hooks/JB721Delegate/contractReader/useNftCollectionMetadataUri.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/packages/v2v3/hooks/JB721Delegate/contractReader/useNftTiers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/packages/v2v3/hooks/JB721Delegate/contracts/useJB721DelegateAbi.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
src/packages/v2v3/hooks/JB721Delegate/contracts/useJB721DelegateContractAddress.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/packages/v2v3/hooks/JB721Delegate/contracts/useJB721TieredDelegate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/packages/v2v3/hooks/JB721Delegate/contracts/useJB721TieredDelegateStore.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/packages/v2v3/hooks/JB721Delegate/contracts/useJBTiered721DelegateProjectDeployer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/packages/v2v3/hooks/JB721Delegate/contracts/useStoreofJB721TieredDelegate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 17 additions & 16 deletions
33
src/packages/v2v3/hooks/JB721Delegate/transactor/useReconfigureV2V3FundingCycleWithNftsTx.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/packages/v2v3/hooks/defaultContracts/useDefaultJB721Delegate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
src/packages/v2v3/hooks/transactor/useReconfigureNftCollectionMetadata.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/packages/v4/hooks/JB721Delegate/contractReader/useNftDeployerCanReconfigure.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { useReadJbPermissionsHasPermissions } from 'juice-sdk-react' | ||
import { V4OperatorPermission } from 'packages/v4/models/v4Permissions' | ||
import { zeroAddress } from 'viem' | ||
import { useChainId } from 'wagmi' | ||
import { SUPPORTED_JB_MULTITERMINAL_ADDRESS } from '../../useLaunchProjectTx' | ||
import { SUPPORTED_JB_721_TIER_STORE } from '../transactor/useLaunchProjectWithNftsTx' | ||
|
||
/** | ||
* Checks whether the given [projectOwnerAddress] has given the JBTiered721DelegateProjectDeployer | ||
* permission to queue rulesets for the given [projectId]. | ||
* | ||
* This must be true for the following circumstances (non-exhaustive): | ||
* - A project is reconfiguring their FC to include NFTs | ||
* - A project is launching their V3 FC with NFTs | ||
*/ | ||
export function useNftDeployerCanReconfigure({ | ||
projectOwnerAddress = zeroAddress, | ||
projectId, | ||
}: { | ||
projectOwnerAddress: `0x${string}` | undefined | ||
projectId: number | undefined | ||
}) { | ||
const chainId = useChainId() | ||
const chainIdStr = | ||
chainId?.toString() as keyof typeof SUPPORTED_JB_MULTITERMINAL_ADDRESS | ||
|
||
const JBTiered721DelegateStoreAddress = chainId | ||
? SUPPORTED_JB_721_TIER_STORE[chainIdStr] | ||
: zeroAddress | ||
|
||
const { data: JBTiered721DelegateProjectDeployerCanReconfigure } = | ||
useReadJbPermissionsHasPermissions({ | ||
operator: JBTiered721DelegateStoreAddress, | ||
Check failure on line 33 in src/packages/v4/hooks/JB721Delegate/contractReader/useNftDeployerCanReconfigure.ts GitHub Actions / Compile Typescript
|
||
account: projectOwnerAddress, | ||
domain: projectId, | ||
permissions: [V4OperatorPermission.QUEUE_RULESETS], | ||
}) | ||
|
||
return JBTiered721DelegateProjectDeployerCanReconfigure | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { useJBRulesetContext } from "juice-sdk-react" | ||
import { zeroAddress } from "viem" | ||
|
||
export function useHasNftRewards() { | ||
const { rulesetMetadata: { data: _rulesetMetadata }} = | ||
useJBRulesetContext() | ||
return ( | ||
_rulesetMetadata?.dataHook && | ||
_rulesetMetadata.dataHook !== zeroAddress | ||
) | ||
} |
Oops, something went wrong.