1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-28 00:27:58 +02:00

fix ether -> wei conversion

* should fix #210
This commit is contained in:
Matthias Kretschmann 2020-01-13 22:07:21 +01:00
parent dfb57856aa
commit fa7bb17f07
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -1,4 +1,5 @@
import React, { useState, useEffect } from 'react'
import { parseEther } from '@ethersproject/units'
import useWeb3, { connectors, getErrorMessage } from '../../../hooks/use-web3'
import InputGroup from './InputGroup'
import Alert, { getTransactionMessage } from './Alert'
@ -38,7 +39,7 @@ export default function Web3Donation({ address }: { address: string }) {
const tx = await signer.sendTransaction({
to: address,
value: amount * 1e18 // ETH -> Wei
value: parseEther(amount.toString()) // ETH -> Wei
})
setTransactionHash(tx.hash)
setMessage({