Skip to content

Commit

Permalink
feat: veYFI test
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Oct 16, 2023
1 parent 1133fd6 commit 2a8a297
Show file tree
Hide file tree
Showing 16 changed files with 301 additions and 263 deletions.
8 changes: 7 additions & 1 deletion apps/common/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ export function Table<T>({metadata, data, columns, initialSortBy, onRowClick, it
onClick={(): void => onRowClick?.(item)}
>
{metadata.map(({key, label, className, fullWidth, columnSpan, format, transform}): ReactElement => {
const isNumber = !isNaN(item[key] as number);
let isNumberLike = false;
if (typeof item[key] === 'bigint') {
isNumberLike = true;
} else {
isNumberLike = !isNaN(Number(item[key]));
}
const isNumber = isNumberLike;

return (
<div
Expand Down
16 changes: 15 additions & 1 deletion apps/common/contexts/useWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createContext, memo, useCallback, useContext, useEffect, useMemo, useState} from 'react';
import {useChainId} from 'wagmi';
import {OPT_YVSTERN_ERN_STAKING_CONTRACT, OPT_YVAGEUR_USDC_STAKING_CONTRACT, OPT_YVALETH_FRXETH_STAKING_CONTRACT, OPT_YVALETH_WETH_STAKING_CONTRACT, OPT_YVALUSD_FRAX_STAKING_CONTRACT, OPT_YVALUSD_USDC_STAKING_CONTRACT, OPT_YVDAI_STAKING_CONTRACT, OPT_YVDOLA_USDC_STAKING_CONTRACT, OPT_YVDOLAUSDC_STAKING_CONTRACT, OPT_YVERN_DOLA_STAKING_CONTRACT, OPT_YVERN_LUSD_STAKING_CONTRACT, OPT_YVETH_STAKING_CONTRACT, OPT_YVEXA_WETH_STAKING_CONTRACT, OPT_YVFRAX_DOLA_STAKING_CONTRACT, OPT_YVIB_WETH_STAKING_CONTRACT, OPT_YVLDO_WSTETH_STAKING_CONTRACT, OPT_YVLUSD_WETH_STAKING_CONTRACT, OPT_YVMAI_ALUSD_STAKING_CONTRACT, OPT_YVMAI_DOLA_STAKING_CONTRACT, OPT_YVMAI_STAKING_CONTRACT, OPT_YVMAI_USDC_STAKING_CONTRACT, OPT_YVMAIUSDC_STAKING_CONTRACT, OPT_YVMIM_USDC_STAKING_CONTRACT, OPT_YVMTA_USDC_STAKING_CONTRACT, OPT_YVOP_USDC_STAKING_CONTRACT, OPT_YVOP_VELO_STAKING_CONTRACT, OPT_YVOP_WETH_STAKING_CONTRACT, OPT_YVSNX_USDC_STAKING_CONTRACT, OPT_YVSUSCUSDC_STAKING_CONTRACT, OPT_YVTBTC_WBTC_STAKING_CONTRACT, OPT_YVTBTC_WETH_STAKING_CONTRACT, OPT_YVUSDC_STAKING_CONTRACT, OPT_YVUSDT_STAKING_CONTRACT, OPT_YVVELO_USDC_STAKING_CONTRACT, OPT_YVWUSDR_USDC_STAKING_CONTRACT, OPT_YVWUSDRV2_USDC_STAKING_CONTRACT, STACKING_TO_VAULT} from '@vaults/constants/optRewards';
import {OPT_YVAGEUR_USDC_STAKING_CONTRACT, OPT_YVALETH_FRXETH_STAKING_CONTRACT, OPT_YVALETH_WETH_STAKING_CONTRACT, OPT_YVALUSD_FRAX_STAKING_CONTRACT, OPT_YVALUSD_USDC_STAKING_CONTRACT, OPT_YVDAI_STAKING_CONTRACT, OPT_YVDOLA_USDC_STAKING_CONTRACT, OPT_YVDOLAUSDC_STAKING_CONTRACT, OPT_YVERN_DOLA_STAKING_CONTRACT, OPT_YVERN_LUSD_STAKING_CONTRACT, OPT_YVETH_STAKING_CONTRACT, OPT_YVEXA_WETH_STAKING_CONTRACT, OPT_YVFRAX_DOLA_STAKING_CONTRACT, OPT_YVIB_WETH_STAKING_CONTRACT, OPT_YVLDO_WSTETH_STAKING_CONTRACT, OPT_YVLUSD_WETH_STAKING_CONTRACT, OPT_YVMAI_ALUSD_STAKING_CONTRACT, OPT_YVMAI_DOLA_STAKING_CONTRACT, OPT_YVMAI_STAKING_CONTRACT, OPT_YVMAI_USDC_STAKING_CONTRACT, OPT_YVMAIUSDC_STAKING_CONTRACT, OPT_YVMIM_USDC_STAKING_CONTRACT, OPT_YVMTA_USDC_STAKING_CONTRACT, OPT_YVOP_USDC_STAKING_CONTRACT, OPT_YVOP_VELO_STAKING_CONTRACT, OPT_YVOP_WETH_STAKING_CONTRACT, OPT_YVSNX_USDC_STAKING_CONTRACT, OPT_YVSTERN_ERN_STAKING_CONTRACT, OPT_YVSUSCUSDC_STAKING_CONTRACT, OPT_YVTBTC_WBTC_STAKING_CONTRACT, OPT_YVTBTC_WETH_STAKING_CONTRACT, OPT_YVUSDC_STAKING_CONTRACT, OPT_YVUSDT_STAKING_CONTRACT, OPT_YVVELO_USDC_STAKING_CONTRACT, OPT_YVWUSDR_USDC_STAKING_CONTRACT, OPT_YVWUSDRV2_USDC_STAKING_CONTRACT, STACKING_TO_VAULT} from '@vaults/constants/optRewards';
import {useUI} from '@yearn-finance/web-lib/contexts/useUI';
import {useBalances} from '@yearn-finance/web-lib/hooks/useBalances';
import {toAddress} from '@yearn-finance/web-lib/utils/address';
Expand Down Expand Up @@ -105,6 +105,20 @@ export const WalletContextApp = memo(function WalletContextApp({children}: {chil
extraTokens.push({token: OPT_YVWUSDRV2_USDC_STAKING_CONTRACT, symbol: 'yvVelo-wUSDRv2-USDC', decimals: 18});
extraTokens.push({token: OPT_YVSTERN_ERN_STAKING_CONTRACT, symbol: 'yvVelo-stERN-ERN', decimals: 18});
}
if (safeChainID === 250) {
extraTokens.push(...[
{token: toAddress('0x28D374F0cdabb327A034BA41B9A2967E2959fb1F')}, //TODO: Remove it - veYFI test
{token: toAddress('0xb8E45b5C3E49A9a4C2A086deAF59f7De19c100cC')}, //TODO: Remove it - veYFI test
{token: toAddress('0x2Cc4b29771fcAA71313dC946a89eDd1AA68292E2')}, //TODO: Remove it - veYFI test
{token: toAddress('0x9Cb511D44930c0C3D3114FFAaBedC3e0876D791a')}, //TODO: Remove it - veYFI test
{token: toAddress('0xC85509a31F218e66A7151A48e218AD98469Cbf4A')}, //TODO: Remove it - veYFI test
{token: toAddress('0x52Ca0fC251e7a28cf8E67357BCD3d771B105eCa9')}, //TODO: Remove it - veYFI test
{token: toAddress('0xbADfbF563C6C85F76e086E7a1915A1A46d683810')}, //TODO: Remove it - veYFI test
{token: toAddress('0xd5947C01dBaEFeFF05186FE34A976b2E28d90542')}, //TODO: Remove it - veYFI test
{token: toAddress('0x2262ef7F5A0171D9dBC16963727249787575cE42')}, //TODO: Remove it - veYFI test
{token: toAddress('0x79a37e400bC591f1B38e4Fe020Ec1f985F670218')} //TODO: Remove it - veYFI test
]);
}
for (const token of extraTokens) {
tokensExists[token.token] = true;
tokens.push(token);
Expand Down
2 changes: 1 addition & 1 deletion apps/common/schemas/yDaemonVaultsSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const yDaemonVaultTokenSchema = z.object({

export const yDaemonVaultSchema = z.object({
address: addressSchema,
type: z.literal('Automated').or(z.literal('Standard').or(z.literal('Experimental'))),
type: z.literal('Automated').or(z.literal('Standard').or(z.literal('Experimental').or(z.literal('Automated Yearn Vault').or(z.literal('Yearn Vault'))))),
symbol: z.string(),
display_symbol: z.string(),
formated_symbol: z.string(),
Expand Down
2 changes: 2 additions & 0 deletions apps/common/utils/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ export async function isApprovedERC20(
******************************************************************************/
type TAllowanceOf = {
connector: Connector | undefined,
chainID: number,
tokenAddress: TAddress,
spenderAddress: TAddress
}
export async function allowanceOf(props: TAllowanceOf): Promise<bigint> {
const wagmiProvider = await toWagmiProvider(props.connector);
const result = await readContract({
...wagmiProvider,
chainId: props.chainID,
abi: erc20ABI,
address: props.tokenAddress,
functionName: 'allowance',
Expand Down
2 changes: 2 additions & 0 deletions apps/veyfi/components/ClaimTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {useCallback, useState} from 'react';
import {formatUnits} from 'viem';
import {useVotingEscrow} from '@veYFI/contexts/useVotingEscrow';
import {withdrawUnlockedVeYFI} from '@veYFI/utils/actions';
import {VEYFI_CHAIN_ID} from '@veYFI/utils/constants';
import {validateNetwork} from '@veYFI/utils/validations';
import {Button} from '@yearn-finance/web-lib/components/Button';
import {useWeb3} from '@yearn-finance/web-lib/contexts/useWeb3';
Expand Down Expand Up @@ -33,6 +34,7 @@ export function ClaimTab(): ReactElement {
const onWithdrawUnlocked = useCallback(async (): Promise<void> => {
const result = await withdrawUnlockedVeYFI({
connector: provider,
chainID: VEYFI_CHAIN_ID,

Check failure on line 37 in apps/veyfi/components/ClaimTab.tsx

View workflow job for this annotation

GitHub Actions / Test Build

Argument of type '{ connector: Connector<any, any> | undefined; chainID: number; contractAddress: `0x${string}` | undefined; statusHandler: Dispatch<SetStateAction<{ none: boolean; pending: boolean; success: boolean; error: boolean; }>>; }' is not assignable to parameter of type 'TWriteTransaction'.
contractAddress: votingEscrow?.address,
statusHandler: set_withdrawUnlockedStatus
});
Expand Down
168 changes: 83 additions & 85 deletions apps/veyfi/components/GaugesTab.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {useCallback, useState} from 'react';
import {useGauge} from '@veYFI/contexts/useGauge';
import * as GaugeActions from '@veYFI/utils/actions/gauge';
import {approveAndStake, stake, unstake} from '@veYFI/utils/actions/gauge';
import {VEYFI_CHAIN_ID} from '@veYFI/utils/constants';
import {validateNetwork} from '@veYFI/utils/validations';
import {Button} from '@yearn-finance/web-lib/components/Button';
import {useWeb3} from '@yearn-finance/web-lib/contexts/useWeb3';
import {allowanceKey, toAddress} from '@yearn-finance/web-lib/utils/address';
import {formatBigNumberAsAmount, toBigInt, toNormalizedValue} from '@yearn-finance/web-lib/utils/format.bigNumber';
import {allowanceKey, toAddress, truncateHex} from '@yearn-finance/web-lib/utils/address';
import {toBigInt, toNormalizedBN} from '@yearn-finance/web-lib/utils/format.bigNumber';
import {formatAmount, formatPercent} from '@yearn-finance/web-lib/utils/format.number';
import {isZero} from '@yearn-finance/web-lib/utils/isZero';
import {defaultTxStatus} from '@yearn-finance/web-lib/utils/web3/transaction';
import {ImageWithFallback} from '@common/components/ImageWithFallback';
import {Table} from '@common/components/Table';
Expand All @@ -16,6 +16,7 @@ import {useYearn} from '@common/contexts/useYearn';

import type {ReactElement} from 'react';
import type {TAddress} from '@yearn-finance/web-lib/types';
import type {TNormalizedBN} from '@yearn-finance/web-lib/utils/format.bigNumber';

type TGaugeData = {
gaugeAddress: TAddress,
Expand All @@ -24,58 +25,30 @@ type TGaugeData = {
vaultIcon: string,
vaultName: string,
vaultApy: number,
vaultDeposited: bigint,
vaultDeposited: TNormalizedBN,
gaugeApy: number,
gaugeBoost: number,
gaugeStaked: bigint,
allowance: bigint,
gaugeStaked: TNormalizedBN,
allowance: TNormalizedBN,
isApproved: boolean,
actions: undefined
}

export function GaugesTab(): ReactElement {
const [selectedGauge, set_selectedGauge] = useState('');
const [selectedAction, set_selectedAction] = useState<'stake' | 'unstake' | undefined>();
function GaugeTabButtons({isApproved, vaultAddress, gaugeAddress, vaultDeposited, gaugeStaked}: TGaugeData): ReactElement {
const {provider, address, isActive, chainID} = useWeb3();
const {gaugeAddresses, gaugesMap, positionsMap, allowancesMap, refresh: refreshGauges, isLoading: isLoadingGauges} = useGauge();
const {vaults} = useYearn();
const {balances, refresh: refreshBalances} = useWallet();
const {refresh: refreshGauges} = useGauge();
const {refresh: refreshBalances} = useWallet();
const refreshData = (): unknown => Promise.all([refreshGauges(), refreshBalances()]);
const [approveAndStakeStatus, set_approveAndStakeStatus] = useState(defaultTxStatus);
const [stakeStatus, set_stakeStatus] = useState(defaultTxStatus);
const [unstakeStatus, set_unstakeStatus] = useState(defaultTxStatus);

const userAddress = address as TAddress;

const gaugesData = gaugeAddresses.map((address): TGaugeData => {
const gauge = gaugesMap[address];
const vaultAddress = toAddress(gauge?.vaultAddress);
const vault = vaults[vaultAddress];

return {
gaugeAddress: address,
vaultAddress,
decimals: gauge?.decimals ?? 18,
vaultIcon: `${process.env.BASE_YEARN_ASSETS_URI}/1/${vaultAddress}/logo-128.png`,
vaultName: vault?.display_name ?? '',
vaultApy: vault?.apy.net_apy ?? 0,
vaultDeposited: toBigInt(formatBigNumberAsAmount(balances[vaultAddress]?.raw)),
gaugeApy: 0, // TODO: gauge apy calcs
gaugeBoost: positionsMap[address]?.boost ?? 1,
gaugeStaked: toBigInt(formatBigNumberAsAmount(positionsMap[address]?.deposit.balance)),
allowance: toBigInt(formatBigNumberAsAmount(allowancesMap[allowanceKey(1, vaultAddress, address, userAddress)])),
isApproved: toBigInt(formatBigNumberAsAmount(allowancesMap[allowanceKey(1, vaultAddress, address, userAddress)])) >= toBigInt(formatBigNumberAsAmount(balances[vaultAddress]?.raw)),
actions: undefined
};
});

const {isValid: isValidNetwork} = validateNetwork({supportedNetwork: 1, walletNetwork: chainID});
const {isValid: isValidNetwork} = validateNetwork({supportedNetwork: VEYFI_CHAIN_ID, walletNetwork: chainID});

const onApproveAndStake = useCallback(async (vaultAddress: TAddress, gaugeAddress: TAddress, amount: bigint): Promise<void> => {
set_selectedGauge(gaugeAddress);
set_selectedAction('stake');
const response = await GaugeActions.approveAndStake({
const response = await approveAndStake({
connector: provider,
chainID: VEYFI_CHAIN_ID,

Check failure on line 51 in apps/veyfi/components/GaugesTab.tsx

View workflow job for this annotation

GitHub Actions / Test Build

Argument of type '{ connector: Connector<any, any> | undefined; chainID: number; contractAddress: `0x${string}`; vaultAddress: `0x${string}`; amount: bigint; statusHandler: Dispatch<SetStateAction<{ none: boolean; pending: boolean; success: boolean; error: boolean; }>>; }' is not assignable to parameter of type 'TApproveAndStake'.
contractAddress: gaugeAddress,
vaultAddress,
amount,
Expand All @@ -88,11 +61,9 @@ export function GaugesTab(): ReactElement {
}, [provider, refreshData]);

const onStake = useCallback(async (gaugeAddress: TAddress, amount: bigint): Promise<void> => {
set_selectedGauge(gaugeAddress);
set_selectedAction('stake');

const response = await GaugeActions.stake({
const response = await stake({
connector: provider,
chainID: VEYFI_CHAIN_ID,
contractAddress: gaugeAddress,
amount,
statusHandler: set_stakeStatus
Expand All @@ -104,11 +75,9 @@ export function GaugesTab(): ReactElement {
}, [provider, refreshData]);

const onUnstake = useCallback(async (gaugeAddress: TAddress, amount: bigint): Promise<void> => {
set_selectedGauge(gaugeAddress);
set_selectedAction('unstake');

const response = await GaugeActions.unstake({
const response = await unstake({
connector: provider,
chainID: VEYFI_CHAIN_ID,
contractAddress: gaugeAddress,
accountAddress: userAddress,
amount,
Expand All @@ -120,6 +89,66 @@ export function GaugesTab(): ReactElement {
}
}, [provider, refreshData, userAddress]);

return (
<div className={'flex flex-row justify-center space-x-2 md:justify-end'}>
<Button
className={'w-full md:w-24'}
onClick={async (): Promise<void> => onUnstake(gaugeAddress, toBigInt(gaugeStaked.raw))}
isDisabled={!isActive || !isValidNetwork || toBigInt(gaugeStaked.raw) == 0n}
isBusy={unstakeStatus.pending}>
{'Unstake'}
</Button>
{!isApproved && (
<Button
className={'w-full md:w-24'}
onClick={async (): Promise<void> => onApproveAndStake(vaultAddress, gaugeAddress, toBigInt(vaultDeposited?.raw))}
isDisabled={!isActive || !isValidNetwork || toBigInt(vaultDeposited?.raw) == 0n}
isBusy={approveAndStakeStatus.pending}>
{'Approve'}
</Button>
)}
{isApproved && (
<Button
className={'w-full md:w-24'}
onClick={async (): Promise<void> => onStake(gaugeAddress, toBigInt(vaultDeposited?.raw))}
isDisabled={!isActive || !isValidNetwork || toBigInt(vaultDeposited?.raw) == 0n}
isBusy={stakeStatus.pending}>
{'Stake'}
</Button>
)}
</div>
);
}

export function GaugesTab(): ReactElement {
const {address} = useWeb3();
const {gaugeAddresses, gaugesMap, positionsMap, allowancesMap} = useGauge();
const {vaults} = useYearn();
const {balances} = useWallet();
const userAddress = address as TAddress;

const gaugesData = gaugeAddresses.map((address): TGaugeData => {
const gauge = gaugesMap[address];
const vaultAddress = toAddress(gauge?.vaultAddress);
const vault = vaults[vaultAddress];

return {
gaugeAddress: address,
vaultAddress,
decimals: gauge?.decimals ?? 18,
vaultIcon: `${process.env.BASE_YEARN_ASSETS_URI}/1/${vaultAddress}/logo-128.png`,
vaultName: vault?.display_name ?? `Vault ${truncateHex(vaultAddress, 4)}`,
vaultApy: vault?.apy.net_apy ?? 0,
vaultDeposited: balances[vaultAddress],
gaugeApy: 0, // TODO: gauge apy calcs
gaugeBoost: positionsMap[address]?.boost ?? 1,
gaugeStaked: positionsMap[address]?.deposit.balance ?? toNormalizedBN(0),
allowance: allowancesMap[allowanceKey(1, vaultAddress, address, userAddress)],
isApproved: toBigInt(allowancesMap[allowanceKey(1, vaultAddress, address, userAddress)]?.raw) >= toBigInt(balances[vaultAddress]?.raw),
actions: undefined
};
});

return (
<div className={'relative -left-6 w-[calc(100%+48px)]'}>
<Table
Expand Down Expand Up @@ -155,9 +184,9 @@ export function GaugesTab(): ReactElement {
},
{
key: 'vaultDeposited',
label: 'Deposited in Vault',
label: 'Deposited',
sortable: true,
format: ({vaultDeposited, decimals}): string => formatAmount(toNormalizedValue(vaultDeposited, decimals))
format: ({vaultDeposited}): string => formatAmount(vaultDeposited?.normalized || 0, 2, 6)
},
{
key: 'gaugeApy',
Expand All @@ -172,48 +201,17 @@ export function GaugesTab(): ReactElement {
},
{
key: 'gaugeStaked',
label: 'Staked in Gauge',
label: 'Staked',
sortable: true,
format: ({gaugeStaked, decimals}): string => formatAmount(toNormalizedValue(gaugeStaked, decimals))
format: ({gaugeStaked}): string => formatAmount(gaugeStaked?.normalized || 0, 2, 6)
},
{
key: 'actions',
label: '',
columnSpan: 2,
fullWidth: true,
className: 'my-4 md:my-0',
transform: ({isApproved, vaultAddress, gaugeAddress, vaultDeposited, gaugeStaked}): ReactElement => (
<div className={'flex flex-row justify-center space-x-2 md:justify-end'}>
<Button
className={'w-full md:w-24'}
onClick={async (): Promise<void> => onUnstake(gaugeAddress, gaugeStaked)}
isDisabled={!isActive || !isValidNetwork || isZero(gaugeStaked)}
isBusy={gaugeAddress === selectedGauge && selectedAction === 'unstake' && unstakeStatus.none}
>
{'Unstake'}
</Button>
{!isApproved && (
<Button
className={'w-full md:w-24'}
onClick={async (): Promise<void> => onApproveAndStake(vaultAddress, gaugeAddress, vaultDeposited)}
isDisabled={!isActive || !isValidNetwork || isZero(vaultDeposited)}
isBusy={(isLoadingGauges && vaultDeposited > 0n) || (gaugeAddress === selectedGauge && selectedAction === 'stake' && approveAndStakeStatus.none)}
>
{'Stake'}
</Button>
)}
{isApproved && (
<Button
className={'w-full md:w-24'}
onClick={async (): Promise<void> => onStake(gaugeAddress, vaultDeposited)}
isDisabled={!isActive || !isValidNetwork || isZero(vaultDeposited)}
isBusy={(isLoadingGauges && vaultDeposited > 0n) || (gaugeAddress === selectedGauge && selectedAction === 'stake' && stakeStatus.none)}
>
{'Stake'}
</Button>
)}
</div>
)
transform: (props): ReactElement => <GaugeTabButtons {...props} />
}
]}
data={gaugesData}
Expand Down
5 changes: 4 additions & 1 deletion apps/veyfi/components/LockTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {formatUnits} from 'viem';
import {useVotingEscrow} from '@veYFI/contexts/useVotingEscrow';
import {getVotingPower} from '@veYFI/utils';
import {increaseVeYFILockAmount, lockVeYFI} from '@veYFI/utils/actions';
import {MAX_LOCK_TIME, MIN_LOCK_AMOUNT, MIN_LOCK_TIME} from '@veYFI/utils/constants';
import {MAX_LOCK_TIME, MIN_LOCK_AMOUNT, MIN_LOCK_TIME, VEYFI_CHAIN_ID} from '@veYFI/utils/constants';
import {validateAllowance, validateAmount, validateNetwork} from '@veYFI/utils/validations';
import {Button} from '@yearn-finance/web-lib/components/Button';
import {useWeb3} from '@yearn-finance/web-lib/contexts/useWeb3';
Expand Down Expand Up @@ -55,6 +55,7 @@ export function LockTab(): ReactElement {
const onApproveLock = useCallback(async (): Promise<void> => {
const result = await approveERC20({
connector: provider,
chainID: VEYFI_CHAIN_ID,
contractAddress: votingEscrow?.token,
spenderAddress: votingEscrow?.address,
statusHandler: set_approveLockStatus,
Expand All @@ -68,6 +69,7 @@ export function LockTab(): ReactElement {
const onLock = useCallback(async (): Promise<void> => {
const result = await lockVeYFI({
connector: provider,
chainID: VEYFI_CHAIN_ID,
contractAddress: votingEscrow?.address,
amount: lockAmount.raw,
time: toBigInt(toSeconds(unlockTime)),
Expand All @@ -81,6 +83,7 @@ export function LockTab(): ReactElement {
const onIncreaseLockAmount = useCallback(async (): Promise<void> => {
const result = await increaseVeYFILockAmount({
connector: provider,
chainID: VEYFI_CHAIN_ID,
contractAddress: votingEscrow?.address,
amount: lockAmount.raw,
statusHandler: set_increaseLockAmountStatus
Expand Down
Loading

0 comments on commit 2a8a297

Please sign in to comment.