Commit 23821153 authored by Alex Beregszaszi's avatar Alex Beregszaszi

Use ethereumjs-abi for encoding the constructor

parent 0dc3efde
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment