You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
This is more of a question than an issue, but maybe it's an issue. A user informed that when they called a contract function that took in a bytes input, they were getting different results between mycrypto.com and etherscan.com. After some digging in, I determined that we (mycrypto) are using ethereumjs-abi, and etherscan is using web3.js. The way the two encode the same bytes argument seems to be very different:
Please let me know if I've made a mistake in how the inputs should be structured, or the output should be converted from a buffer that leads to these differences. Thanks!
The text was updated successfully, but these errors were encountered:
This is more of a question than an issue, but maybe it's an issue. A user informed that when they called a contract function that took in a
bytes
input, they were getting different results between mycrypto.com and etherscan.com. After some digging in, I determined that we (mycrypto) are usingethereumjs-abi
, and etherscan is usingweb3.js
. The way the two encode the samebytes
argument seems to be very different:ethereumjs-abi
bytes encoder: https://github.com/ethereumjs/ethereumjs-abi/blob/master/lib/index.js#L136web3.js
bytes encoder: https://github.com/ethereum/web3.js/blob/develop/lib/solidity/formatters.js#L65Example input:
ethereumjs-abi output via
abi.rawEncode(['bytes'], [input]).toString('hex')
:web3.js output via
SolidityCoder.encodeParam('bytes', input)
:Please let me know if I've made a mistake in how the inputs should be structured, or the output should be converted from a buffer that leads to these differences. Thanks!
The text was updated successfully, but these errors were encountered: