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?

  • 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. – shane Sep 14 at 17:11
up vote 0 down vote accepted

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

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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