Skip to content

Commit

Permalink
feat: add bump on disperse
Browse files Browse the repository at this point in the history
  • Loading branch information
w84april committed Mar 14, 2024
1 parent a90a1ca commit ff5c6ee
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions components/sections/Disperse/Wizard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import React, {useCallback, useMemo, useState} from 'react';
import {Button} from 'components/Primitives/Button';
import {useAddressBook} from 'contexts/useAddressBook';
import {approveERC20, disperseERC20, disperseETH} from 'utils/actions';
import {notifyDisperse} from 'utils/notifier';
import {getTransferTransaction} from 'utils/tools.gnosis';
import {erc20ABI, useContractRead} from 'wagmi';
import useWallet from '@builtbymom/web3/contexts/useWallet';
import {useWeb3} from '@builtbymom/web3/contexts/useWeb3';
import {useChainID} from '@builtbymom/web3/hooks/useChainID';
import {formatAmount, isZeroAddress, toAddress, toBigInt, toNormalizedValue} from '@builtbymom/web3/utils';
import {
formatAmount,
isZeroAddress,
slugify,
toAddress,
toBigInt,
toNormalizedValue,
truncateHex
} from '@builtbymom/web3/utils';
import {defaultTxStatus} from '@builtbymom/web3/utils/wagmi/transaction';
import {useSafeAppsSDK} from '@gnosis.pm/safe-apps-react-sdk';
import {toast} from '@yearn-finance/web-lib/components/yToast';
Expand Down Expand Up @@ -105,6 +114,7 @@ const useConfirmDisperse = ({
const {address, provider, isWalletSafe} = useWeb3();
const {safeChainID} = useChainID();
const {configuration} = useDisperse();
const {bumpEntryInteractions} = useAddressBook();
const {onRefresh} = useWallet();
const {sdk} = useSafeAppsSDK();

Expand Down Expand Up @@ -206,6 +216,14 @@ const useConfirmDisperse = ({
chainID: safeChainID
}
]);
disperseAddresses.forEach(address => {
bumpEntryInteractions({
address: address,
label: truncateHex(address, 5),
chains: [safeChainID],
slugifiedLabel: slugify(address)
});
});
if (result.receipt) {
notifyDisperse({
chainID: safeChainID,
Expand Down Expand Up @@ -241,6 +259,14 @@ const useConfirmDisperse = ({
chainID: Number(configuration.tokenToSend?.chainID)
}
]);
disperseAddresses.forEach(address => {
bumpEntryInteractions({
address: address,
label: truncateHex(address, 5),
chains: [safeChainID],
slugifiedLabel: slugify(address)
});
});
if (result.receipt) {
notifyDisperse({
chainID: safeChainID,
Expand All @@ -267,7 +293,8 @@ const useConfirmDisperse = ({
safeChainID,
onError,
onSuccess,
onRefresh
onRefresh,
bumpEntryInteractions
]);

return {onDisperseTokens};
Expand Down

0 comments on commit ff5c6ee

Please sign in to comment.