Skip to content

Commit

Permalink
Changed Deposit Function
Browse files Browse the repository at this point in the history
  • Loading branch information
SWAGATSWAROOP committed Jun 19, 2024
1 parent ce0a08b commit e67bd14
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions frontend-next/app/deposit/Deposit.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use client";
import { useState } from "react";
import prisma from "@/db";
import { ethers } from "ethers";
import Account from "../contracts/account.sol/Account.json";
import { contract } from "@/lib/constant";

export default function Deposit() {
const [accountNumber, setAccountNumber] = useState("");
Expand All @@ -11,13 +10,6 @@ export default function Deposit() {

async function onSubmit() {
console.log(accountNumber, amount, username);
let provider = new ethers.JsonRpcProvider();
let signer = await provider.getSigner();
let contract = new ethers.Contract(
"0x5FbDB2315678afecb367f032d93F642f64180aa3",
Account.abi,
signer,
);
const deposit = await contract.deposit(username, amount);
await deposit.wait();
const existingUser = await prisma.user.findUnique({
Expand Down

0 comments on commit e67bd14

Please sign in to comment.