Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.5.0 #2702

Merged
merged 135 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
f06c8b5
WIP: refactoring proposal builder and sablier proposal builder
mudrila Dec 13, 2024
f8e3cdd
Kill custom sablier builder - extract necessary components and use th…
mudrila Dec 20, 2024
c2d3d62
Merge branch 'develop' into feature/#2533-example-proposal-templates
mudrila Dec 20, 2024
84cb21b
Extract reusable sablier proposal builder constants
mudrila Dec 20, 2024
159d51f
Formatting
mudrila Dec 20, 2024
8f94f8e
Create example templates for transfer and sablier stream
mudrila Dec 20, 2024
789164f
Finalize implementation for send assets action template
mudrila Dec 20, 2024
eefefdd
Formatting
mudrila Dec 20, 2024
e4d5678
Add airdrop template
mudrila Dec 20, 2024
2196693
Add missing translations
mudrila Dec 20, 2024
46d3553
Add recipient button
mudrila Dec 20, 2024
bbb5bc9
Little bit copy-pasting cleanup
mudrila Dec 20, 2024
4f1c828
Update copy and fix some bugs in airdrop modal
mudrila Dec 20, 2024
de57c58
Proper Airdrop action display
mudrila Dec 20, 2024
48e37ee
Logical fixes
mudrila Dec 20, 2024
303722f
Figured out there was an extra field which shouldn't be there in Aird…
mudrila Dec 21, 2024
c8cfb5e
Merge branch 'develop' into feature/#2533-example-proposal-templates
mudrila Jan 7, 2025
afdb67d
Better conditional rendering for transactions / streams step in Propo…
mudrila Jan 7, 2025
7c72f99
Merge branch 'feature/#2533-example-proposal-templates' into feature/…
mudrila Jan 7, 2025
1344c14
Merge branch 'develop' into feature/#2533-example-proposal-templates
mudrila Jan 10, 2025
e63736f
Refactor isProposalMode
mudrila Jan 10, 2025
fd0f3e1
Formatting
mudrila Jan 10, 2025
bbbb82a
Merge branch 'feature/#2533-example-proposal-templates' into feature/…
mudrila Jan 10, 2025
13f2d12
Fix validation issues and proper display logic for send assets / aird…
mudrila Jan 10, 2025
8cd6ce8
Remove commented out code
mudrila Jan 11, 2025
bb66eae
No index drilling
mudrila Jan 11, 2025
09aa306
Merge branch 'release/v0.4.3' into develop
adamgall Jan 16, 2025
89e0144
Remove netlify
adamgall Jan 16, 2025
91a63ec
Bump node version
adamgall Jan 16, 2025
c8754c1
Merge branch 'develop' into feature/#2533-example-proposal-templates
adamgall Jan 16, 2025
a0ce95f
Merge branch 'develop' into feature/#2533-sablier-and-transfer-template
adamgall Jan 16, 2025
d563956
Remove wrong? vite command
adamgall Jan 16, 2025
16f82d6
Don't dismiss all of the toasts, just the one we care about
adamgall Jan 16, 2025
d2d4d4a
Merge branch 'prepare-toasts' into develop
adamgall Jan 16, 2025
5b18da4
Add flag_leave feature flag
adamgall Jan 16, 2025
ecac3e0
Add a persistent toast yelling at u to go away if the flag is set
adamgall Jan 16, 2025
56ad071
Merge pull request #2676 from decentdao/handicap-netlify
adamgall Jan 16, 2025
14dce48
Inline the shutter key
adamgall Jan 16, 2025
168cbd2
Clean up documentation in .env
adamgall Jan 16, 2025
2cc4b33
Merge branch 'develop' into cf/remove-netlify
adamgall Jan 16, 2025
09d31ad
Prototype "wallet client" that automatically switches to the right ch…
adamgall Jan 16, 2025
4e6da99
Update .env
adamgall Jan 16, 2025
8763c18
Revert "Merge pull request #2676 from decentdao/handicap-netlify"
adamgall Jan 16, 2025
db74280
Optimize useNetworkPublicClient hook by memoizing the public client c…
Da-Colon Jan 17, 2025
5596497
Refactor hooks to use useNetworkPublicClient instead of usePublicClient
Da-Colon Jan 17, 2025
ae19fae
Rename useWaletClient to useNetworkWalletClient and update chainId ha…
Da-Colon Jan 17, 2025
c1d3dc6
Refactor useDeployDAO to replace useWaletClient with useNetworkWallet…
Da-Colon Jan 17, 2025
3a79c69
Replace useWalletClient with useNetworkWalletClient across multiple h…
Da-Colon Jan 17, 2025
f0c4a30
Merge branch 'eng-113-swap-usePublicClient' of github.com:decentdao/d…
Da-Colon Jan 17, 2025
249e6b5
Refactor useAutomaticSwitchChain to remove wallet client dependencies…
Da-Colon Jan 17, 2025
90ab26d
Update ABISelector and useGetAccountName to utilize chainId from netw…
Da-Colon Jan 17, 2025
202af38
Update multicall configuration in useNetworkPublicClient to include a…
Da-Colon Jan 17, 2025
39d3000
bump
adamgall Jan 17, 2025
329f905
Remove publicClient checks from various components and hooks to simpl…
Da-Colon Jan 17, 2025
b0b3401
Merge pull request #2669 from decentdao/cf/remove-netlify
adamgall Jan 20, 2025
ffe9f24
Reduce wait time in multicall configuration for useNetworkPublicClient
Da-Colon Jan 20, 2025
6380fcb
Remove unused PROPOSAL_FROM_TEMPLATE mode
mudrila Jan 20, 2025
602b183
Merge branch 'develop' into feature/#2533-example-proposal-templates
mudrila Jan 20, 2025
2d8bc5e
Merge branch 'feature/#2533-example-proposal-templates' into feature/…
mudrila Jan 20, 2025
8887111
Add missing translations
mudrila Jan 20, 2025
d230612
Fix missing step buttons on streams route
mudrila Jan 20, 2025
a56766e
Merge branch 'hotfix/v0.4.4' into develop
adamgall Jan 21, 2025
6e825ca
Merge branch 'develop' into feature/#2533-example-proposal-templates
adamgall Jan 21, 2025
661baba
Merge pull request #2679 from decentdao/eng-113-various-network-cleanup
Da-Colon Jan 21, 2025
56f3c71
Refactor ProposalBuilder components to enhance modularity and improve…
adamgall Jan 21, 2025
c1611b1
Refactor ProposalBuilder components to replace 'mode' with 'isProposa…
adamgall Jan 22, 2025
ec1a3e8
Merge branch 'develop' into eng-113-swap-usePublicClient
adamgall Jan 22, 2025
fc80505
Enhance ProposalBuilder with Nonce Input for Multisig Support
adamgall Jan 22, 2025
e2fb363
catch and display, wrong network toast, when fails to switch
Da-Colon Jan 22, 2025
198330b
Merge pull request #2678 from decentdao/use-walet-client
Da-Colon Jan 22, 2025
395661a
Merge pull request #2677 from decentdao/eng-113-swap-usePublicClient
Da-Colon Jan 22, 2025
c91c9ce
Merge branch 'develop' into feature/#2533-example-proposal-templates
adamgall Jan 22, 2025
d4b21e7
Merge branch 'feature/#2533-example-proposal-templates' into feature/…
adamgall Jan 22, 2025
5ade551
Enhance ProposalBuilder with Navigation URLs for Proposal Steps
adamgall Jan 22, 2025
1df7f23
Refactor ProposalBuilder and related pages to enhance header function…
adamgall Jan 22, 2025
ac03e4e
Refactor ProposalBuilder to Enhance Metadata Handling and Improve Cod…
adamgall Jan 22, 2025
e764ab4
Refactor ProposalBuilder and Proposal Creation Pages to Enhance Actio…
adamgall Jan 22, 2025
377c14d
Refactor ProposalBuilder and Proposal Creation Pages to Standardize S…
adamgall Jan 22, 2025
62e01de
Refactor ProposalBuilder to Enhance Flexibility and Code Clarity
adamgall Jan 22, 2025
ca5fb8c
Refactor Proposal Creation Pages to Standardize Metadata Step Button …
adamgall Jan 22, 2025
3bdb460
Refactor Proposal Creation Pages to Standardize Step Button Handling
adamgall Jan 22, 2025
50bbcd9
Refactor ProposalBuilder Component and Update Imports for Proposal Cr…
adamgall Jan 22, 2025
f637b6a
Refactor ProposalBuilder and ProposalDetails to Use React.ReactNode f…
adamgall Jan 22, 2025
b63e4a7
Merge pull request #2683 from decentdao/feature/#2533-example-proposa…
mudrila Jan 22, 2025
6dd9366
Merge branch 'feature/#2533-example-proposal-templates' into feature/…
adamgall Jan 22, 2025
352f165
Merge pull request #2647 from decentdao/feature/#2533-sablier-and-tra…
mudrila Jan 22, 2025
a977cde
Action components cleanup
mudrila Jan 23, 2025
60d14be
Formatting
mudrila Jan 23, 2025
76738bd
Add supported ENS networks to the network configuration store
Da-Colon Jan 23, 2025
6a6de0a
Refactor ENS address retrieval to use custom hook for network-specifi…
Da-Colon Jan 23, 2025
954ece1
Implement useNetworkEnsAvatar hook for network-specific ENS avatar re…
Da-Colon Jan 23, 2025
5be6c34
Replace useAvatar with useNetworkEnsAvatar for avatar retrieval acros…
Da-Colon Jan 23, 2025
352b811
Refactor ENS name retrieval to use useNetworkEnsName hook for improve…
Da-Colon Jan 23, 2025
c12b92b
Refactor hooks to accept optional props for improved flexibility in E…
Da-Colon Jan 23, 2025
8877da9
Refactor ENS address retrieval to use useNetworkEnsAddressAsync for i…
Da-Colon Jan 23, 2025
b3ba5b5
Add useNetworkEnsNameAsync hook for asynchronous ENS name retrieval w…
Da-Colon Jan 23, 2025
a7f1e17
Refactor address validation to use useValidationAddress hook for impr…
Da-Colon Jan 23, 2025
9e9895e
Add isENSSupported flag to network configurations for ENS support han…
Da-Colon Jan 23, 2025
16c1ef9
Update supportedEnsNetworks to dynamically filter based on isENSSuppo…
Da-Colon Jan 23, 2025
716a6f7
Refactor ENS hooks to validate supported networks and throw errors fo…
Da-Colon Jan 23, 2025
430bafa
Refactor useNetworkEnsAddressAsync to improve network handling and re…
Da-Colon Jan 23, 2025
ba78886
Refactor useSearchDao and useResolveENSName to support multiple ENS n…
Da-Colon Jan 23, 2025
59c3df8
Handle ABI fetching errors by resetting ABI state on failure
Da-Colon Jan 24, 2025
a2373fd
refactor: update MemberColumn and RolesRow components to use isMember…
Da-Colon Jan 24, 2025
680f2b5
refactor: simplify member text color logic in MemberColumn component
Da-Colon Jan 24, 2025
745ae0c
refactor: remove isTermed prop from RoleCard and SafeRolesEditPage co…
Da-Colon Jan 24, 2025
5755937
refactor: remove isTermed prop from RoleCard in SafeRolesPage component
Da-Colon Jan 24, 2025
a1de1a2
Merge pull request #2646 from decentdao/feature/#2533-example-proposa…
mudrila Jan 24, 2025
499a42e
Merge pull request #2689 from decentdao/eng-90-ensure-abi-selector-up…
mudrila Jan 24, 2025
c5b8186
cleanup
DarksightKellar Jan 24, 2025
8ddedbd
Merge branch 'eng-137-ens-updates' of github.com:decentdao/decent-int…
Da-Colon Jan 24, 2025
c0026e5
Refactor useNetworkEnsAddressAsync to validate ENS support for specif…
Da-Colon Jan 24, 2025
7dd405f
Refactor useNetworkEnsNameAsync to improve error handling for unsuppo…
Da-Colon Jan 24, 2025
4433705
refactor: simplify logic for determining wearerAddress in RolesEditTa…
Da-Colon Jan 24, 2025
ff0bf34
Refactor useGetSafeName to remove chainId dependency from useNetworkE…
Da-Colon Jan 24, 2025
752f588
Merge branch 'hotfix/v0.4.5' into develop
adamgall Jan 25, 2025
c65cd6e
Merge pull request #2690 from decentdao/eng-71-fix-role-term-pending-…
Da-Colon Jan 27, 2025
fd19a11
refactor: remove votingWeight from token data retrieval in governance…
Da-Colon Jan 30, 2025
3b9b93d
Merge remote-tracking branch 'origin/feature/ENG-163-Role-permission-…
adamgall Jan 30, 2025
2abdc85
Refactor useNetworkPublicClient to remove chainId prop and simplify c…
Da-Colon Jan 30, 2025
000dcb7
Refactor useNetworkPublicClient to remove batch configuration and sim…
Da-Colon Jan 30, 2025
d8223bb
Refactor useSearchDAO to search in parrell;
Da-Colon Jan 30, 2025
3ac6fc2
Refactor useSearchDao to simplify address filtering logic
Da-Colon Jan 30, 2025
054fe22
Merge pull request #2685 from decentdao/eng-137-ens-updates
Da-Colon Jan 30, 2025
bfa2e60
Merge branch 'develop' into eng-137-ens-updates-publicClient
Da-Colon Jan 30, 2025
2a0dff7
Merge branch 'fix-subgraph-bug' into develop
adamgall Jan 30, 2025
e187362
Merge pull request #2686 from decentdao/eng-137-ens-updates-publicClient
Da-Colon Jan 30, 2025
5d63460
Merge pull request #2695 from decentdao/eng-168-remove-unused-voting-…
Da-Colon Jan 30, 2025
684c444
Merge branch 'feature/ENG-161-Tokenomisc-spelling-hotfix' into develop
adamgall Jan 30, 2025
3f895ba
Refactor setHatsTree to use let for hatsTree and filter payments base…
Da-Colon Jan 31, 2025
a925de9
Remove updateRolesWithStreams method from useRolesStore and RolesStor…
Da-Colon Jan 31, 2025
4478360
Add currentPayment to validation context in useRolesSchema
Da-Colon Jan 31, 2025
cef426c
Merge pull request #2700 from decentdao/eng-176-termed-payments-follo…
Da-Colon Jan 31, 2025
9297766
Merge pull request #2701 from decentdao/eng-177-existing-payment-vali…
Da-Colon Jan 31, 2025
d5897ee
Release candidate
Feb 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "decent-interface",
"version": "0.4.8",
"version": "0.5.0",
"private": true,
"dependencies": {
"@amplitude/analytics-browser": "^2.11.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Activity/ActivityDescriptionGovernance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box, Flex, Text } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
import { getAddress } from 'viem';
import { useGetMetadata } from '../../hooks/DAO/proposal/useGetMetadata';
import useAvatar from '../../hooks/utils/useAvatar';
import { useNetworkEnsAvatar } from '../../hooks/useNetworkEnsAvatar';
import { useGetAccountName } from '../../hooks/utils/useGetAccountName';
import {
GovernanceActivity,
Expand Down Expand Up @@ -54,7 +54,7 @@ function ProposalAuthor({ activity }: { activity: FractalProposal }) {
: undefined;

const { displayName: author } = useGetAccountName(proposer);
const avatarURL = useAvatar(author);
const { data: avatarURL } = useNetworkEnsAvatar({ name: author });

if (!proposer) {
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useEffect, useState } from 'react';
import { getContract } from 'viem';
import { usePublicClient } from 'wagmi';
import LidoWithdrawalQueueAbi from '../../../assets/abi/LidoWithdrawalQueueAbi';
import useLidoStaking from '../../../hooks/stake/lido/useLidoStaking';
import useNetworkPublicClient from '../../../hooks/useNetworkPublicClient';
import { useCanUserCreateProposal } from '../../../hooks/utils/useCanUserSubmitProposal';
import { useFractal } from '../../../providers/App/AppProvider';
import { useNetworkConfigStore } from '../../../providers/NetworkConfig/useNetworkConfigStore';
Expand All @@ -17,7 +17,7 @@ export default function useTreasuryLidoInteractions() {
const { handleUnstake, handleClaimUnstakedETH } = useLidoStaking();
const { canUserCreateProposal } = useCanUserCreateProposal();
const { staking } = useNetworkConfigStore();
const publicClient = usePublicClient();
const publicClient = useNetworkPublicClient();

// --- Lido Stake button setup ---
const showStakeButton =
Expand Down Expand Up @@ -48,7 +48,7 @@ export default function useTreasuryLidoInteractions() {

useEffect(() => {
const getLidoClaimableStatus = async () => {
if (!staking.lido?.withdrawalQueueContractAddress || !lidoWithdrawalNFT || !publicClient) {
if (!staking.lido?.withdrawalQueueContractAddress || !lidoWithdrawalNFT) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function AzoriusNFTDetail({

useEffect(() => {
const loadNFTDetails = async () => {
if (hasAddressError || !publicClient) {
if (hasAddressError) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ export function AzoriusTokenDetails(props: ICreationStepProps) {

useStepRedirect({ values });
const updateImportFields = useCallback(async () => {
if (!publicClient) {
return;
}
const importAddress = values.erc20Token.tokenImportAddress;
const importError = errors?.erc20Token?.tokenImportAddress;
if (importAddress && !importError && isAddress(importAddress)) {
Expand Down
163 changes: 80 additions & 83 deletions src/components/DaoCreator/hooks/usePrepareFormData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback } from 'react';
import { Address, getContract } from 'viem';
import IVotesAbi from '../../../assets/abi/IVotes';
import { useNetworkEnsAddressAsync } from '../../../hooks/useNetworkEnsAddress';
import useNetworkPublicClient from '../../../hooks/useNetworkPublicClient';
import {
AzoriusERC20DAO,
Expand All @@ -18,7 +19,7 @@ type FreezeGuardConfigParam = { freezeGuard?: DAOFreezeGuardConfig<BigIntValuePa

export function usePrepareFormData() {
const publicClient = useNetworkPublicClient();

const { getEnsAddress } = useNetworkEnsAddressAsync();
// Helper function to prepare freezeGuard data
const prepareFreezeGuardData = useCallback(
async (
Expand Down Expand Up @@ -80,8 +81,8 @@ export function usePrepareFormData() {
}: SafeMultisigDAO & FreezeGuardConfigParam) => {
const resolvedAddresses = await Promise.all(
trustedAddresses.map(async inputValue => {
if (validateENSName(inputValue) && publicClient) {
const maybeEnsAddress = await publicClient.getEnsAddress({
if (validateENSName(inputValue)) {
const maybeEnsAddress = await getEnsAddress({
name: inputValue,
});
if (maybeEnsAddress) {
Expand All @@ -101,7 +102,7 @@ export function usePrepareFormData() {
...rest,
};
},
[publicClient, prepareFreezeGuardData],
[getEnsAddress, prepareFreezeGuardData],
);

const prepareAzoriusERC20FormData = useCallback(
Expand All @@ -120,52 +121,50 @@ export function usePrepareFormData() {
}: AzoriusERC20DAO<BigIntValuePair> & FreezeGuardConfigParam): Promise<
AzoriusERC20DAO | undefined
> => {
if (publicClient) {
const resolvedTokenAllocations = await Promise.all(
tokenAllocations.map(async allocation => {
let address = allocation.address;
if (validateENSName(address) && publicClient) {
const maybeEnsAddress = await publicClient.getEnsAddress({
name: allocation.address,
});
if (maybeEnsAddress) {
address = maybeEnsAddress;
}
const resolvedTokenAllocations = await Promise.all(
tokenAllocations.map(async allocation => {
let address = allocation.address;
if (validateENSName(address)) {
const maybeEnsAddress = await getEnsAddress({
name: allocation.address,
});
if (maybeEnsAddress) {
address = maybeEnsAddress;
}
return { amount: allocation.amount.bigintValue!, address: address };
}),
);
let freezeGuardData;
if (freezeGuard) {
freezeGuardData = await prepareFreezeGuardData(freezeGuard);
}
const isTokenImported =
tokenCreationType === TokenCreationType.IMPORTED && !!tokenImportAddress;
let isVotesToken: boolean | undefined = false;
if (isTokenImported) {
isVotesToken = await checkVotesToken(tokenImportAddress);
}
return {
tokenSupply: tokenSupply.bigintValue!,
parentAllocationAmount: parentAllocationAmount?.bigintValue!,
quorumPercentage: quorumPercentage.bigintValue!,
timelock: await getEstimatedNumberOfBlocks(timelock.bigintValue!, publicClient),
executionPeriod: await getEstimatedNumberOfBlocks(
executionPeriod.bigintValue!,
publicClient,
),
votingPeriod: await getEstimatedNumberOfBlocks(votingPeriod.bigintValue!, publicClient),
tokenAllocations: resolvedTokenAllocations,
tokenImportAddress,
tokenCreationType,
isTokenImported,
isVotesToken,
...freezeGuardData,
...rest,
};
}
return { amount: allocation.amount.bigintValue!, address: address };
}),
);
let freezeGuardData;
if (freezeGuard) {
freezeGuardData = await prepareFreezeGuardData(freezeGuard);
}
const isTokenImported =
tokenCreationType === TokenCreationType.IMPORTED && !!tokenImportAddress;
let isVotesToken: boolean | undefined = false;
if (isTokenImported) {
isVotesToken = await checkVotesToken(tokenImportAddress);
}
return {
tokenSupply: tokenSupply.bigintValue!,
parentAllocationAmount: parentAllocationAmount?.bigintValue!,
quorumPercentage: quorumPercentage.bigintValue!,
timelock: await getEstimatedNumberOfBlocks(timelock.bigintValue!, publicClient),
executionPeriod: await getEstimatedNumberOfBlocks(
executionPeriod.bigintValue!,
publicClient,
),
votingPeriod: await getEstimatedNumberOfBlocks(votingPeriod.bigintValue!, publicClient),
tokenAllocations: resolvedTokenAllocations,
tokenImportAddress,
tokenCreationType,
isTokenImported,
isVotesToken,
...freezeGuardData,
...rest,
};
},
[checkVotesToken, publicClient, prepareFreezeGuardData],
[publicClient, getEnsAddress, prepareFreezeGuardData, checkVotesToken],
);

const prepareAzoriusERC721FormData = useCallback(
Expand All @@ -181,46 +180,44 @@ export function usePrepareFormData() {
}: AzoriusERC721DAO<BigIntValuePair> & FreezeGuardConfigParam): Promise<
AzoriusERC721DAO | undefined
> => {
if (publicClient) {
let freezeGuardData;
if (freezeGuard) {
freezeGuardData = await prepareFreezeGuardData(freezeGuard);
}
let freezeGuardData;
if (freezeGuard) {
freezeGuardData = await prepareFreezeGuardData(freezeGuard);
}

const resolvedNFTs = await Promise.all(
nfts.map(async nft => {
let address = nft.tokenAddress;
if (validateENSName(address) && nft.tokenAddress) {
const maybeEnsAddress = await publicClient.getEnsAddress({
name: nft.tokenAddress,
});
if (maybeEnsAddress) {
address = maybeEnsAddress;
}
const resolvedNFTs = await Promise.all(
nfts.map(async nft => {
let address = nft.tokenAddress;
if (validateENSName(address) && nft.tokenAddress) {
const maybeEnsAddress = await getEnsAddress({
name: nft.tokenAddress,
});
if (maybeEnsAddress) {
address = maybeEnsAddress;
}
return {
tokenAddress: address,
tokenWeight: nft.tokenWeight.bigintValue!,
};
}),
);
}
return {
tokenAddress: address,
tokenWeight: nft.tokenWeight.bigintValue!,
};
}),
);

return {
quorumPercentage: quorumPercentage.bigintValue!,
timelock: await getEstimatedNumberOfBlocks(timelock.bigintValue!, publicClient),
executionPeriod: await getEstimatedNumberOfBlocks(
executionPeriod.bigintValue!,
publicClient,
),
votingPeriod: await getEstimatedNumberOfBlocks(votingPeriod.bigintValue!, publicClient),
nfts: resolvedNFTs,
quorumThreshold: quorumThreshold.bigintValue!,
...freezeGuardData,
...rest,
};
}
return {
quorumPercentage: quorumPercentage.bigintValue!,
timelock: await getEstimatedNumberOfBlocks(timelock.bigintValue!, publicClient),
executionPeriod: await getEstimatedNumberOfBlocks(
executionPeriod.bigintValue!,
publicClient,
),
votingPeriod: await getEstimatedNumberOfBlocks(votingPeriod.bigintValue!, publicClient),
nfts: resolvedNFTs,
quorumThreshold: quorumThreshold.bigintValue!,
...freezeGuardData,
...rest,
};
},
[prepareFreezeGuardData, publicClient],
[getEnsAddress, prepareFreezeGuardData, publicClient],
);
return {
prepareMultisigFormData,
Expand Down
10 changes: 6 additions & 4 deletions src/components/DaoDashboard/ERC20Claim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { abis } from '@fractal-framework/fractal-contracts';
import { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { getContract } from 'viem';
import { useAccount, usePublicClient, useWalletClient } from 'wagmi';
import { useAccount } from 'wagmi';
import { Alert as AlertIcon } from '../../assets/theme/custom/icons/Alert';
import useNetworkPublicClient from '../../hooks/useNetworkPublicClient';
import { useNetworkWalletClient } from '../../hooks/useNetworkWalletClient';
import { useTransaction } from '../../hooks/utils/useTransaction';
import { useFractal } from '../../providers/App/AppProvider';
import { AzoriusGovernance } from '../../types';
Expand All @@ -19,11 +21,11 @@ export function ERCO20Claim() {
const { t } = useTranslation(['dashboard', 'transaction']);
const [contractCall, pending] = useTransaction();
const azoriusGovernance = governance as AzoriusGovernance;
const publicClient = usePublicClient();
const { data: walletClient } = useWalletClient();
const publicClient = useNetworkPublicClient();
const { data: walletClient } = useNetworkWalletClient();

const loadClaim = useCallback(async () => {
if (!tokenClaimContractAddress || !type || !account || !publicClient) {
if (!tokenClaimContractAddress || !type || !account) {
return;
}
const tokenClaimContract = getContract({
Expand Down
13 changes: 6 additions & 7 deletions src/components/DaoDashboard/Info/InfoGovernance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Bank } from '@phosphor-icons/react';
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { getContract } from 'viem';
import { usePublicClient } from 'wagmi';

import useNetworkPublicClient from '../../../hooks/useNetworkPublicClient';
import { useTimeHelpers } from '../../../hooks/utils/useTimeHelpers';
import { useFractal } from '../../../providers/App/AppProvider';
import { useDaoInfoStore } from '../../../store/daoInfo/useDaoInfoStore';
Expand All @@ -19,7 +20,7 @@ export function InfoGovernance({ showTitle = true }: { showTitle?: boolean }) {
guardContracts: { freezeGuardType, freezeGuardContractAddress },
} = useFractal();
const { safe } = useDaoInfoStore();
const publicClient = usePublicClient();
const publicClient = useNetworkPublicClient();
const { getTimeDuration } = useTimeHelpers();
const [timelockPeriod, setTimelockPeriod] = useState<string>();
const [executionPeriod, setExecutionPeriod] = useState<string>();
Expand All @@ -28,11 +29,9 @@ export function InfoGovernance({ showTitle = true }: { showTitle?: boolean }) {

useEffect(() => {
const setTimelockInfo = async () => {
const formatBlocks = async (blocks: number): Promise<string | undefined> => {
if (publicClient) {
return getTimeDuration(await blocksToSeconds(blocks, publicClient));
}
};
const formatBlocks = async (blocks: number): Promise<string | undefined> =>
getTimeDuration(await blocksToSeconds(blocks, publicClient));

if (freezeGuardType == FreezeGuardType.MULTISIG) {
if (freezeGuardContractAddress && publicClient) {
const freezeGuardContract = getContract({
Expand Down
Loading