aboutsummaryrefslogtreecommitdiffstats
path: root/lib/web3.js
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-01-26 05:43:36 +0800
committerGav Wood <i@gavwood.com>2015-01-26 05:43:36 +0800
commitd223ac0379c4c1f8c209e777ec9ed63384590157 (patch)
treedbce42e40636c8bd82fe9cf8d744c65e4f19e5f8 /lib/web3.js
parent113a3809ab5e92cd0d60a02a5752b260a9ab3331 (diff)
downloaddexon-d223ac0379c4c1f8c209e777ec9ed63384590157.tar
dexon-d223ac0379c4c1f8c209e777ec9ed63384590157.tar.gz
dexon-d223ac0379c4c1f8c209e777ec9ed63384590157.tar.bz2
dexon-d223ac0379c4c1f8c209e777ec9ed63384590157.tar.lz
dexon-d223ac0379c4c1f8c209e777ec9ed63384590157.tar.xz
dexon-d223ac0379c4c1f8c209e777ec9ed63384590157.tar.zst
dexon-d223ac0379c4c1f8c209e777ec9ed63384590157.zip
Additional work on the JS stuff to make it more similar to Solidity.
Diffstat (limited to 'lib/web3.js')
-rw-r--r--lib/web3.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/web3.js b/lib/web3.js
index 7191adfe8..fde3cce75 100644
--- a/lib/web3.js
+++ b/lib/web3.js
@@ -268,6 +268,15 @@ var web3 = {
/// eth object prototype
eth: {
+ contractFromAbi: function (abi) {
+ return function(addr) {
+ // Default to address of Config. TODO: rremove prior to genesis.
+ addr = addr || '0xc6d9d2cd449a754c494264e1809c50e34d64562b';
+ var ret = web3.eth.contract(addr, abi);
+ ret.address = addr;
+ return ret;
+ };
+ },
watch: function (params) {
return new web3.filter(params, ethWatch);
}