diff --git a/src/views/Lending/Cooler/hooks/useCreateLoan.tsx b/src/views/Lending/Cooler/hooks/useCreateLoan.tsx index fe733873c7..894e868f15 100644 --- a/src/views/Lending/Cooler/hooks/useCreateLoan.tsx +++ b/src/views/Lending/Cooler/hooks/useCreateLoan.tsx @@ -1,4 +1,5 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { BigNumber } from "ethers"; import toast from "react-hot-toast"; import { DecimalBigNumber } from "src/helpers/DecimalBigNumber/DecimalBigNumber"; import { balanceQueryKey } from "src/hooks/useBalance"; @@ -22,7 +23,9 @@ export const useCreateLoan = () => { }) => { if (!signer) throw new Error(`Please connect a wallet`); const contract = CoolerClearingHouse__factory.connect(clearingHouseAddress, signer); - const loan = await contract.lendToCooler(coolerAddress, borrowAmount.toBigNumber(18)); + const loan = await contract.lendToCooler(coolerAddress, borrowAmount.toBigNumber(18), { + gasLimit: BigNumber.from("1000000"), + }); const receipt = await loan.wait(); return receipt; }, diff --git a/src/views/Lending/Cooler/hooks/useExtendLoan.tsx b/src/views/Lending/Cooler/hooks/useExtendLoan.tsx index 0dabc2187d..e6ad1b4ed6 100644 --- a/src/views/Lending/Cooler/hooks/useExtendLoan.tsx +++ b/src/views/Lending/Cooler/hooks/useExtendLoan.tsx @@ -1,4 +1,5 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { BigNumber } from "ethers"; import toast from "react-hot-toast"; import { balanceQueryKey } from "src/hooks/useBalance"; import { contractAllowanceQueryKey } from "src/hooks/useContractAllowance"; @@ -23,7 +24,9 @@ export const useExtendLoan = () => { }) => { if (!signer) throw new Error(`Please connect a wallet`); const contract = CoolerClearingHouse__factory.connect(clearingHouseAddress, signer); - const loan = await contract.extendLoan(coolerAddress, loanId, times); + const loan = await contract.extendLoan(coolerAddress, loanId, times, { + gasLimit: BigNumber.from("1000000"), + }); const receipt = await loan.wait(); return receipt; }, diff --git a/src/views/Lending/Cooler/hooks/useRepayLoan.tsx b/src/views/Lending/Cooler/hooks/useRepayLoan.tsx index 677485c694..3f467c41d7 100644 --- a/src/views/Lending/Cooler/hooks/useRepayLoan.tsx +++ b/src/views/Lending/Cooler/hooks/useRepayLoan.tsx @@ -1,4 +1,5 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { BigNumber } from "ethers"; import toast from "react-hot-toast"; import { DecimalBigNumber } from "src/helpers/DecimalBigNumber/DecimalBigNumber"; import { balanceQueryKey } from "src/hooks/useBalance"; @@ -15,7 +16,9 @@ export const useRepayLoan = () => { if (!signer) throw new Error(`Please connect a wallet`); const coolerContract = Cooler__factory.connect(coolerAddress, signer); - const loan = await coolerContract.repayLoan(loanId, amount.toBigNumber(18)); + const loan = await coolerContract.repayLoan(loanId, amount.toBigNumber(18), { + gasLimit: BigNumber.from("1000000"), + }); const receipt = await loan.wait(); return receipt; },