Skip to content

Commit

Permalink
updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
debris committed May 21, 2015
1 parent 71ae809 commit ea4d66e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 117 deletions.
23 changes: 5 additions & 18 deletions example/contract.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,10 @@
" }\n" +
"}\n";

var code = web3.eth.compile.solidity(source).code;
/*var code = "605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056";*/

// contract description, this is autogenerated using solc CLI
var desc = [{
"constant" : true,
"inputs" : [{
"name" : "a",
"type" : "uint256"
}],
"name" : "multiply",
"outputs" : [{
"name" : "d",
"type" : "uint256"
}],
"type" : "function"
}];
var compiled = web3.eth.compile.solidity(source);
var code = compiled.test.code;
// contract json abi, this is autogenerated using solc CLI
var abi = compiled.test.info.abiDefinition;

var myContract;

Expand All @@ -47,7 +34,7 @@
var watch = web3.eth.filter('latest');

// create contract
myContract = web3.eth.contract(desc).new({data: code});
myContract = web3.eth.contract(abi).new({data: code});
console.log('address: ' + myContract.address);
document.getElementById('status').innerText = "transaction sent, waiting for confirmation";
watch.watch(function (err, hash) {
Expand Down
27 changes: 4 additions & 23 deletions example/event_inc.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,10 @@
" } " +
" uint x; " +
"}";
var code = web3.eth.compile.solidity(source).code;
/*var code = "5b60456000600050819055505b608c8060196000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063371303c014602e57005b6034603a565b60006000f35b6000600081815054600101919050819055506001600260006000505406147f6e61ef44ac2747ff8b84d353a908eb8bd5c3fb118334d57698c5cfc7041196ad600060006000505481526020016000a25b56";*/

var desc = [{
"constant" : false,
"inputs" : [],
"name" : "inc",
"outputs" : [],
"type" : "function"
}, {
"anonymous" : false,
"inputs" : [{
"indexed" : true,
"name" : "odd",
"type" : "bool"
}, {
"indexed" : false,
"name" : "x",
"type" : "uint256"
}],
"name" : "Incremented",
"type" : "event"
}];
var compiled = web3.eth.compile.solidity(source);
var code = compiled.Contract.code;
var abi = compiled.Contract.info.abiDefinition;

var address;
var contract;
Expand All @@ -55,7 +36,7 @@

var watch = web3.eth.filter('latest');

contract = web3.eth.contract(desc).new({data: code});
contract = web3.eth.contract(abi).new({data: code});

console.log('address: ' + contract.address);

Expand Down
76 changes: 0 additions & 76 deletions example/natspec_contract.html

This file was deleted.

0 comments on commit ea4d66e

Please sign in to comment.