diff --git a/packages/web3-eth-abi/src/index.js b/packages/web3-eth-abi/src/index.js index 382b461d2d4..90dce3f5e54 100644 --- a/packages/web3-eth-abi/src/index.js +++ b/packages/web3-eth-abi/src/index.js @@ -151,9 +151,9 @@ ABICoder.prototype.encodeParameters = function (types, params) { param = utils.rightPad(param, size * 2) } } - + // format odd-length bytes to even-length - if (param.length % 2 === 1) { + if (param.length % 2 === 1) { param = '0x0' + param.substring(2) } }