0

I sign this transaction with Ethereumjs-tx:

{ 
    nonce: 8,
    gasPrice: 20,
    gasLimit: 25000,
    to: '0x45cc01d4b9ad49b81527d5b6629da8664bb525d3',
    value: 1000000,
    data: '0x00',
    chainId: 3 
}

however, the value on etherscan shows 0.013845257383850032 Ether

https://ropsten.etherscan.io/tx/0xa891e47b6fad75750a40d6ea2698fe409e4650c59acbc910eaa5cabe1169a4e0

Where doe the 0.0038xxxx extra ether come from?

1
  • Are you sure that code produced that transaction? A value of 1000000 is equal to 0.000000000001 ETH (the value you posted is in WEI). I do not think that the code you posted matches the transaction that you posted. Sep 14, 2018 at 17:11

1 Answer 1

0

Larger ints don't work well with ethereumJS-tx. If you have a large int, use

ethereumjs-util.intToBuffer()

or

new BN(value) to convert it to BN which seems to work as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.