1import type { NextPage } from "next"; 2import Head from "next/head";
3import Image from "next/image";
4import { useEffect, useState } from "react";
2import Head from "next/head";
3import Image from "next/image";
4import { useEffect, useState } from "react";
5import Web3 from "web3"; 6import getWeb3 from "../utils/getWeb3";
7import TODO_LIST_ABI from "../../../contract/artifacts/contracts/TodoList.sol/TodoList.json";
8import { AbiItem } from "web3-utils";
1import type { NextPage } from "next";
2import Head from "next/head"; 3import Image from "next/image";
4import { useEffect, useState } from "react";
5import Web3 from "web3";
1import type { NextPage } from "next";
2import Head from "next/head";
3import Image from "next/image"; 4import { useEffect, useState } from "react";
5import Web3 from "web3";
6import getWeb3 from "../utils/getWeb3";
38 }
39 return hex;
40 }
41 async function sendTx() { 42 if (!todoList) return;
43 const tx = {
44 // this could be provider.addresses[0] if it exists
Unused variables are generally considered a code smell and should be avoided.
Removing unused references - It prevents unused modules from being loaded at runtime, improving performance, and preventing the compiler from loading metadata that will never be used. - It prevents conflicts that may occur when trying to reference another variable.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
import fs from 'fs' // <- unused
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)