Skip to content

Commit

Permalink
added toString from number (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
vignesha22 authored Sep 11, 2023
1 parent 65c4547 commit bfe803e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/paymaster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ export class Paymaster {
const paymasterContract = new ethers.Contract(paymasterAddress, abi, provider);
const signer = new Wallet(this.relayerKey, provider)
const balance = await signer.getBalance();
if (ethers.utils.parseEther(amount).gte(balance))
if (ethers.utils.parseEther(amount.toString()).gte(balance))
throw new Error(`${signer.address} Balance is less than the amount to be deposited`)
const encodedData = paymasterContract.interface.encodeFunctionData('depositFunds', []);
const tx = await signer.sendTransaction({ to: paymasterAddress, data: encodedData, value: ethers.utils.parseEther(amount) });
const tx = await signer.sendTransaction({ to: paymasterAddress, data: encodedData, value: ethers.utils.parseEther(amount.toString()) });
await tx.wait();
return {
message: `Successfully deposited with transaction Hash ${tx.hash}`
Expand Down

0 comments on commit bfe803e

Please sign in to comment.