Skip to content

Commit

Permalink
Changed the directory of utils folder to reference contract abis corr…
Browse files Browse the repository at this point in the history
…ectly and changed default token in Grant Round to native token
  • Loading branch information
0xJade committed Aug 29, 2024
1 parent 9378b6e commit 8444d4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions packages/nextjs/components/CreateGrantRound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ import React, { useEffect, useState } from "react";
import { encodeRoundParameters, getABI, getNetworkName } from "../utils/utils";
import { ApplicationStatus, setApplicationStatuses } from "../utils/allo/setApplicationStatus";
import axios from "axios";
import { BrowserProvider, Contract, Interface, getAddress, isAddress, parseUnits } from "ethers";
import { BrowserProvider, Contract, Interface, getAddress, isAddress, parseUnits, ZeroAddress } from "ethers";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { useScaffoldWriteContract } from "~~/hooks/scaffold-eth";
import { notification } from "~~/utils/scaffold-eth";

// Define AddressZero manually
const AddressZero = "0x34182d56d905a195524a8F1813180C134687ca34";

const CreateRoundForm: React.FC = () => {
const [name, setName] = useState<string>("");
const [description, setDescription] = useState<string>("");
const [ownerAddress, setOwnerAddress] = useState<string>("");
const [matchAmount, setMatchAmount] = useState<string>("");
const [token, setToken] = useState<string>(AddressZero);
const [token, setToken] = useState<string>(ZeroAddress);
const [roundFeePercentage, setRoundFeePercentage] = useState<string>("");
const [roundFeeAddress, setRoundFeeAddress] = useState<string>("");
const [applicationsStartTime, setApplicationsStartTime] = useState<Date | null>(null);
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ const assertEnvironment = () => {

const getABI = (networkName, contractName) => {
try {
console.log(`../deployments/${networkName}/${contractName}.json`)
const abiFile = require(`../deployments/${networkName}/${contractName}.json`);
console.log(`../../hardhat/deployments/${networkName}/${contractName}.json`)
const abiFile = require(`../../hardhat/deployments/${networkName}/${contractName}.json`);
console.log(abiFile)
if (!abiFile.address) {
throw new Error(`Address not found for ${contractName} on network ${networkName}`);
Expand Down

0 comments on commit 8444d4b

Please sign in to comment.