Official Go implementation of the Ethereum protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-ethereum/dist/ethereum.min.js

1 line
15 KiB

10 years ago
require=function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[s]={exports:{}};t[s][0].call(c.exports,function(e){var r=t[s][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t){var r=e("./web3");BigNumber.config({ROUNDING_MODE:BigNumber.ROUND_DOWN});var n=32,i=function(e,t){for(var r=!1,n=0;n<e.length&&!r;n++)r=t(e[n]);return r?n-1:-1},o=function(e,t){return i(e,function(e){return e.name===t})},s=function(e,t,r){return new Array(t-e.length+1).join(r?r:"0")+e},a=function(e){return function(t){return 0===t.indexOf(e)}},u=function(e){return function(t){return e===t}},f=function(e){return"[]"===e.slice(-2)},c=function(e){var t=2*n;return e instanceof BigNumber||"number"==typeof e?("number"==typeof e&&(e=new BigNumber(e)),e=e.round(),e.lessThan(0)&&(e=new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(e).plus(1)),e=e.toString(16)):e=0===e.indexOf("0x")?e.substr(2):"string"==typeof e?c(new BigNumber(e)):(+e).toString(16),s(e,t)},l=function(e){return r.fromAscii(e,n).substr(2)},p=function(e){return"000000000000000000000000000000000000000000000000000000000000000"+(e?"1":"0")},h=function(e){return c(new BigNumber(e).times(new BigNumber(2).pow(128)))},d=function(e,t){return f(e)||a("string")(e)?c(t.length):""},v=function(){return[{type:a("uint"),format:c},{type:a("int"),format:c},{type:a("hash"),format:c},{type:a("string"),format:l},{type:a("real"),format:h},{type:a("ureal"),format:h},{type:u("address"),format:c},{type:u("bool"),format:p}]},g=v(),m=function(e,t,r){var n="",i=o(e,t);if(-1!==i){var s=e[i];return s.inputs.forEach(function(e,t){n+=d(e.type,r[t])}),s.inputs.forEach(function(e,t){for(var i=!1,o=0;o<g.length&&!i;o++)i=g[o].type(s.inputs[t].type,r[t]);i||console.error("input parser does not support type: "+s.inputs[t].type);var a=g[o-1].format,u="";u=f(s.inputs[t].type)?r[t].reduce(function(e,t){return e+a(t)},""):a(r[t]),n+=u}),n}},b=function(e){return"1"===new BigNumber(e.substr(0,1),16).toString(2).substr(0,1)},y=function(e){return b(e)?new BigNumber(e,16).minus(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new BigNumber(e,16)},_=function(e){return new BigNumber(e,16)},w=function(e){return y(e).dividedBy(new BigNumber(2).pow(128))},N=function(e){return _(e).dividedBy(new BigNumber(2).pow(128))},S=function(e){return"0x"+e},x=function(e){return"0000000000000000000000000000000000000000000000000000000000000001"===e?!0:!1},O=function(e){return r.toAscii(e)},P=function(e){return"0x"+e.slice(e.length-40,e.length)},B=function(e){return f(e)||a("string")(e)?2*n:0},k=function(){return[{type:a("uint"),format:_},{type:a("int"),format:y},{type:a("hash"),format:S},{type:a("string"),format:O},{type:a("real"),format:w},{type:a("ureal"),format:N},{type:u("address"),format:P},{type:u("bool"),format:x}]},A=k(),q=function(e,t,r){var i=o(e,t);if(-1!==i){r=r.slice(2);var s=[],u=e[i],c=2*n,l=u.outputs.reduce(function(e,t){return e+B(t.type)},0),p=r.slice(0,l);return r=r.slice(l),u.outputs.forEach(function(e,t){for(var n=!1,i=0;i<A.length&&!n;i++)n=A[i].type(u.outputs[t].type);n||console.error("output parser does not support type: "+u.outputs[t].type);var o=A[i-1].format;if(f(u.outputs[t].type)){var l=_(p.slice(0,c));p=p.slice(c);for(var h=[],d=0;l>d;d++)h.push(o(r.slice(0,c))),r=r.slice(c);s.push(h)}else a("string")(u.outputs[t].type)?(p=p.slice(c),s.push(o(r.slice(0,c))),r=r.slice(c)):(s.push(o(r.slice(0,c))),r=r.slice(c))}),s}},E=function(e){var t=e.indexOf("(");return-1!==t?e.substr(0,t):e},F=function(e){var t=e.indexOf("(");return-1!==t?e.substr(t+1,e.length-1-(t+1)):""},M=function(e){var t={};return e.forEach(function(r){var n=E(r.name),i=F(r.name),o=function(){var t=Array.prototype.slice.call(arguments);return m(e,r.name,t)};void 0===t[n]&&(t[n]=o),t[n][i]=o}),t},T=fu