require=function t(e,n,r){function i(a,u){if(!n[a]){if(!e[a]){var f="function"==typeof require&&require;if(!u&&f)return f(a,!0);if(o)return o(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;ag;g++)d.push(p(e.slice(0,a))),e=e.slice(a);n.push(d)}else r.prefixedType("string")(t.outputs[u].type)?(s=s.slice(a),n.push(p(e.slice(0,a))),e=e.slice(a)):(n.push(p(e.slice(0,a))),e=e.slice(a))}),n},d=function(t){var e=t.indexOf("(");return-1!==e?t.substr(0,e):t},g=function(t){var e=t.indexOf("(");return-1!==e?t.substr(e+1,t.length-1-(e+1)):""},v=function(t){var e={};return t.forEach(function(t){var n=d(t.name),r=g(t.name),i=function(){var e=Array.prototype.slice.call(arguments);return l(t,e)};void 0===e[n]&&(e[n]=i),e[n][r]=i}),e},y=function(t){var e={};return t.forEach(function(t){var n=d(t.name),r=g(t.name),i=function(e){return m(t,e)};void 0===e[n]&&(e[n]=i),e[n][r]=i}),e},b=function(t){return n.sha3(n.fromAscii(t)).slice(0,2+2*i.ETH_METHOD_SIGNATURE_LENGTH)};e.exports={inputParser:v,outputParser:y,methodSignature:b,methodDisplayName:d,methodTypeName:g,filterFunctions:a,filterEvents:u}},{"./const":2,"./formatters":6,"./types":10,"./utils":11,"./web3":12}],2:[function(t,e){e.exports={ETH_PADDING:32,ETH_METHOD_SIGNATURE_LENGTH:4,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:BigNumber.ROUND_DOWN}}},{}],3:[function(t,e){var n=t("./web3"),r=t("./abi"),i=t("./event"),o=function(t){t.call=function(e){return t._isTransact=!1,t._options=e,t},t.transact=function(e){return t._isTransact=!0,t._options=e,t},t._options={},["gas","gasPrice","value","from"].forEach(function(e){t[e]=function(n){return t._options[e]=n,t}})},a=function(t,e,i){var o=r.inputParser(e),a=r.outputParser(e);r.filterFunctions(e).forEach(function(u){var f=r.methodDisplayName(u.name),s=r.methodTypeName(u.name),c=function(){var c=Array.prototype.slice.call(arguments),l=r.methodSignature(u.name),p=o[f][s].apply(null,c),h=t._options||{};h.to=i,h.data=l+p;var m=t._isTransact===!0||t._isTransact!==!1&&!u.constant,d=h.collapse!==!1;if(t._options={},t._isTransact=null,m)return n._currentContractAbi=e,n._currentContractAddress=i,n._currentContractMethodName=u.name,n._currentContractMethodParams=c,void n.eth.transact(h);var g=n.eth.call(h),v=a[f][s](g);return d&&(1===v.length?v=v[0]:0===v.length&&(v=null)),v};void 0===t[f]&&(t[f]=c),t[f][s]=c})},u=function(t,e,n){t.address=n,Object.defineProperty(t,"topic",{get:function(){return r.filterEvents(e).map(function(t){return r.methodSignature(t.name)})}})},f=function(t,e,o){r.filterEvents(e).forEach(function(e){var a=function(){var t=Array.prototype.slice.call(arguments),a=r.methodSignature(e.name),u=i(o,a,e),f=u.apply(null,t);return n.eth.watch(f)};a._isEvent=!0,a.address=o,Object.defineProperty(a,"topic",{get:function(){return[r.methodSignature(e.name)]}});var u=r.methodDisplayName(e.name),f=r.methodTypeName(e.name);void 0===t[u]&&(t[u]=a),t[u][f]=a})},s=function(t,e){e.forEach(function(t){if(-1===t.name.indexOf("(")){var e=t.name,n=t.inputs.map(function(t){return t.type}).join();t.name=e+"("+n+")"}});var n={};return o(n),a(n,e,t),u(n,e,t),f(n,e,t),n};e.exports=s},{"./abi":1,"./event":4,"./web3":12}],4:[function(t,e){var n=t("./abi"),r=t("./utils"),i=function(t,e){var n=r.findIndex(t,function(t){return t.name===e});return-1===n?void console.error("indexed paray with name "+e+" not found"):t[n]},o=function(t,e){return Object.keys(e).map(function(r){var o=n.inputParser([{name:"test",inputs:[i(t.inputs,r)]}]),a=e[r];return a instanceof Array?a.map(function(t){return o.test(t)}):o.test(a)})},a=function(t,e,n){return function(r,i){var a=i||{};return a.address=t,a.topic=[],a.topic.push(e),r&&(a.topic=a.topic.concat(o(n,r))),a}};e.exports=a},{"./abi":1,"./utils":11}],5:[function(t,e){var n=t("./web3"),r=function(t,e){"string"!=typeof t&&(t.topics&&console.warn('"topics" is deprecated, use "topic" instead'),t={to:t.to,topic:t.topic,earliest:t.earliest,latest:t.latest,max:t.max,skip:t.skip,address:t.address}),this.impl=e,this.callbacks=[],this.id=e.newFilter(t),n.provider.startPolling({call:e.changed,args:[this.id]},this.id,this.trigger.bind(this))};r.prototype.arrived=function(t){this.changed(t)},r.prototype.changed=function(t){this.callbacks.push(t)},r.prototype.trigger=function(t){for(var e=0;en;n+=2){var i=parseInt(t.substr(n,2),16);if(0===i)break;e+=String.fromCharCode(i)}return e},i=function(t){for(var e="",n=0;n2?t.substring(2):"0",new BigNumber(t,16).toString(10)},fromDecimal:function(t){return"0x"+new BigNumber(t).toString(16)},toEth:function(t){for(var e="string"==typeof t?0===t.indexOf("0x")?parseInt(t.substr(2),16):parseInt(t):t,n=0,i=r;e>3e3&&n