value specified in transaction results in wrong amount
Closed this issue · 2 comments
j4ys0n commented
from the readme:
web3.eth.getAccounts().then((accounts) => {
web3.eth.sendTransaction({
from: accounts[0],
to: "0x6A823E…",
value: "1000000000000000000",
});
});
here's my code:
const transactionParameters = {
to: contractAddress,
value: "1000000000000000000",
from: window.ethereum.selectedAddress,
data: window.contract.methods
.createCollectible(window.ethereum.selectedAddress, tokenURI)
.encodeABI(),
};
results in a transaction for 4722.366483
ETH. what's wrong here?
i tried using a different BN library but it results in the same thing.
j4ys0n commented
ok, when i convert from decimal to hex, it works. this feels like a bug.
thebrianchen commented
This has since been fixed. Running the asme code snippet will send 1ETH.
Closing the issue, but feel free to ask any other questions you may have.