From 471c8ea92005b1e15400204b74b2ee52877d4bfe Mon Sep 17 00:00:00 2001 From: Kyrylo Klymenko Date: Fri, 23 Aug 2024 13:17:29 +0200 Subject: [PATCH 01/11] Add missing filtering of active payments for showing proper payments count --- src/components/pages/Roles/RolesTable.tsx | 4 ++-- src/pages/daos/[daoAddress]/roles/index.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/pages/Roles/RolesTable.tsx b/src/components/pages/Roles/RolesTable.tsx index 00bb487164..594bc81a12 100644 --- a/src/components/pages/Roles/RolesTable.tsx +++ b/src/components/pages/Roles/RolesTable.tsx @@ -221,7 +221,7 @@ export function RolesRowEdit({ editStatus={editStatus} /> - + p.isStreaming()).length || undefined} /> ); } @@ -265,7 +265,7 @@ export function RolesTable({ paymentsCount={ role.payments === undefined ? undefined - : role.payments.filter(p => p.isStreaming()).length + : role.payments.filter(p => p.isStreaming()).length || undefined } /> ))} diff --git a/src/pages/daos/[daoAddress]/roles/index.tsx b/src/pages/daos/[daoAddress]/roles/index.tsx index 252ff661cf..d69bbe3548 100644 --- a/src/pages/daos/[daoAddress]/roles/index.tsx +++ b/src/pages/daos/[daoAddress]/roles/index.tsx @@ -71,7 +71,7 @@ function Roles() { wearerAddress={roleHat.wearer || zeroAddress} hatId={roleHat.id} handleRoleClick={handleNavigateToRole} - paymentsCount={roleHat.payments?.length} + paymentsCount={roleHat.payments?.filter(p => p.isStreaming()).length || undefined} /> ))} From 17b76827c002f3556c9b44bd339d7c6b30c46ee9 Mon Sep 17 00:00:00 2001 From: Kyrylo Klymenko Date: Fri, 23 Aug 2024 23:31:43 +0200 Subject: [PATCH 02/11] Fix the logic of isStreaming --- src/hooks/DAO/loaders/useHatsTree.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/hooks/DAO/loaders/useHatsTree.ts b/src/hooks/DAO/loaders/useHatsTree.ts index 943cd7cbf9..22a24250ef 100644 --- a/src/hooks/DAO/loaders/useHatsTree.ts +++ b/src/hooks/DAO/loaders/useHatsTree.ts @@ -1,5 +1,5 @@ import { useApolloClient } from '@apollo/client'; -import { Tree, HatsSubgraphClient } from '@hatsprotocol/sdk-v1-subgraph'; +import { HatsSubgraphClient, Tree } from '@hatsprotocol/sdk-v1-subgraph'; import { useEffect } from 'react'; import { toast } from 'react-toastify'; import { formatUnits, getAddress } from 'viem'; @@ -8,7 +8,7 @@ import { StreamsQueryDocument } from '../../../../.graphclient'; import { SablierPayment } from '../../../components/pages/Roles/types'; import useIPFSClient from '../../../providers/App/hooks/useIPFSClient'; import { useNetworkConfig } from '../../../providers/NetworkConfig/NetworkConfigProvider'; -import { useRolesStore, DecentHatsError } from '../../../store/roles'; +import { DecentHatsError, useRolesStore } from '../../../store/roles'; import { CacheExpiry, CacheKeys } from '../../utils/cache/cacheDefaults'; import { getValue, setValue } from '../../utils/cache/useLocalStorage'; @@ -210,19 +210,16 @@ const useHatsTree = () => { endDate, cliffDate, isStreaming: () => { - const start = - lockupLinearStream.cliff === undefined && - lockupLinearStream.startTime !== undefined - ? startDate.getTime() - : cliffDate !== undefined - ? cliffDate.getTime() - : undefined; + const start = !lockupLinearStream.cliff + ? startDate.getTime() + : cliffDate !== undefined + ? cliffDate.getTime() + : undefined; const end = endDate ? endDate.getTime() : undefined; const cancelled = lockupLinearStream.canceled; const now = new Date().getTime(); - const isStreaming = - !cancelled && !!start && !!end && start <= now && end > now; - return isStreaming; + + return !cancelled && !!start && !!end && start <= now && end > now; }, }; }, From c6666f229baee5be751dca4b81b3249f0b38d649 Mon Sep 17 00:00:00 2001 From: Kyrylo Klymenko Date: Wed, 28 Aug 2024 16:33:23 +0200 Subject: [PATCH 03/11] Disable payments tab --- .../pages/Roles/forms/RoleFormTabs.tsx | 32 ++++++++++++++++--- src/hooks/utils/useCreateRoles.ts | 28 +++++++--------- src/i18n/locales/en/roles.json | 1 + 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/src/components/pages/Roles/forms/RoleFormTabs.tsx b/src/components/pages/Roles/forms/RoleFormTabs.tsx index 56a4cdcad3..d027098be7 100644 --- a/src/components/pages/Roles/forms/RoleFormTabs.tsx +++ b/src/components/pages/Roles/forms/RoleFormTabs.tsx @@ -1,13 +1,15 @@ -import { Tab, TabList, TabPanels, TabPanel, Tabs, Button, Flex } from '@chakra-ui/react'; +import { Button, Flex, Tab, TabList, TabPanel, TabPanels, Tabs } from '@chakra-ui/react'; import { useFormikContext } from 'formik'; import { useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { Hex } from 'viem'; +import { TOOLTIP_MAXW } from '../../../../constants/common'; import { DAO_ROUTES } from '../../../../constants/routes'; import { useFractal } from '../../../../providers/App/AppProvider'; import { useNetworkConfig } from '../../../../providers/NetworkConfig/NetworkConfigProvider'; import { useRolesStore } from '../../../../store/roles'; +import ModalTooltip from '../../../ui/modals/ModalTooltip'; import { EditBadgeStatus, RoleFormValues } from '../types'; import RoleFormInfo from './RoleFormInfo'; import RoleFormPaymentStream from './RoleFormPaymentStream'; @@ -30,6 +32,7 @@ export default function RoleFormTabs({ const { editedRoleData, isRoleUpdated, existingRoleHat } = useRoleFormEditedRole({ hatsTree }); const { t } = useTranslation(['roles']); const { values, errors, setFieldValue, setTouched } = useFormikContext(); + const paymentsTooltipRef = useRef(null); useEffect(() => { if (values.hats.length && !values.roleEditing) { @@ -64,15 +67,34 @@ export default function RoleFormTabs({ {t('roleInfo')} - {t('payments')} + + {!hatsTree ? ( + + {t('payments')} + + ) : ( + t('payments') + )} + - - - + {!!hatsTree && ( + + + + )} { - hatPaymentAddedTxs.push( - preparedPaymentTransactions.preparedTokenApprovalsTransactions[i], - ); - hatPaymentAddedTxs.push( - preparedPaymentTransactions.preparedStreamCreationTransactions[i], - ); - }); + preparedPaymentTransactions.preparedTokenApprovalsTransactions.forEach(tx => + hatPaymentAddedTxs.push(tx), + ); + preparedPaymentTransactions.preparedStreamCreationTransactions.forEach(tx => + hatPaymentAddedTxs.push(tx), + ); } if (editedPayrollHats.length) { @@ -604,14 +602,12 @@ export default function useCreateRoles() { recipients, ); - streamsData.forEach((_, i) => { - hatPaymentEditedTxs.push( - preparedPaymentTransactions.preparedTokenApprovalsTransactions[i], - ); - hatPaymentEditedTxs.push( - preparedPaymentTransactions.preparedStreamCreationTransactions[i], - ); - }); + preparedPaymentTransactions.preparedTokenApprovalsTransactions.forEach(tx => + hatPaymentEditedTxs.push(tx), + ); + preparedPaymentTransactions.preparedStreamCreationTransactions.forEach(tx => + hatPaymentEditedTxs.push(tx), + ); } const proposalTransactions = { diff --git a/src/i18n/locales/en/roles.json b/src/i18n/locales/en/roles.json index 846fd01b38..fdee444b58 100644 --- a/src/i18n/locales/en/roles.json +++ b/src/i18n/locales/en/roles.json @@ -56,6 +56,7 @@ "activePayments": "Active Payments", "payments": "Payments", "payment": "Payment", + "tipPaymentsDisabled": "Creating payments can be accessed after initializing roles. You need to create at least 1 role in order to create payments for it or for other roles.", "withdraw": "Withdraw", "available": "Available", "withdrawPendingMessage": "Withdrawing your payment, hang tight", From d4301986d1f04782d0f630554e7e8e0ead826bfd Mon Sep 17 00:00:00 2001 From: Kyrylo Klymenko Date: Wed, 28 Aug 2024 16:48:12 +0200 Subject: [PATCH 04/11] Revert changes in useCreateRoles --- src/hooks/utils/useCreateRoles.ts | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/hooks/utils/useCreateRoles.ts b/src/hooks/utils/useCreateRoles.ts index 0483848a00..a4c23a1df9 100644 --- a/src/hooks/utils/useCreateRoles.ts +++ b/src/hooks/utils/useCreateRoles.ts @@ -545,12 +545,14 @@ export default function useCreateRoles() { recipients, ); - preparedPaymentTransactions.preparedTokenApprovalsTransactions.forEach(tx => - hatPaymentAddedTxs.push(tx), - ); - preparedPaymentTransactions.preparedStreamCreationTransactions.forEach(tx => - hatPaymentAddedTxs.push(tx), - ); + streamsData.forEach((_, i) => { + hatPaymentAddedTxs.push( + preparedPaymentTransactions.preparedTokenApprovalsTransactions[i], + ); + hatPaymentAddedTxs.push( + preparedPaymentTransactions.preparedStreamCreationTransactions[i], + ); + }); } if (editedPayrollHats.length) { @@ -602,12 +604,14 @@ export default function useCreateRoles() { recipients, ); - preparedPaymentTransactions.preparedTokenApprovalsTransactions.forEach(tx => - hatPaymentEditedTxs.push(tx), - ); - preparedPaymentTransactions.preparedStreamCreationTransactions.forEach(tx => - hatPaymentEditedTxs.push(tx), - ); + streamsData.forEach((_, i) => { + hatPaymentEditedTxs.push( + preparedPaymentTransactions.preparedTokenApprovalsTransactions[i], + ); + hatPaymentEditedTxs.push( + preparedPaymentTransactions.preparedStreamCreationTransactions[i], + ); + }); } const proposalTransactions = { From e0233d8c598b55c7d0da902280ea5e933c5391c8 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:33:23 -0400 Subject: [PATCH 05/11] fix handling of multiple payments to match return of prepare function --- src/hooks/utils/useCreateRoles.ts | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/hooks/utils/useCreateRoles.ts b/src/hooks/utils/useCreateRoles.ts index e44da0bd4f..befd391fd9 100644 --- a/src/hooks/utils/useCreateRoles.ts +++ b/src/hooks/utils/useCreateRoles.ts @@ -663,14 +663,8 @@ export default function useCreateRoles() { if (addedPaymentStreams.length) { const preparedPaymentTransactions = prepareBatchLinearStreamCreation(addedPaymentStreams); - addedPaymentStreams.forEach((_, i) => { - hatPaymentAddedTxs.push( - preparedPaymentTransactions.preparedTokenApprovalsTransactions[i], - ); - hatPaymentAddedTxs.push( - preparedPaymentTransactions.preparedStreamCreationTransactions[i], - ); - }); + hatPaymentAddedTxs.push(...preparedPaymentTransactions.preparedTokenApprovalsTransactions); + hatPaymentAddedTxs.push(...preparedPaymentTransactions.preparedTokenApprovalsTransactions); } if (editedPaymentStreams.length) { @@ -733,14 +727,8 @@ export default function useCreateRoles() { const preparedPaymentTransactions = prepareBatchLinearStreamCreation(editedPaymentStreams); hatPaymentEditedTxs.push(...paymentCancelTxs); - editedPaymentStreams.forEach((_, i) => { - hatPaymentEditedTxs.push( - preparedPaymentTransactions.preparedTokenApprovalsTransactions[i], - ); - hatPaymentEditedTxs.push( - preparedPaymentTransactions.preparedStreamCreationTransactions[i], - ); - }); + hatPaymentEditedTxs.push(...preparedPaymentTransactions.preparedTokenApprovalsTransactions); + hatPaymentEditedTxs.push(...preparedPaymentTransactions.preparedStreamCreationTransactions); } const proposalTransactions = { From 4a0fb6a273638b8015ded4b047a31b87f144dde6 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:02:12 -0400 Subject: [PATCH 06/11] opps --- src/hooks/utils/useCreateRoles.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/utils/useCreateRoles.ts b/src/hooks/utils/useCreateRoles.ts index befd391fd9..bc69661d63 100644 --- a/src/hooks/utils/useCreateRoles.ts +++ b/src/hooks/utils/useCreateRoles.ts @@ -664,7 +664,7 @@ export default function useCreateRoles() { if (addedPaymentStreams.length) { const preparedPaymentTransactions = prepareBatchLinearStreamCreation(addedPaymentStreams); hatPaymentAddedTxs.push(...preparedPaymentTransactions.preparedTokenApprovalsTransactions); - hatPaymentAddedTxs.push(...preparedPaymentTransactions.preparedTokenApprovalsTransactions); + hatPaymentAddedTxs.push(...preparedPaymentTransactions.preparedStreamCreationTransactions); } if (editedPaymentStreams.length) { From d255ab7228fbd2c8302723391345e9f036094887 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:55:08 -0400 Subject: [PATCH 07/11] pass cliffDate in form payment display --- src/components/pages/Roles/forms/RoleFormPaymentStreams.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/pages/Roles/forms/RoleFormPaymentStreams.tsx b/src/components/pages/Roles/forms/RoleFormPaymentStreams.tsx index 7e03a8fa0c..797ea29a16 100644 --- a/src/components/pages/Roles/forms/RoleFormPaymentStreams.tsx +++ b/src/components/pages/Roles/forms/RoleFormPaymentStreams.tsx @@ -41,6 +41,7 @@ export function RoleFormPaymentStreams() { asset: payment.asset, endDate: payment.endDate, startDate: payment.startDate, + cliffDate: payment.cliffDate, isStreaming: () => false, }} onClick={() => { From 9314ab70ccc0fab09d4dbe4d64ad955adbf4a83f Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:33:59 -0400 Subject: [PATCH 08/11] switch to createWithTimestampsLL --- src/hooks/streams/useCreateSablierStream.ts | 14 ++++++------- src/hooks/utils/useCreateRoles.ts | 23 ++++++++++++++------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/hooks/streams/useCreateSablierStream.ts b/src/hooks/streams/useCreateSablierStream.ts index e4d8d51d97..1823012ee5 100644 --- a/src/hooks/streams/useCreateSablierStream.ts +++ b/src/hooks/streams/useCreateSablierStream.ts @@ -56,23 +56,20 @@ export default function useCreateSablierStream() { throw new Error('Start date of the stream can not be larger than end date'); } - let cliffDuration = 0; if (cliffDateTs) { if (cliffDateTs <= startDateTs) { throw new Error('Cliff date can not be less or equal than start date'); } else if (cliffDateTs >= endDateTs) { throw new Error('Cliff date can not be larger or equal than end date'); } - cliffDuration = Math.ceil((cliffDateTs - startDateTs) / 1000); } - const streamDuration = Math.ceil((endDateTs - startDateTs) / 1000); - return { ...prepareBasicStreamData(recipient, totalAmount), - durations: { - cliff: cliffDuration, - total: streamDuration + cliffDuration, // Total duration has to include cliff duration + timestamps: { + start: startDateTs, + end: endDateTs, + cliff: cliffDateTs, }, }; }, @@ -116,6 +113,7 @@ export default function useCreateSablierStream() { const assembledStreams: ReturnType[] = []; const streams = groupedStreams[assetAddress]; let totalStreamsAmount = 0n; + console.log("🚀 ~ assetAddress:", assetAddress) const tokenAddress = getAddress(assetAddress); streams.forEach(streamData => { totalStreamsAmount += streamData.totalAmount; @@ -126,7 +124,7 @@ export default function useCreateSablierStream() { preparedStreamCreationTransactions.push({ calldata: encodeFunctionData({ abi: SablierV2BatchAbi, - functionName: 'createWithDurationsLL', // @dev @todo Another option would be to use `createWithTimestampsLL`. Probably makes sense to change the logic to `createWithTimestampsLL` since we drifted away from "durations" and actually operating with timestamps always + functionName: 'createWithTimestampsLL', args: [sablierV2LockupLinear, tokenAddress, assembledStreams], }), targetAddress: sablierV2Batch, diff --git a/src/hooks/utils/useCreateRoles.ts b/src/hooks/utils/useCreateRoles.ts index bc69661d63..4d49ed95b1 100644 --- a/src/hooks/utils/useCreateRoles.ts +++ b/src/hooks/utils/useCreateRoles.ts @@ -174,7 +174,7 @@ const identifyAndPrepareEditedPaymentStreams = ( return modifiedHats.flatMap(formHat => { const currentHat = getHat(formHat.id); if (currentHat === null) { - throw new Error("Couldn't find existing Hat for edited payment stream Hat."); + return []; } if (formHat.payments === undefined) { @@ -211,9 +211,9 @@ const identifyAndPrepareEditedPaymentStreams = ( return { streamId: payment.streamId, recipient: currentHat.smartAddress, - startDateTs: payment.startDate.getTime(), - endDateTs: payment.endDate.getTime(), - cliffDateTs: payment.cliffDate?.getTime() ?? 0, + startDateTs: Math.floor(payment.startDate.getTime() / 1000), + endDateTs: Math.ceil(payment.endDate.getTime() / 1000), + cliffDateTs: Math.floor((payment.cliffDate?.getTime() ?? 0) / 1000), totalAmount: payment.amount.bigintValue, assetAddress: payment.asset.address, roleHatId: BigInt(currentHat.id), @@ -232,7 +232,7 @@ const identifyAndPrepareAddedPaymentStreams = async ( ): Promise => { const preparedStreamDataMapped = await Promise.all( modifiedHats.map(async formHat => { - if (formHat.payments === undefined || formHat.editedRole.status !== EditBadgeStatus.Updated) { + if (formHat.payments === undefined) { return []; } @@ -263,9 +263,9 @@ const identifyAndPrepareAddedPaymentStreams = async ( return { recipient: recipientAddress, - startDateTs: payment.startDate.getTime(), - endDateTs: payment.endDate.getTime(), - cliffDateTs: payment.cliffDate?.getTime() ?? 0, + startDateTs: Math.floor(payment.startDate.getTime() / 1000), + endDateTs: Math.ceil(payment.endDate.getTime() / 1000), + cliffDateTs: Math.floor((payment.cliffDate?.getTime() ?? 0) / 1000), totalAmount: payment.amount.bigintValue, assetAddress: payment.asset.address, }; @@ -731,6 +731,13 @@ export default function useCreateRoles() { hatPaymentEditedTxs.push(...preparedPaymentTransactions.preparedStreamCreationTransactions); } + console.log('🚀 ~ createAndMintHatsTxs:', createAndMintHatsTxs); + console.log("🚀 ~ transferHatTxs:", transferHatTxs) + console.log("🚀 ~ hatDetailsChangedTxs:", hatDetailsChangedTxs) + console.log("🚀 ~ hatPaymentAddedTxs:", hatPaymentAddedTxs) + console.log("🚀 ~ hatPaymentEditedTxs:", hatPaymentEditedTxs) + console.log("🚀 ~ smartAccountTxs:", smartAccountTxs) + console.log("🚀 ~ removeHatTxs:", removeHatTxs) const proposalTransactions = { targets: [ ...createAndMintHatsTxs.map(() => hatsProtocol), From 2ad95de89b986181610b117b6ceff14973b14375 Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:34:30 -0400 Subject: [PATCH 09/11] filter edited fields correctly --- src/components/pages/Roles/forms/useRoleFormEditedRole.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/pages/Roles/forms/useRoleFormEditedRole.tsx b/src/components/pages/Roles/forms/useRoleFormEditedRole.tsx index c6ef34b0b3..b18d156193 100644 --- a/src/components/pages/Roles/forms/useRoleFormEditedRole.tsx +++ b/src/components/pages/Roles/forms/useRoleFormEditedRole.tsx @@ -3,9 +3,11 @@ import { useMemo } from 'react'; import { DecentTree } from '../../../../store/roles'; import { EditedRole, EditBadgeStatus, RoleFormValues } from '../types'; -const addRemoveField = (fieldNames: string[], fieldName: string, isRemoved: boolean) => { - if (fieldNames.includes(fieldName) && isRemoved) { +const addRemoveField = (fieldNames: string[], fieldName: string, hasChanges: boolean) => { + if (fieldNames.includes(fieldName) && !hasChanges) { return fieldNames.filter(field => field !== fieldName); + } else if (!fieldNames.includes(fieldName) && !hasChanges) { + return fieldNames; } return [...fieldNames, fieldName]; }; @@ -72,6 +74,7 @@ export function useRoleFormEditedRole({ hatsTree }: { hatsTree: DecentTree | und fieldNames = addRemoveField(fieldNames, 'member', isMemberUpdated); fieldNames = addRemoveField(fieldNames, 'payments', isPaymentsUpdated); + console.log('🚀 ~ fieldNames:', fieldNames); return { fieldNames, status: EditBadgeStatus.Updated, From 4c90938a82c76eaacd96bb1abde4fb3f9aedfc4f Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:36:22 -0400 Subject: [PATCH 10/11] pretty --- src/hooks/streams/useCreateSablierStream.ts | 2 +- src/hooks/utils/useCreateRoles.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hooks/streams/useCreateSablierStream.ts b/src/hooks/streams/useCreateSablierStream.ts index 1823012ee5..3215bf77a4 100644 --- a/src/hooks/streams/useCreateSablierStream.ts +++ b/src/hooks/streams/useCreateSablierStream.ts @@ -113,7 +113,7 @@ export default function useCreateSablierStream() { const assembledStreams: ReturnType[] = []; const streams = groupedStreams[assetAddress]; let totalStreamsAmount = 0n; - console.log("🚀 ~ assetAddress:", assetAddress) + console.log('🚀 ~ assetAddress:', assetAddress); const tokenAddress = getAddress(assetAddress); streams.forEach(streamData => { totalStreamsAmount += streamData.totalAmount; diff --git a/src/hooks/utils/useCreateRoles.ts b/src/hooks/utils/useCreateRoles.ts index 4d49ed95b1..6aadac2f3c 100644 --- a/src/hooks/utils/useCreateRoles.ts +++ b/src/hooks/utils/useCreateRoles.ts @@ -213,7 +213,7 @@ const identifyAndPrepareEditedPaymentStreams = ( recipient: currentHat.smartAddress, startDateTs: Math.floor(payment.startDate.getTime() / 1000), endDateTs: Math.ceil(payment.endDate.getTime() / 1000), - cliffDateTs: Math.floor((payment.cliffDate?.getTime() ?? 0) / 1000), + cliffDateTs: Math.floor((payment.cliffDate?.getTime() ?? 0) / 1000), totalAmount: payment.amount.bigintValue, assetAddress: payment.asset.address, roleHatId: BigInt(currentHat.id), @@ -265,7 +265,7 @@ const identifyAndPrepareAddedPaymentStreams = async ( recipient: recipientAddress, startDateTs: Math.floor(payment.startDate.getTime() / 1000), endDateTs: Math.ceil(payment.endDate.getTime() / 1000), - cliffDateTs: Math.floor((payment.cliffDate?.getTime() ?? 0) / 1000), + cliffDateTs: Math.floor((payment.cliffDate?.getTime() ?? 0) / 1000), totalAmount: payment.amount.bigintValue, assetAddress: payment.asset.address, }; @@ -732,12 +732,12 @@ export default function useCreateRoles() { } console.log('🚀 ~ createAndMintHatsTxs:', createAndMintHatsTxs); - console.log("🚀 ~ transferHatTxs:", transferHatTxs) - console.log("🚀 ~ hatDetailsChangedTxs:", hatDetailsChangedTxs) - console.log("🚀 ~ hatPaymentAddedTxs:", hatPaymentAddedTxs) - console.log("🚀 ~ hatPaymentEditedTxs:", hatPaymentEditedTxs) - console.log("🚀 ~ smartAccountTxs:", smartAccountTxs) - console.log("🚀 ~ removeHatTxs:", removeHatTxs) + console.log('🚀 ~ transferHatTxs:', transferHatTxs); + console.log('🚀 ~ hatDetailsChangedTxs:', hatDetailsChangedTxs); + console.log('🚀 ~ hatPaymentAddedTxs:', hatPaymentAddedTxs); + console.log('🚀 ~ hatPaymentEditedTxs:', hatPaymentEditedTxs); + console.log('🚀 ~ smartAccountTxs:', smartAccountTxs); + console.log('🚀 ~ removeHatTxs:', removeHatTxs); const proposalTransactions = { targets: [ ...createAndMintHatsTxs.map(() => hatsProtocol), From cddd759f413e40d64fafcc5a06cfb1493640ed5c Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:40:13 -0400 Subject: [PATCH 11/11] Remove console log statements --- src/components/pages/Roles/forms/useRoleFormEditedRole.tsx | 1 - src/hooks/streams/useCreateSablierStream.ts | 1 - src/hooks/utils/useCreateRoles.ts | 7 ------- 3 files changed, 9 deletions(-) diff --git a/src/components/pages/Roles/forms/useRoleFormEditedRole.tsx b/src/components/pages/Roles/forms/useRoleFormEditedRole.tsx index b18d156193..137da62695 100644 --- a/src/components/pages/Roles/forms/useRoleFormEditedRole.tsx +++ b/src/components/pages/Roles/forms/useRoleFormEditedRole.tsx @@ -74,7 +74,6 @@ export function useRoleFormEditedRole({ hatsTree }: { hatsTree: DecentTree | und fieldNames = addRemoveField(fieldNames, 'member', isMemberUpdated); fieldNames = addRemoveField(fieldNames, 'payments', isPaymentsUpdated); - console.log('🚀 ~ fieldNames:', fieldNames); return { fieldNames, status: EditBadgeStatus.Updated, diff --git a/src/hooks/streams/useCreateSablierStream.ts b/src/hooks/streams/useCreateSablierStream.ts index 3215bf77a4..0af300e021 100644 --- a/src/hooks/streams/useCreateSablierStream.ts +++ b/src/hooks/streams/useCreateSablierStream.ts @@ -113,7 +113,6 @@ export default function useCreateSablierStream() { const assembledStreams: ReturnType[] = []; const streams = groupedStreams[assetAddress]; let totalStreamsAmount = 0n; - console.log('🚀 ~ assetAddress:', assetAddress); const tokenAddress = getAddress(assetAddress); streams.forEach(streamData => { totalStreamsAmount += streamData.totalAmount; diff --git a/src/hooks/utils/useCreateRoles.ts b/src/hooks/utils/useCreateRoles.ts index 6aadac2f3c..c938755a2c 100644 --- a/src/hooks/utils/useCreateRoles.ts +++ b/src/hooks/utils/useCreateRoles.ts @@ -731,13 +731,6 @@ export default function useCreateRoles() { hatPaymentEditedTxs.push(...preparedPaymentTransactions.preparedStreamCreationTransactions); } - console.log('🚀 ~ createAndMintHatsTxs:', createAndMintHatsTxs); - console.log('🚀 ~ transferHatTxs:', transferHatTxs); - console.log('🚀 ~ hatDetailsChangedTxs:', hatDetailsChangedTxs); - console.log('🚀 ~ hatPaymentAddedTxs:', hatPaymentAddedTxs); - console.log('🚀 ~ hatPaymentEditedTxs:', hatPaymentEditedTxs); - console.log('🚀 ~ smartAccountTxs:', smartAccountTxs); - console.log('🚀 ~ removeHatTxs:', removeHatTxs); const proposalTransactions = { targets: [ ...createAndMintHatsTxs.map(() => hatsProtocol),