diff --git a/src/universal-dapp.js b/src/universal-dapp.js index abe758379c..af5ce40b4b 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -291,8 +291,14 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar $createInterface.append(this.getCallButton({ abi: funABI, encode: function (args) { - var obj = web3contract.new; - return obj.getData.apply(obj, args); + var types = []; + for (var i = 0; i < funABI.inputs.length; i++) { + types.push(funABI.inputs[i].type); + } + + // NOTE: the caller will concatenate the bytecode and this + // it could be done here too for consistency + return ethJSABI.rawEncode(types, args).toString('hex'); }, contractName: contract.name, bytecode: contract.bytecode,