Skip to content

Commit

Permalink
cooler gas limit to 1M (#3011)
Browse files Browse the repository at this point in the history
  • Loading branch information
brightiron committed Oct 19, 2023
1 parent 8d2395d commit 9cf33e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/views/Lending/Cooler/hooks/useCreateLoan.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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;
},
Expand Down
5 changes: 4 additions & 1 deletion src/views/Lending/Cooler/hooks/useExtendLoan.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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;
},
Expand Down
5 changes: 4 additions & 1 deletion src/views/Lending/Cooler/hooks/useRepayLoan.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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;
},
Expand Down

0 comments on commit 9cf33e8

Please sign in to comment.