|
|
@ -500,34 +500,44 @@ THE SOFTWARE. |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var renderContracts = function(data, source) { |
|
|
|
var renderContracts = function(data, source) { |
|
|
|
|
|
|
|
var udappContracts = []; |
|
|
|
for (var contractName in data.contracts) { |
|
|
|
for (var contractName in data.contracts) { |
|
|
|
var contract = data.contracts[contractName]; |
|
|
|
var contract = data.contracts[contractName]; |
|
|
|
var dapp = new UniversalDApp([{ |
|
|
|
udappContracts.push({ |
|
|
|
name: contractName, |
|
|
|
name: contractName, |
|
|
|
interface: contract['interface'], |
|
|
|
interface: contract['interface'], |
|
|
|
bytecode: contract.bytecode |
|
|
|
bytecode: contract.bytecode |
|
|
|
}], { |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var dapp = new UniversalDApp(udappContracts, { |
|
|
|
vm: executionContext === 'vm', |
|
|
|
vm: executionContext === 'vm', |
|
|
|
removable: false, |
|
|
|
removable: false, |
|
|
|
removable_instances: true |
|
|
|
removable_instances: true, |
|
|
|
}); |
|
|
|
renderOutputModifier: function(contractName, $contractOutput) { |
|
|
|
var $contractOutput = dapp.render(); |
|
|
|
var contract = data.contracts[contractName]; |
|
|
|
$contractOutput |
|
|
|
return $contractOutput |
|
|
|
.append(textRow('Bytecode', contract.bytecode)) |
|
|
|
.append(textRow('Bytecode', contract.bytecode)) |
|
|
|
.append(textRow('Interface', contract['interface'])) |
|
|
|
.append(textRow('Interface', contract['interface'])) |
|
|
|
.append(textRow('Web3 deploy', gethDeploy(contractName.toLowerCase(),contract['interface'],contract.bytecode), 'deploy')) |
|
|
|
.append(textRow('Web3 deploy', gethDeploy(contractName.toLowerCase(),contract['interface'],contract.bytecode), 'deploy')) |
|
|
|
.append(textRow('uDApp', combined(contractName,contract['interface'],contract.bytecode), 'deploy')) |
|
|
|
.append(textRow('uDApp', combined(contractName,contract['interface'],contract.bytecode), 'deploy')) |
|
|
|
.append(getDetails(contract, source, contractName)); |
|
|
|
.append(getDetails(contract, source, contractName)); |
|
|
|
|
|
|
|
}}); |
|
|
|
|
|
|
|
var $contractOutput = dapp.render(); |
|
|
|
|
|
|
|
|
|
|
|
if (executionContext === 'vm') $('#txorigin').text('0x' + dapp.address.toString('hex')); |
|
|
|
if (executionContext === 'vm') |
|
|
|
else web3.eth.getAccounts( function(err,accounts) { |
|
|
|
$('#txorigin').text('0x' + dapp.address.toString('hex')); |
|
|
|
if (err) renderError(err.message); |
|
|
|
else |
|
|
|
|
|
|
|
web3.eth.getAccounts(function(err, accounts) { |
|
|
|
|
|
|
|
if (err) |
|
|
|
|
|
|
|
renderError(err.message); |
|
|
|
$('#txorigin').text(accounts[0]); |
|
|
|
$('#txorigin').text(accounts[0]); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$contractOutput.find('.title').click(function(ev){ $(this).closest('.udapp').toggleClass('hide') }); |
|
|
|
$contractOutput.find('.title').click(function(ev){ |
|
|
|
|
|
|
|
console.log($(this)); |
|
|
|
|
|
|
|
$(this).closest('.contract').toggleClass('hide'); |
|
|
|
|
|
|
|
}); |
|
|
|
$('#output').append( $contractOutput ); |
|
|
|
$('#output').append( $contractOutput ); |
|
|
|
} |
|
|
|
|
|
|
|
$('.col2 input,textarea').click(function() { this.select(); }); |
|
|
|
$('.col2 input,textarea').click(function() { this.select(); }); |
|
|
|
}; |
|
|
|
}; |
|
|
|
var tableRowItems = function(first, second, cls) { |
|
|
|
var tableRowItems = function(first, second, cls) { |
|
|
|