Skip to content

Commit

Permalink
refactor: manually set gas settings for mint and deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
kamikazechaser committed Nov 29, 2023
1 parent e499271 commit ee25aa9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/dialogs/mint-to-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import React from "react";
import { useForm } from "react-hook-form";
import { isAddress, parseUnits } from "viem";
import { useAccount, useBalance, useContractWrite } from "wagmi";
import { useAccount, useBalance, useContractWrite, parseGwei } from "wagmi";
import * as z from "zod";
import { abi } from "~/contracts/erc20-demurrage-token/contract";
import { AddressField } from "../forms/fields/address-field";
Expand Down Expand Up @@ -54,7 +54,9 @@ const MintToDialog = ({
address: voucher.voucher_address as `0x${string}`,
abi: abi,
functionName: "mintTo",

gas: 350_000n,
maxFeePerGas: parseGwei('10'),
maxPriorityFeePerGas: 5n,
onError: (error) => {
toast.toast({
title: "Error",
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/useDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export const useDeploy = (
abi: dmrContract.abi,
args,
bytecode: dmrContract.bytecode,
gas: 7_000_000n,
maxFeePerGas: parseGwei('10'),
maxPriorityFeePerGas: 5n,
});

setHash(hash);
Expand Down

0 comments on commit ee25aa9

Please sign in to comment.