diff --git a/dist/ethers-providers.js b/dist/ethers-providers.js index ef1fa6e9a..75a47ac91 100644 --- a/dist/ethers-providers.js +++ b/dist/ethers-providers.js @@ -5556,6 +5556,12 @@ function checkTransaction(transaction) { transaction.gasLimit = transaction.gas; } + // Some clients (TestRPC) do strange things like return 0x0 for the + // 0 address; correct this to be a real address + if (transaction.to && utils.bigNumberify(transaction.to).isZero) { + transaction.to = '0x0000000000000000000000000000000000000000'; + } + // Rename input to data if (transaction.input != null && transaction.data == null) { transaction.data = transaction.input; @@ -5662,9 +5668,7 @@ var formatTransactionReceipt = { function checkTransactionReceipt(transactionReceipt) { var status = transactionReceipt.status; var root = transactionReceipt.root; - if (!((status != null) ^ (root != null))) { - throw new Error('invalid transaction receipt - exactly one of status and root should be present'); - } + var result = check(formatTransactionReceipt, transactionReceipt); result.logs.forEach(function(entry, index) { if (entry.transactionLogIndex == null) { diff --git a/dist/ethers-providers.min.js b/dist/ethers-providers.min.js index e3216d9f2..8aaf8e212 100644 --- a/dist/ethers-providers.min.js +++ b/dist/ethers-providers.min.js @@ -1,3 +1,3 @@ !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return d}function h(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;g=49?h-49+10:h>=17?h-17+10:h}return e}function i(a){for(var b=new Array(a.bitLength()),c=0;c>>e}return b}function j(a,b,c){c.negative=b.negative^a.negative;var d=a.length+b.length|0;c.length=d,d=d-1|0;var e=0|a.words[0],f=0|b.words[0],g=e*f,h=67108863&g,i=g/67108864|0;c.words[0]=h;for(var j=1;j>>26,l=67108863&i,m=Math.min(j,b.length-1),n=Math.max(0,j-a.length+1);n<=m;n++){var o=j-n|0;e=0|a.words[o],f=0|b.words[n],g=e*f+l,k+=g/67108864|0,l=67108863&g}c.words[j]=0|l,i=0|k}return 0!==i?c.words[j]=0|i:c.length--,c.strip()}function k(a,b,c){c.negative=b.negative^a.negative,c.length=a.length+b.length;for(var d=0,e=0,f=0;f>>26)|0,e+=g>>>26,g&=67108863}c.words[f]=h,d=g,g=e}return 0!==d?c.words[f]=d:c.length--,c.strip()}function l(a,b,c){var d=new m;return d.mulp(a,b,c)}function m(a,b){this.x=a,this.y=b}function n(a,b){this.name=a,this.p=new f(b,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function o(){n.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){n.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){n.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function r(){n.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function s(a){if("string"==typeof a){var b=f._prime(a);this.m=b.p,this.prime=b}else d(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}function t(a){s.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof b?b.exports=f:c.BN=f,f.BN=f,f.wordSize=26;var u;try{u=a("buffer").Buffer}catch(v){}f.isBN=function(a){return a instanceof f||null!==a&&"object"==typeof a&&a.constructor.wordSize===f.wordSize&&Array.isArray(a.words)},f.max=function(a,b){return a.cmp(b)>0?a:b},f.min=function(a,b){return a.cmp(b)<0?a:b},f.prototype._init=function(a,b,c){if("number"==typeof a)return this._initNumber(a,b,c);if("object"==typeof a)return this._initArray(a,b,c);"hex"===b&&(b=16),d(b===(0|b)&&b>=2&&b<=36),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.negative=1),this.strip(),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initNumber=function(a,b,c){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[67108863&a],this.length=1):a<4503599627370496?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(d(a<9007199254740992),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initArray=function(a,b,c){if(d("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e=0;e-=3)g=a[e]|a[e-1]<<8|a[e-2]<<16,this.words[f]|=g<>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);else if("le"===c)for(e=0,f=0;e>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);return this.strip()},f.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c=b;c-=6)e=g(a,c,c+6),this.words[d]|=e<>>26-f&4194303,f+=24,f>=26&&(f-=26,d++);c+6!==b&&(e=g(a,b,c+6),this.words[d]|=e<>>26-f&4194303),this.strip()},f.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;e<=67108863;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,g=f%d,i=Math.min(f,f-g)+c,j=0,k=c;k1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(a,b){a=a||10,b=0|b||1;var c;if(16===a||"hex"===a){c="";for(var e=0,f=0,g=0;g>>24-e&16777215,c=0!==f||g!==this.length-1?w[6-i.length]+i+c:i+c,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(c=f.toString(16)+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(a===(0|a)&&a>=2&&a<=36){var j=x[a],k=y[a];c="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modn(k).toString(a);l=l.idivn(k),c=l.isZero()?m+c:w[j-m.length]+m+c}for(this.isZero()&&(c="0"+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}d(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var a=this.words[0];return 2===this.length?a+=67108864*this.words[1]:3===this.length&&1===this.words[2]?a+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-a:a},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(a,b){return d("undefined"!=typeof u),this.toArrayLike(u,a,b)},f.prototype.toArray=function(a,b){return this.toArrayLike(Array,a,b)},f.prototype.toArrayLike=function(a,b,c){var e=this.byteLength(),f=c||Math.max(1,e);d(e<=f,"byte array longer than desired length"),d(f>0,"Requested array length <= 0"),this.strip();var g,h,i="le"===b,j=new a(f),k=this.clone();if(i){for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[h]=g;for(;h=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},f.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},f.prototype.bitLength=function(){var a=this.words[this.length-1],b=this._countBits(a);return 26*(this.length-1)+b},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,b=0;ba.length?this.clone().ior(a):a.clone().ior(this)},f.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},f.prototype.iuand=function(a){var b;b=this.length>a.length?a:this;for(var c=0;ca.length?this.clone().iand(a):a.clone().iand(this)},f.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},f.prototype.iuxor=function(a){var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;da.length?this.clone().ixor(a):a.clone().ixor(this)},f.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},f.prototype.inotn=function(a){d("number"==typeof a&&a>=0);var b=0|Math.ceil(a/26),c=a%26;this._expand(b),c>0&&b--;for(var e=0;e0&&(this.words[e]=~this.words[e]&67108863>>26-c),this.strip()},f.prototype.notn=function(a){return this.clone().inotn(a)},f.prototype.setn=function(a,b){d("number"==typeof a&&a>=0);var c=a/26|0,e=a%26;return this._expand(c+1),b?this.words[c]=this.words[c]|1<a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f>>26;for(;0!==e&&f>>26;if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;fa.length?this.clone().iadd(a):a.clone().iadd(this)},f.prototype.isub=function(a){if(0!==a.negative){a.negative=0;var b=this.iadd(a);return a.negative=1,b._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var c=this.cmp(a);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g>26,this.words[g]=67108863&b;for(;0!==f&&g>26,this.words[g]=67108863&b;if(0===f&&g>>13,n=0|g[1],o=8191&n,p=n>>>13,q=0|g[2],r=8191&q,s=q>>>13,t=0|g[3],u=8191&t,v=t>>>13,w=0|g[4],x=8191&w,y=w>>>13,z=0|g[5],A=8191&z,B=z>>>13,C=0|g[6],D=8191&C,E=C>>>13,F=0|g[7],G=8191&F,H=F>>>13,I=0|g[8],J=8191&I,K=I>>>13,L=0|g[9],M=8191&L,N=L>>>13,O=0|h[0],P=8191&O,Q=O>>>13,R=0|h[1],S=8191&R,T=R>>>13,U=0|h[2],V=8191&U,W=U>>>13,X=0|h[3],Y=8191&X,Z=X>>>13,$=0|h[4],_=8191&$,aa=$>>>13,ba=0|h[5],ca=8191&ba,da=ba>>>13,ea=0|h[6],fa=8191&ea,ga=ea>>>13,ha=0|h[7],ia=8191&ha,ja=ha>>>13,ka=0|h[8],la=8191&ka,ma=ka>>>13,na=0|h[9],oa=8191&na,pa=na>>>13;c.negative=a.negative^b.negative,c.length=19,d=Math.imul(l,P),e=Math.imul(l,Q),e=e+Math.imul(m,P)|0,f=Math.imul(m,Q);var qa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(qa>>>26)|0,qa&=67108863,d=Math.imul(o,P),e=Math.imul(o,Q),e=e+Math.imul(p,P)|0,f=Math.imul(p,Q),d=d+Math.imul(l,S)|0,e=e+Math.imul(l,T)|0,e=e+Math.imul(m,S)|0,f=f+Math.imul(m,T)|0;var ra=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ra>>>26)|0,ra&=67108863,d=Math.imul(r,P),e=Math.imul(r,Q),e=e+Math.imul(s,P)|0,f=Math.imul(s,Q),d=d+Math.imul(o,S)|0,e=e+Math.imul(o,T)|0,e=e+Math.imul(p,S)|0,f=f+Math.imul(p,T)|0,d=d+Math.imul(l,V)|0,e=e+Math.imul(l,W)|0,e=e+Math.imul(m,V)|0,f=f+Math.imul(m,W)|0;var sa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(sa>>>26)|0,sa&=67108863,d=Math.imul(u,P),e=Math.imul(u,Q),e=e+Math.imul(v,P)|0,f=Math.imul(v,Q),d=d+Math.imul(r,S)|0,e=e+Math.imul(r,T)|0,e=e+Math.imul(s,S)|0,f=f+Math.imul(s,T)|0,d=d+Math.imul(o,V)|0,e=e+Math.imul(o,W)|0,e=e+Math.imul(p,V)|0,f=f+Math.imul(p,W)|0,d=d+Math.imul(l,Y)|0,e=e+Math.imul(l,Z)|0,e=e+Math.imul(m,Y)|0,f=f+Math.imul(m,Z)|0;var ta=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ta>>>26)|0,ta&=67108863,d=Math.imul(x,P),e=Math.imul(x,Q),e=e+Math.imul(y,P)|0,f=Math.imul(y,Q),d=d+Math.imul(u,S)|0,e=e+Math.imul(u,T)|0,e=e+Math.imul(v,S)|0,f=f+Math.imul(v,T)|0,d=d+Math.imul(r,V)|0,e=e+Math.imul(r,W)|0,e=e+Math.imul(s,V)|0,f=f+Math.imul(s,W)|0,d=d+Math.imul(o,Y)|0,e=e+Math.imul(o,Z)|0,e=e+Math.imul(p,Y)|0,f=f+Math.imul(p,Z)|0,d=d+Math.imul(l,_)|0,e=e+Math.imul(l,aa)|0,e=e+Math.imul(m,_)|0,f=f+Math.imul(m,aa)|0;var ua=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ua>>>26)|0,ua&=67108863,d=Math.imul(A,P),e=Math.imul(A,Q),e=e+Math.imul(B,P)|0,f=Math.imul(B,Q),d=d+Math.imul(x,S)|0,e=e+Math.imul(x,T)|0,e=e+Math.imul(y,S)|0,f=f+Math.imul(y,T)|0,d=d+Math.imul(u,V)|0,e=e+Math.imul(u,W)|0,e=e+Math.imul(v,V)|0,f=f+Math.imul(v,W)|0,d=d+Math.imul(r,Y)|0,e=e+Math.imul(r,Z)|0,e=e+Math.imul(s,Y)|0,f=f+Math.imul(s,Z)|0,d=d+Math.imul(o,_)|0,e=e+Math.imul(o,aa)|0,e=e+Math.imul(p,_)|0,f=f+Math.imul(p,aa)|0,d=d+Math.imul(l,ca)|0,e=e+Math.imul(l,da)|0,e=e+Math.imul(m,ca)|0,f=f+Math.imul(m,da)|0;var va=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(va>>>26)|0,va&=67108863,d=Math.imul(D,P),e=Math.imul(D,Q),e=e+Math.imul(E,P)|0,f=Math.imul(E,Q),d=d+Math.imul(A,S)|0,e=e+Math.imul(A,T)|0,e=e+Math.imul(B,S)|0,f=f+Math.imul(B,T)|0,d=d+Math.imul(x,V)|0,e=e+Math.imul(x,W)|0,e=e+Math.imul(y,V)|0,f=f+Math.imul(y,W)|0,d=d+Math.imul(u,Y)|0,e=e+Math.imul(u,Z)|0,e=e+Math.imul(v,Y)|0,f=f+Math.imul(v,Z)|0,d=d+Math.imul(r,_)|0,e=e+Math.imul(r,aa)|0,e=e+Math.imul(s,_)|0,f=f+Math.imul(s,aa)|0,d=d+Math.imul(o,ca)|0,e=e+Math.imul(o,da)|0,e=e+Math.imul(p,ca)|0,f=f+Math.imul(p,da)|0,d=d+Math.imul(l,fa)|0,e=e+Math.imul(l,ga)|0,e=e+Math.imul(m,fa)|0,f=f+Math.imul(m,ga)|0;var wa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(wa>>>26)|0,wa&=67108863,d=Math.imul(G,P),e=Math.imul(G,Q),e=e+Math.imul(H,P)|0,f=Math.imul(H,Q),d=d+Math.imul(D,S)|0,e=e+Math.imul(D,T)|0,e=e+Math.imul(E,S)|0,f=f+Math.imul(E,T)|0,d=d+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,e=e+Math.imul(B,V)|0,f=f+Math.imul(B,W)|0,d=d+Math.imul(x,Y)|0,e=e+Math.imul(x,Z)|0,e=e+Math.imul(y,Y)|0,f=f+Math.imul(y,Z)|0,d=d+Math.imul(u,_)|0,e=e+Math.imul(u,aa)|0,e=e+Math.imul(v,_)|0,f=f+Math.imul(v,aa)|0,d=d+Math.imul(r,ca)|0,e=e+Math.imul(r,da)|0,e=e+Math.imul(s,ca)|0,f=f+Math.imul(s,da)|0,d=d+Math.imul(o,fa)|0,e=e+Math.imul(o,ga)|0,e=e+Math.imul(p,fa)|0,f=f+Math.imul(p,ga)|0,d=d+Math.imul(l,ia)|0,e=e+Math.imul(l,ja)|0,e=e+Math.imul(m,ia)|0,f=f+Math.imul(m,ja)|0;var xa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(xa>>>26)|0,xa&=67108863,d=Math.imul(J,P),e=Math.imul(J,Q),e=e+Math.imul(K,P)|0,f=Math.imul(K,Q),d=d+Math.imul(G,S)|0,e=e+Math.imul(G,T)|0,e=e+Math.imul(H,S)|0,f=f+Math.imul(H,T)|0,d=d+Math.imul(D,V)|0,e=e+Math.imul(D,W)|0,e=e+Math.imul(E,V)|0,f=f+Math.imul(E,W)|0,d=d+Math.imul(A,Y)|0,e=e+Math.imul(A,Z)|0,e=e+Math.imul(B,Y)|0,f=f+Math.imul(B,Z)|0,d=d+Math.imul(x,_)|0,e=e+Math.imul(x,aa)|0,e=e+Math.imul(y,_)|0,f=f+Math.imul(y,aa)|0,d=d+Math.imul(u,ca)|0,e=e+Math.imul(u,da)|0,e=e+Math.imul(v,ca)|0,f=f+Math.imul(v,da)|0,d=d+Math.imul(r,fa)|0,e=e+Math.imul(r,ga)|0,e=e+Math.imul(s,fa)|0,f=f+Math.imul(s,ga)|0,d=d+Math.imul(o,ia)|0,e=e+Math.imul(o,ja)|0,e=e+Math.imul(p,ia)|0,f=f+Math.imul(p,ja)|0,d=d+Math.imul(l,la)|0,e=e+Math.imul(l,ma)|0,e=e+Math.imul(m,la)|0,f=f+Math.imul(m,ma)|0;var ya=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ya>>>26)|0,ya&=67108863,d=Math.imul(M,P),e=Math.imul(M,Q),e=e+Math.imul(N,P)|0,f=Math.imul(N,Q),d=d+Math.imul(J,S)|0,e=e+Math.imul(J,T)|0,e=e+Math.imul(K,S)|0,f=f+Math.imul(K,T)|0,d=d+Math.imul(G,V)|0,e=e+Math.imul(G,W)|0,e=e+Math.imul(H,V)|0,f=f+Math.imul(H,W)|0,d=d+Math.imul(D,Y)|0,e=e+Math.imul(D,Z)|0,e=e+Math.imul(E,Y)|0,f=f+Math.imul(E,Z)|0,d=d+Math.imul(A,_)|0,e=e+Math.imul(A,aa)|0,e=e+Math.imul(B,_)|0,f=f+Math.imul(B,aa)|0,d=d+Math.imul(x,ca)|0,e=e+Math.imul(x,da)|0,e=e+Math.imul(y,ca)|0,f=f+Math.imul(y,da)|0,d=d+Math.imul(u,fa)|0,e=e+Math.imul(u,ga)|0,e=e+Math.imul(v,fa)|0,f=f+Math.imul(v,ga)|0,d=d+Math.imul(r,ia)|0,e=e+Math.imul(r,ja)|0,e=e+Math.imul(s,ia)|0,f=f+Math.imul(s,ja)|0,d=d+Math.imul(o,la)|0,e=e+Math.imul(o,ma)|0,e=e+Math.imul(p,la)|0,f=f+Math.imul(p,ma)|0,d=d+Math.imul(l,oa)|0,e=e+Math.imul(l,pa)|0,e=e+Math.imul(m,oa)|0,f=f+Math.imul(m,pa)|0;var za=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(za>>>26)|0,za&=67108863,d=Math.imul(M,S),e=Math.imul(M,T),e=e+Math.imul(N,S)|0,f=Math.imul(N,T),d=d+Math.imul(J,V)|0,e=e+Math.imul(J,W)|0,e=e+Math.imul(K,V)|0,f=f+Math.imul(K,W)|0,d=d+Math.imul(G,Y)|0,e=e+Math.imul(G,Z)|0,e=e+Math.imul(H,Y)|0,f=f+Math.imul(H,Z)|0,d=d+Math.imul(D,_)|0,e=e+Math.imul(D,aa)|0,e=e+Math.imul(E,_)|0,f=f+Math.imul(E,aa)|0,d=d+Math.imul(A,ca)|0,e=e+Math.imul(A,da)|0,e=e+Math.imul(B,ca)|0,f=f+Math.imul(B,da)|0,d=d+Math.imul(x,fa)|0,e=e+Math.imul(x,ga)|0,e=e+Math.imul(y,fa)|0,f=f+Math.imul(y,ga)|0,d=d+Math.imul(u,ia)|0,e=e+Math.imul(u,ja)|0,e=e+Math.imul(v,ia)|0,f=f+Math.imul(v,ja)|0,d=d+Math.imul(r,la)|0,e=e+Math.imul(r,ma)|0,e=e+Math.imul(s,la)|0,f=f+Math.imul(s,ma)|0,d=d+Math.imul(o,oa)|0,e=e+Math.imul(o,pa)|0,e=e+Math.imul(p,oa)|0,f=f+Math.imul(p,pa)|0;var Aa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,d=Math.imul(M,V),e=Math.imul(M,W),e=e+Math.imul(N,V)|0,f=Math.imul(N,W),d=d+Math.imul(J,Y)|0,e=e+Math.imul(J,Z)|0,e=e+Math.imul(K,Y)|0,f=f+Math.imul(K,Z)|0,d=d+Math.imul(G,_)|0,e=e+Math.imul(G,aa)|0,e=e+Math.imul(H,_)|0,f=f+Math.imul(H,aa)|0,d=d+Math.imul(D,ca)|0,e=e+Math.imul(D,da)|0,e=e+Math.imul(E,ca)|0,f=f+Math.imul(E,da)|0,d=d+Math.imul(A,fa)|0,e=e+Math.imul(A,ga)|0,e=e+Math.imul(B,fa)|0,f=f+Math.imul(B,ga)|0,d=d+Math.imul(x,ia)|0,e=e+Math.imul(x,ja)|0,e=e+Math.imul(y,ia)|0,f=f+Math.imul(y,ja)|0,d=d+Math.imul(u,la)|0,e=e+Math.imul(u,ma)|0,e=e+Math.imul(v,la)|0,f=f+Math.imul(v,ma)|0,d=d+Math.imul(r,oa)|0,e=e+Math.imul(r,pa)|0,e=e+Math.imul(s,oa)|0,f=f+Math.imul(s,pa)|0;var Ba=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,d=Math.imul(M,Y),e=Math.imul(M,Z),e=e+Math.imul(N,Y)|0,f=Math.imul(N,Z),d=d+Math.imul(J,_)|0,e=e+Math.imul(J,aa)|0,e=e+Math.imul(K,_)|0,f=f+Math.imul(K,aa)|0,d=d+Math.imul(G,ca)|0,e=e+Math.imul(G,da)|0,e=e+Math.imul(H,ca)|0,f=f+Math.imul(H,da)|0,d=d+Math.imul(D,fa)|0,e=e+Math.imul(D,ga)|0,e=e+Math.imul(E,fa)|0,f=f+Math.imul(E,ga)|0,d=d+Math.imul(A,ia)|0,e=e+Math.imul(A,ja)|0,e=e+Math.imul(B,ia)|0,f=f+Math.imul(B,ja)|0,d=d+Math.imul(x,la)|0,e=e+Math.imul(x,ma)|0,e=e+Math.imul(y,la)|0,f=f+Math.imul(y,ma)|0,d=d+Math.imul(u,oa)|0,e=e+Math.imul(u,pa)|0,e=e+Math.imul(v,oa)|0,f=f+Math.imul(v,pa)|0;var Ca=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,d=Math.imul(M,_),e=Math.imul(M,aa),e=e+Math.imul(N,_)|0,f=Math.imul(N,aa),d=d+Math.imul(J,ca)|0,e=e+Math.imul(J,da)|0,e=e+Math.imul(K,ca)|0,f=f+Math.imul(K,da)|0,d=d+Math.imul(G,fa)|0,e=e+Math.imul(G,ga)|0,e=e+Math.imul(H,fa)|0,f=f+Math.imul(H,ga)|0,d=d+Math.imul(D,ia)|0,e=e+Math.imul(D,ja)|0,e=e+Math.imul(E,ia)|0,f=f+Math.imul(E,ja)|0,d=d+Math.imul(A,la)|0,e=e+Math.imul(A,ma)|0,e=e+Math.imul(B,la)|0,f=f+Math.imul(B,ma)|0,d=d+Math.imul(x,oa)|0,e=e+Math.imul(x,pa)|0,e=e+Math.imul(y,oa)|0,f=f+Math.imul(y,pa)|0;var Da=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Da>>>26)|0,Da&=67108863,d=Math.imul(M,ca),e=Math.imul(M,da),e=e+Math.imul(N,ca)|0,f=Math.imul(N,da),d=d+Math.imul(J,fa)|0,e=e+Math.imul(J,ga)|0,e=e+Math.imul(K,fa)|0,f=f+Math.imul(K,ga)|0,d=d+Math.imul(G,ia)|0,e=e+Math.imul(G,ja)|0,e=e+Math.imul(H,ia)|0,f=f+Math.imul(H,ja)|0,d=d+Math.imul(D,la)|0,e=e+Math.imul(D,ma)|0,e=e+Math.imul(E,la)|0,f=f+Math.imul(E,ma)|0,d=d+Math.imul(A,oa)|0,e=e+Math.imul(A,pa)|0,e=e+Math.imul(B,oa)|0,f=f+Math.imul(B,pa)|0;var Ea=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,d=Math.imul(M,fa),e=Math.imul(M,ga),e=e+Math.imul(N,fa)|0,f=Math.imul(N,ga),d=d+Math.imul(J,ia)|0,e=e+Math.imul(J,ja)|0,e=e+Math.imul(K,ia)|0,f=f+Math.imul(K,ja)|0,d=d+Math.imul(G,la)|0,e=e+Math.imul(G,ma)|0,e=e+Math.imul(H,la)|0,f=f+Math.imul(H,ma)|0,d=d+Math.imul(D,oa)|0,e=e+Math.imul(D,pa)|0,e=e+Math.imul(E,oa)|0,f=f+Math.imul(E,pa)|0;var Fa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,d=Math.imul(M,ia),e=Math.imul(M,ja),e=e+Math.imul(N,ia)|0,f=Math.imul(N,ja),d=d+Math.imul(J,la)|0,e=e+Math.imul(J,ma)|0,e=e+Math.imul(K,la)|0,f=f+Math.imul(K,ma)|0,d=d+Math.imul(G,oa)|0,e=e+Math.imul(G,pa)|0,e=e+Math.imul(H,oa)|0,f=f+Math.imul(H,pa)|0;var Ga=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,d=Math.imul(M,la),e=Math.imul(M,ma),e=e+Math.imul(N,la)|0,f=Math.imul(N,ma),d=d+Math.imul(J,oa)|0,e=e+Math.imul(J,pa)|0,e=e+Math.imul(K,oa)|0,f=f+Math.imul(K,pa)|0;var Ha=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,d=Math.imul(M,oa),e=Math.imul(M,pa),e=e+Math.imul(N,oa)|0,f=Math.imul(N,pa);var Ia=(j+d|0)+((8191&e)<<13)|0;return j=(f+(e>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,i[0]=qa,i[1]=ra,i[2]=sa,i[3]=ta,i[4]=ua,i[5]=va,i[6]=wa,i[7]=xa,i[8]=ya,i[9]=za,i[10]=Aa,i[11]=Ba,i[12]=Ca,i[13]=Da,i[14]=Ea,i[15]=Fa,i[16]=Ga,i[17]=Ha,i[18]=Ia,0!==j&&(i[19]=j,c.length++),c};Math.imul||(z=j),f.prototype.mulTo=function(a,b){var c,d=this.length+a.length;return c=10===this.length&&10===a.length?z(this,a,b):d<63?j(this,a,b):d<1024?k(this,a,b):l(this,a,b)},m.prototype.makeRBT=function(a){for(var b=new Array(a),c=f.prototype._countBits(a)-1,d=0;d>=1;return d},m.prototype.permute=function(a,b,c,d,e,f){for(var g=0;g>>=1)e++;return 1<>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b>>26-c}g&&(this.words[b]=g,this.length++)}if(0!==e){for(b=this.length-1;b>=0;b--)this.words[b+e]=this.words[b];for(b=0;b=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<g)for(this.length-=g,j=0;j=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&0!==k&&(i.words[i.length++]=k),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(a,b,c){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()),{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null, mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:ea.length)return 1;if(this.length=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){de&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function B(a){if(A[a])return A[a];var B;if("k256"===a)B=new o;else if("p224"===a)B=new p;else if("p192"===a)B=new q;else{if("p25519"!==a)throw new Error("Unknown prime "+a);B=new r}return A[a]=B,B},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:2}],2:[function(a,b,c){},{}],3:[function(a,b,c){function d(a){"string"==typeof a&&a.match(/^0x[0-9A-Fa-f]{40}$/)||i("invalid address",{input:a}),a=a.toLowerCase();for(var b=a.substring(2).split(""),c=0;c>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":6,"./keccak256":7,"./throw-error":12,"bn.js":1}],4:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f}},{"./convert":6,"./properties":9,"./throw-error":12,"bn.js":1}],5:[function(a,b,c){function d(a){if(!a.from)throw new Error("missing from address");var b=a.nonce;return e("0x"+g(h.encode([e(a.from),f.stripZeros(f.hexlify(b,"nonce"))])).substring(26))}var e=a("./address").getAddress,f=a("./convert"),g=a("./keccak256"),h=a("./rlp");b.exports={getContractAddress:d}},{"./address":3,"./convert":6,"./keccak256":7,"./rlp":10}],6:[function(a,b,c){function d(a){return a.slice?a:(a.slice=function(){var b=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(a,b))},a)}function e(a){if(!a||parseInt(a.length)!=a.length||"string"==typeof a)return!1;for(var b=0;b=256||parseInt(c)!=c)return!1}return!0}function f(a,b){if(a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var c=[],f=0;f>4]+m[15&g])}return"0x"+d.join("")}l("invalid hexlify value",{name:b,input:a})}var l=(a("./properties.js").defineProperty,a("./throw-error")),m="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,hexlify:k,isHexString:j}},{"./properties.js":9,"./throw-error":12}],7:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":6,"js-sha3":15}],8:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":6}],11:[function(a,b,c){(function(c){function d(){}function e(a){null==c.ethers&&f(c,"ethers",new d);for(var b in a)null==c.ethers[b]&&f(c.ethers,b,a[b])}var f=a("./properties.js").defineProperty;b.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./properties.js":9}],12:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],13:[function(a,b,c){function d(a){for(var b=[],c=0,d=0;d>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":6}],14:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],15:[function(a,b,c){(function(a,c){!function(){"use strict";function d(a,b,c){this.blocks=[],this.s=[],this.padding=b,this.outputBits=c,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(a<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var d=0;d<50;++d)this.s[d]=0}var e="object"==typeof window?window:{},f=!e.JS_SHA3_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node;f&&(e=c);for(var g=!e.JS_SHA3_NO_COMMON_JS&&"object"==typeof b&&b.exports,h="0123456789abcdef".split(""),i=[31,7936,2031616,520093696],j=[1,256,65536,16777216],k=[6,1536,393216,100663296],l=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],n=[224,256,384,512],o=[128,256],p=["hex","buffer","arrayBuffer","array"],q=function(a,b,c){return function(e){return new d(a,b,a).update(e)[c]()}},r=function(a,b,c){return function(e,f){return new d(a,b,f).update(e)[c]()}},s=function(a,b){var c=q(a,b,"hex");c.create=function(){return new d(a,b,a)},c.update=function(a){return c.create().update(a)};for(var e=0;e>2]|=a[i]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(f[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=g){for(this.start=c-g,this.block=f[h],c=0;c>2]|=this.padding[3&b],this.lastByteIndex===this.byteCount)for(a[0]=a[c],b=1;b>4&15]+h[15&a]+h[a>>12&15]+h[a>>8&15]+h[a>>20&15]+h[a>>16&15]+h[a>>28&15]+h[a>>24&15];g%b===0&&(C(c),f=0)}return e&&(a=c[f],e>0&&(i+=h[a>>4&15]+h[15&a]),e>1&&(i+=h[a>>12&15]+h[a>>8&15]),e>2&&(i+=h[a>>20&15]+h[a>>16&15])),i},d.prototype.arrayBuffer=function(){this.finalize();var a,b=this.blockCount,c=this.s,d=this.outputBlocks,e=this.extraBytes,f=0,g=0,h=this.outputBits>>3;a=e?new ArrayBuffer(d+1<<2):new ArrayBuffer(h);for(var i=new Uint32Array(a);g>8&255,i[a+2]=b>>16&255,i[a+3]=b>>24&255;h%c===0&&C(d)}return f&&(a=h<<2,b=d[g],f>0&&(i[a]=255&b),f>1&&(i[a+1]=b>>8&255),f>2&&(i[a+2]=b>>16&255)),i};var C=function(a){var b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka;for(d=0;d<48;d+=2)e=a[0]^a[10]^a[20]^a[30]^a[40],f=a[1]^a[11]^a[21]^a[31]^a[41],g=a[2]^a[12]^a[22]^a[32]^a[42],h=a[3]^a[13]^a[23]^a[33]^a[43],i=a[4]^a[14]^a[24]^a[34]^a[44],j=a[5]^a[15]^a[25]^a[35]^a[45],k=a[6]^a[16]^a[26]^a[36]^a[46],l=a[7]^a[17]^a[27]^a[37]^a[47],n=a[8]^a[18]^a[28]^a[38]^a[48],o=a[9]^a[19]^a[29]^a[39]^a[49],b=n^(g<<1|h>>>31),c=o^(h<<1|g>>>31),a[0]^=b,a[1]^=c,a[10]^=b,a[11]^=c,a[20]^=b,a[21]^=c,a[30]^=b,a[31]^=c,a[40]^=b,a[41]^=c,b=e^(i<<1|j>>>31),c=f^(j<<1|i>>>31),a[2]^=b,a[3]^=c,a[12]^=b,a[13]^=c,a[22]^=b,a[23]^=c,a[32]^=b,a[33]^=c,a[42]^=b,a[43]^=c,b=g^(k<<1|l>>>31),c=h^(l<<1|k>>>31),a[4]^=b,a[5]^=c,a[14]^=b,a[15]^=c,a[24]^=b,a[25]^=c,a[34]^=b,a[35]^=c,a[44]^=b,a[45]^=c,b=i^(n<<1|o>>>31),c=j^(o<<1|n>>>31),a[6]^=b,a[7]^=c,a[16]^=b,a[17]^=c,a[26]^=b,a[27]^=c,a[36]^=b,a[37]^=c,a[46]^=b,a[47]^=c,b=k^(e<<1|f>>>31),c=l^(f<<1|e>>>31),a[8]^=b,a[9]^=c,a[18]^=b,a[19]^=c,a[28]^=b,a[29]^=c,a[38]^=b,a[39]^=c,a[48]^=b,a[49]^=c,p=a[0],q=a[1],V=a[11]<<4|a[10]>>>28,W=a[10]<<4|a[11]>>>28,D=a[20]<<3|a[21]>>>29,E=a[21]<<3|a[20]>>>29,ha=a[31]<<9|a[30]>>>23,ia=a[30]<<9|a[31]>>>23,R=a[40]<<18|a[41]>>>14,S=a[41]<<18|a[40]>>>14,J=a[2]<<1|a[3]>>>31,K=a[3]<<1|a[2]>>>31,r=a[13]<<12|a[12]>>>20,s=a[12]<<12|a[13]>>>20,X=a[22]<<10|a[23]>>>22,Y=a[23]<<10|a[22]>>>22,F=a[33]<<13|a[32]>>>19,G=a[32]<<13|a[33]>>>19,ja=a[42]<<2|a[43]>>>30,ka=a[43]<<2|a[42]>>>30,ba=a[5]<<30|a[4]>>>2,ca=a[4]<<30|a[5]>>>2,L=a[14]<<6|a[15]>>>26,M=a[15]<<6|a[14]>>>26,t=a[25]<<11|a[24]>>>21,u=a[24]<<11|a[25]>>>21,Z=a[34]<<15|a[35]>>>17,$=a[35]<<15|a[34]>>>17,H=a[45]<<29|a[44]>>>3,I=a[44]<<29|a[45]>>>3,z=a[6]<<28|a[7]>>>4,A=a[7]<<28|a[6]>>>4,da=a[17]<<23|a[16]>>>9,ea=a[16]<<23|a[17]>>>9,N=a[26]<<25|a[27]>>>7,O=a[27]<<25|a[26]>>>7,v=a[36]<<21|a[37]>>>11,w=a[37]<<21|a[36]>>>11,_=a[47]<<24|a[46]>>>8,aa=a[46]<<24|a[47]>>>8,T=a[8]<<27|a[9]>>>5,U=a[9]<<27|a[8]>>>5,B=a[18]<<20|a[19]>>>12,C=a[19]<<20|a[18]>>>12,fa=a[29]<<7|a[28]>>>25,ga=a[28]<<7|a[29]>>>25,P=a[38]<<8|a[39]>>>24,Q=a[39]<<8|a[38]>>>24,x=a[48]<<14|a[49]>>>18,y=a[49]<<14|a[48]>>>18,a[0]=p^~r&t,a[1]=q^~s&u,a[10]=z^~B&D,a[11]=A^~C&E,a[20]=J^~L&N,a[21]=K^~M&O,a[30]=T^~V&X,a[31]=U^~W&Y,a[40]=ba^~da&fa,a[41]=ca^~ea&ga,a[2]=r^~t&v,a[3]=s^~u&w,a[12]=B^~D&F,a[13]=C^~E&G,a[22]=L^~N&P,a[23]=M^~O&Q,a[32]=V^~X&Z,a[33]=W^~Y&$,a[42]=da^~fa&ha,a[43]=ea^~ga&ia,a[4]=t^~v&x,a[5]=u^~w&y,a[14]=D^~F&H,a[15]=E^~G&I,a[24]=N^~P&R,a[25]=O^~Q&S,a[34]=X^~Z&_,a[35]=Y^~$&aa,a[44]=fa^~ha&ja,a[45]=ga^~ia&ka,a[6]=v^~x&p,a[7]=w^~y&q,a[16]=F^~H&z,a[17]=G^~I&A,a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function e(a){var b=[];for(var c in a)if(null!=a[c]){var e=k.hexlify(a[c]);({gasLimit:!0,gasPrice:!0,nonce:!0,value:!0})[c]&&(e=d(e)),b.push(c+"="+e)}return b.join("&")}function f(a,b){j.call(this,a);var c=null;switch(this.name){case"homestead":c="https://api.etherscan.io";break;case"ropsten":c="https://ropsten.etherscan.io";break;case"rinkeby":c="https://rinkeby.etherscan.io";break;case"kovan":c="https://kovan.etherscan.io";break;default:throw new Error("unsupported network")}k.defineProperty(this,"baseUrl",c),k.defineProperty(this,"apiKey",b||null)}function g(a){if(0==a.status&&"No records found"===a.message)return a.result;if(1!=a.status||"OK"!=a.message){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}return a.result}function h(a){if("2.0"!=a.jsonrpc){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}if(a.error){var b=new Error(a.error.message||"unknown error");throw a.error.code&&(b.code=a.error.code),a.error.data&&(b.data=a.error.data),b}return a.result}function i(a){if("pending"===a)throw new Error("pending not supported");return"latest"===a?a:parseInt(a.substring(2),16)}var j=a("./provider.js"),k=function(){var b=a("ethers-utils/convert.js");return{defineProperty:a("ethers-utils/properties.js").defineProperty,hexlify:b.hexlify}}();j.inherits(f),k.defineProperty(f.prototype,"_call",function(){}),k.defineProperty(f.prototype,"_callProxy",function(){}),k.defineProperty(f.prototype,"perform",function(a,b){b||(b={});var c=this.baseUrl,f="";switch(this.apiKey&&(f+="&apikey="+this.apiKey),a){case"getBlockNumber":return c+="/api?module=proxy&action=eth_blockNumber"+f,j.fetchJSON(c,null,h);case"getGasPrice":return c+="/api?module=proxy&action=eth_gasPrice"+f,j.fetchJSON(c,null,h);case"getBalance":return c+="/api?module=account&action=balance&address="+b.address,c+="&tag="+b.blockTag+f,j.fetchJSON(c,null,g);case"getTransactionCount":return c+="/api?module=proxy&action=eth_getTransactionCount&address="+b.address,c+="&tag="+b.blockTag+f,j.fetchJSON(c,null,h);case"getCode":return c+="/api?module=proxy&action=eth_getCode&address="+b.address,c+="&tag="+b.blockTag+f,j.fetchJSON(c,null,h);case"getStorageAt":return c+="/api?module=proxy&action=eth_getStorageAt&address="+b.address,c+="&position="+d(b.position),c+="&tag="+d(b.blockTag)+f,j.fetchJSON(c,null,h);case"sendTransaction":return c+="/api?module=proxy&action=eth_sendRawTransaction&hex="+b.signedTransaction,c+=f,j.fetchJSON(c,null,h);case"getBlock":if(b.blockTag)return c+="/api?module=proxy&action=eth_getBlockByNumber&tag="+d(b.blockTag), -c+="&boolean=false",c+=f,j.fetchJSON(c,null,h);throw new Error("getBlock by blockHash not implmeneted");case"getTransaction":return c+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+b.transactionHash,c+=f,j.fetchJSON(c,null,h);case"getTransactionReceipt":return c+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+b.transactionHash,c+=f,j.fetchJSON(c,null,h);case"call":var k=e(b.transaction);return k&&(k="&"+k),c+="/api?module=proxy&action=eth_call"+k,c+=f,j.fetchJSON(c,null,h);case"estimateGas":var k=e(b.transaction);return k&&(k="&"+k),c+="/api?module=proxy&action=eth_estimateGas&"+k,c+=f,j.fetchJSON(c,null,h);case"getLogs":c+="/api?module=logs&action=getLogs";try{if(b.filter.fromBlock&&(c+="&fromBlock="+i(b.filter.fromBlock)),b.filter.toBlock&&(c+="&toBlock="+i(b.filter.toBlock)),b.filter.address&&(c+="&address="+b.filter.address),b.filter.topics&&b.filter.topics.length>0){if(b.filter.topics.length>1)throw new Error("unsupported topic format");var l=b.filter.topics[0];if("string"!=typeof l||66!==l.length)throw new Error("unsupported topic0 format");c+="&topic0="+l}}catch(m){return Promise.reject(m)}return c+=f,j.fetchJSON(c,null,g)}return Promise.reject(new Error("not implemented - "+a))}),b.exports=f},{"./provider.js":24,"ethers-utils/convert.js":6,"ethers-utils/properties.js":9}],19:[function(a,b,c){"use strict";function d(a){if(0===a.length)throw new Error("no providers");var b={};if(["chainId","ensAddress","name","testnet"].forEach(function(c){for(var d=1;d3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function f(a){var b={};for(var c in a)b[c]=i.hexlify(a[c]);return["gasLimit","gasPrice","nonce","value"].forEach(function(a){b[a]&&(b[a]=e(b[a]))}),b}function g(a,b){if(!(this instanceof g))throw new Error("missing new");var c=[];"string"!=typeof a||null!=h.networks[a]?(c.push(a),null!=b&&c.push(b),a=null):2===arguments.length?c.push(arguments[1]):3===arguments.length&&(c.push(arguments[1]),c.push(arguments[2])),h.apply(this,c),a||(a="http://localhost:8545"),i.defineProperty(this,"url",a)}var h=a("./provider.js"),i=function(){var b=a("ethers-utils/convert");return{defineProperty:a("ethers-utils/properties").defineProperty,hexlify:b.hexlify,isHexString:b.isHexString}}();h.inherits(g),i.defineProperty(g.prototype,"send",function(a,b){var c={method:a,params:b,id:42,jsonrpc:"2.0"};return h.fetchJSON(this.url,JSON.stringify(c),d)}),i.defineProperty(g.prototype,"perform",function(a,b){switch(a){case"getBlockNumber":return this.send("eth_blockNumber",[]);case"getGasPrice":return this.send("eth_gasPrice",[]);case"getBalance":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getBalance",[b.address,c]);case"getTransactionCount":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getTransactionCount",[b.address,c]);case"getCode":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getCode",[b.address,c]);case"getStorageAt":var d=b.position;i.isHexString(d)&&(d=e(d));var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getStorageAt",[b.address,d,c]);case"sendTransaction":return this.send("eth_sendRawTransaction",[b.signedTransaction]);case"getBlock":if(b.blockTag){var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getBlockByNumber",[c,!1])}return b.blockHash?this.send("eth_getBlockByHash",[b.blockHash,!1]):Promise.reject(new Error("invalid block tag or block hash"));case"getTransaction":return this.send("eth_getTransactionByHash",[b.transactionHash]);case"getTransactionReceipt":return this.send("eth_getTransactionReceipt",[b.transactionHash]);case"call":return this.send("eth_call",[f(b.transaction),"latest"]);case"estimateGas":return this.send("eth_estimateGas",[f(b.transaction)]);case"getLogs":return this.send("eth_getLogs",[b.filter])}return Promise.reject(new Error("not implemented - "+a))}),b.exports=g},{"./provider.js":24,"ethers-utils/convert":6,"ethers-utils/properties":9}],23:[function(a,b,c){b.exports={unspecified:{chainId:0,name:"unspecified"},homestead:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},mainnet:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},morden:{chainId:2,name:"morden"},ropsten:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},testnet:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},rinkeby:{chainId:4,name:"rinkeby"},kovan:{chainId:42,name:"kovan"}}},{}],24:[function(a,b,c){"use strict";function d(a){var b={};for(var c in a)b[c]=a[c];return b}function e(a,b){var c={};for(var d in a)try{var e=a[d](b[d]);void 0!==e&&(c[d]=e)}catch(f){throw f.checkKey=d,f.checkValue=b[d],f}return c}function f(a,b){return function(c){return null==c?b:a(c)}}function g(a,b){return function(c){return c?a(c):b}}function h(a){return function(b){if(!Array.isArray(b))throw new Error("not an array");var c=[];return b.forEach(function(b){c.push(a(b))}),c}}function i(a){if(!D.isHexString(a)||66!==a.length)throw new Error("invalid hash - "+a);return a}function j(a){return D.bigNumberify(a).toNumber()}function k(a){if(!D.isHexString(a))throw new Error("invalid uint256");for(;a.length<66;)a="0x0"+a.substring(2);return a}function l(a){if("string"!=typeof a)throw new Error("invalid string");return a}function m(a){if(null==a)return"latest";if("earliest"===a)return"0x0";if("latest"===a||"pending"===a)return a;if("number"==typeof a)return D.hexlify(a);if(D.isHexString(a))return a;throw new Error("invalid blockTag")}function n(a){return null!=a.author&&null==a.miner&&(a.miner=a.author),e(E,a)}function o(a){if(null!=a.gas&&null==a.gasLimit&&(a.gasLimit=a.gas),null!=a.input&&null==a.data&&(a.data=a.input),null==a.to&&null==a.creates&&(a.creates=D.getContractAddress(a)),!a.raw&&a.v&&a.r&&a.s){var b=[D.hexlify(a.nonce),D.hexlify(a.gasPrice),D.hexlify(a.gasLimit),a.to||"0x",D.hexlify(a.value||"0x"),D.hexlify(a.data||"0x"),D.hexlify(a.v||"0x"),D.hexlify(a.r),D.hexlify(a.s)];a.raw=D.RLP.encode(b)}var c=e(F,a),d=a.networkId;return D.isHexString(d)&&(d=D.bigNumberify(d).toNumber()),"number"!=typeof d&&null!=c.v&&(d=(c.v-35)/2,d<0&&(d=0),d=parseInt(d)),"number"!=typeof d&&(d=0),c.networkId=d,c.blockHash&&"x"===c.blockHash.replace(/0/g,"")&&(c.blockHash=null),c}function p(a){return e(G,a)}function q(a){return e(H,a)}function r(a){var b=a.status,c=a.root;if(!(null!=b^null!=c))throw new Error("invalid transaction receipt - exactly one of status and root should be present");var d=e(I,a);return d.logs.forEach(function(a,b){null==a.transactionLogIndex&&(a.transactionLogIndex=b),null==a.type&&(a.type="mined")}),null!=a.status&&(d.byzantium=!0),d}function s(a){return Array.isArray(a)?a.forEach(function(a){s(a)}):null!=a&&i(a),a}function t(a){return e(J,a)}function u(a){return e(K,a)}function v(a){function b(){e.getBlockNumber().then(function(a){if(a!==f){null===f&&(f=a-1);for(var b=f+1;b<=a;b++)e.emit("block",b);var c={};Object.keys(d).forEach(function(b){var d=z(b);"transaction"===d.type?e.getTransaction(d.hash).then(function(a){a&&a.blockNumber&&e.emit(d.hash,a)}):"address"===d.type?(g[d.address]&&(c[d.address]=g[d.address]),e.getBalance(d.address,"latest").then(function(a){var b=g[d.address];b&&a.eq(b)||(g[d.address]=a,e.emit(d.address,a))})):"topic"===d.type&&e.getLogs({fromBlock:f+1,toBlock:a,topics:d.topic}).then(function(a){0!==a.length&&a.forEach(function(a){e.emit(d.topic,a)})})}),f=a,g=c}}),e.doPoll()}if(!(this instanceof v))throw new Error("missing new");a=v._legacyConstructor(a,arguments.length,arguments[0],arguments[1]);var c=null;a.ensAddress&&(c=D.getAddress(a.ensAddress)),D.defineProperty(this,"chainId",a.chainId),D.defineProperty(this,"ensAddress",c),D.defineProperty(this,"name",a.name),D.defineProperty(this,"testnet","homestead"!==a.name);var d={};D.defineProperty(this,"_events",d);var e=this,f=null,g={};D.defineProperty(this,"resetEventsBlock",function(a){f=a,e.doPoll()});var h=null;Object.defineProperty(this,"polling",{get:function(){return null!=h},set:function(a){setTimeout(function(){a&&!h?h=setInterval(b,4e3):!a&&h&&(clearInterval(h),h=null)},0)}})}function w(a){return function(b){A(b,a),D.defineProperty(b,"inherits",w(b))}}function x(a,b){if(Array.isArray(a)){var c=[];return a.forEach(function(a){c.push(x(a,b))}),c}return b(a)}function y(a){try{return"address:"+D.getAddress(a)}catch(b){}if("block"===a)return"block";if(D.isHexString(a)){if(66===a.length)return"tx:"+a}else if(Array.isArray(a)){a=x(a,function(a){return null==a&&(a="0x"),a});try{return"topic:"+D.RLP.encode(a)}catch(b){console.log(b)}}throw new Error("invalid event - "+a)}function z(a){if("tx:"===a.substring(0,3))return{type:"transaction",hash:a.substring(3)};if("block"===a)return{type:"block"};if("address:"===a.substring(0,8))return{type:"address",address:a.substring(8)};if("topic:"===a.substring(0,6))try{var b=D.RLP.decode(a.substring(6));return b=x(b,function(a){return"0x"===a&&(a=null),a}),{type:"topic",topic:b}}catch(c){console.log(c)}throw new Error("invalid event string")}var A=a("inherits"),B=a("xmlhttprequest").XMLHttpRequest,C=a("./networks.json"),D=function(){var b=a("ethers-utils/convert");return{defineProperty:a("ethers-utils/properties").defineProperty,getAddress:a("ethers-utils/address").getAddress,getContractAddress:a("ethers-utils/contract-address").getContractAddress,bigNumberify:a("ethers-utils/bignumber").bigNumberify,arrayify:b.arrayify,hexlify:b.hexlify,isHexString:b.isHexString,concat:b.concat,namehash:a("ethers-utils/namehash"),toUtf8String:a("ethers-utils/utf8").toUtf8String,RLP:a("ethers-utils/rlp")}}(),E={hash:i,parentHash:i,number:j,timestamp:j,nonce:f(D.hexlify),difficulty:f(j),gasLimit:D.bigNumberify,gasUsed:D.bigNumberify,miner:D.getAddress,extraData:D.hexlify,transactions:f(h(i))},F={hash:i,blockHash:f(i,null),blockNumber:f(j,null),transactionIndex:f(j,null),from:D.getAddress,gasPrice:D.bigNumberify,gasLimit:D.bigNumberify,to:f(D.getAddress,null),value:D.bigNumberify,nonce:j,data:D.hexlify,r:f(k),s:f(k),v:f(j),creates:f(D.getAddress,null),raw:f(D.hexlify)},G={from:f(D.getAddress),nonce:f(j),gasLimit:f(D.bigNumberify),gasPrice:f(D.bigNumberify),to:f(D.getAddress),value:f(D.bigNumberify),data:f(D.hexlify)},H={transactionLogIndex:f(j),transactionIndex:j,blockNumber:j,transactionHash:i,address:D.getAddress,type:f(l),topics:h(i),data:D.hexlify,logIndex:j,blockHash:i},I={contractAddress:f(D.getAddress,null),transactionIndex:j,root:f(i),gasUsed:D.bigNumberify,logsBloom:D.hexlify,blockHash:i,transactionHash:i,logs:h(q),blockNumber:j,cumulativeGasUsed:D.bigNumberify,status:f(j)},J={fromBlock:f(m,void 0),toBlock:f(m,void 0),address:f(D.getAddress,void 0),topics:f(s,void 0)},K={blockNumber:j,transactionIndex:j,address:D.getAddress,data:g(D.hexlify,"0x"),topics:h(i),transactionHash:i,logIndex:j};D.defineProperty(v,"inherits",w(v)),D.defineProperty(v,"_legacyConstructor",function(a,b,c,d){if("boolean"==typeof c||2===b){var e=!!c,f=d;a=C[e?"ropsten":"homestead"],2===b&&null!=f&&(a={chainId:f,ensAddress:a.ensAddress,name:a.name})}else if("string"==typeof a){if(a=C[a],!a)throw new Error("unknown network")}else null==a&&(a=C.homestead);if("number"!=typeof a.chainId)throw new Error("invalid chainId");return a}),D.defineProperty(v,"chainId",{homestead:1,morden:2,ropsten:3,rinkeby:4,kovan:42}),D.defineProperty(v,"networks",C),D.defineProperty(v,"fetchJSON",function(a,b,c){return new Promise(function(d,e){var f=new B;b?(f.open("POST",a,!0),f.setRequestHeader("Content-Type","application/json")):f.open("GET",a,!0),f.onreadystatechange=function(){if(4===f.readyState){try{var g=JSON.parse(f.responseText)}catch(h){var i=new Error("invalid json response");return i.orginialError=h,i.responseText=f.responseText,void e(i)}if(c)try{g=c(g)}catch(h){return h.url=a,h.body=b,h.responseText=f.responseText,void e(h)}if(200!=f.status){var h=new Error("invalid response - "+f.status);return h.statusCode=f.statusCode,void e(h)}d(g)}},f.onerror=function(a){e(a)};try{b?f.send(b):f.send()}catch(g){var h=new Error("connection error");h.error=g,e(h)}})}),D.defineProperty(v.prototype,"waitForTransaction",function(a,b){var c=this;return new Promise(function(d,e){function f(a){g&&clearTimeout(g),d(a)}var g=null;c.once(a,f),"number"==typeof b&&b>0&&(g=setTimeout(function(){c.removeListener(a,f),e(new Error("timeout"))},b))})}),D.defineProperty(v.prototype,"getBlockNumber",function(){try{return this.perform("getBlockNumber").then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getBlockNumber");return b})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"getGasPrice",function(){try{return this.perform("getGasPrice").then(function(a){return D.bigNumberify(a)})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"getBalance",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getBalance",d).then(function(a){return D.bigNumberify(a)})})}),D.defineProperty(v.prototype,"getTransactionCount",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getTransactionCount",d).then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getTransactionCount");return b})})}),D.defineProperty(v.prototype,"getCode",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getCode",d).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"getStorageAt",function(a,b,c){var d=this;return this.resolveName(a).then(function(a){var e={address:a,blockTag:m(c),position:D.hexlify(b)};return d.perform("getStorageAt",e).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"sendTransaction",function(a){try{var b={signedTransaction:D.hexlify(a)};return this.perform("sendTransaction",b).then(function(a){if(a=D.hexlify(a),66!==a.length)throw new Error("invalid response - sendTransaction");return a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"call",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:p(a)};return b.perform("call",c).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"estimateGas",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:p(a)};return b.perform("estimateGas",c).then(function(a){return D.bigNumberify(a)})})}),D.defineProperty(v.prototype,"getBlock",function(a){try{var b=D.hexlify(a);if(66===b.length)return this.perform("getBlock",{blockHash:b}).then(function(a){return n(a)})}catch(c){console.log("DEBUG",c)}try{var d=m(a);return this.perform("getBlock",{blockTag:d}).then(function(a){return n(a)})}catch(c){console.log("DEBUG",c)}return Promise.reject(new Error("invalid block hash or block tag"))}),D.defineProperty(v.prototype,"getTransaction",function(a){try{var b={transactionHash:i(a)};return this.perform("getTransaction",b).then(function(a){return null!=a&&(a=o(a)),a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"getTransactionReceipt",function(a){try{var b={transactionHash:i(a)};return this.perform("getTransactionReceipt",b).then(function(a){return null!=a&&(a=r(a)),a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"getLogs",function(a){var b=this;return this._resolveNames(a,["address"]).then(function(a){var c={filter:t(a)};return b.perform("getLogs",c).then(function(a){return h(u)(a)})})}),D.defineProperty(v.prototype,"getEtherPrice",function(){try{return this.perform("getEtherPrice",{}).then(function(a){return a})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"_resolveNames",function(a,b){var c=[],e=d(a);return b.forEach(function(a){void 0!==e[a]&&c.push(this.resolveName(e[a]).then(function(b){e[a]=b}))},this),Promise.all(c).then(function(){return e})}),D.defineProperty(v.prototype,"_getResolver",function(a){var b=D.namehash(a),c="0x0178b8bf"+b.substring(2),d={to:this.ensAddress,data:c};return this.call(d).then(function(a){return 66!=a.length?null:D.getAddress("0x"+a.substring(26))})}),D.defineProperty(v.prototype,"resolveName",function(a){try{return Promise.resolve(D.getAddress(a))}catch(b){}var c=this,d=D.namehash(a);return this._getResolver(a).then(function(a){var b="0x3b3b57de"+d.substring(2),e={to:a,data:b};return c.call(e)}).then(function(a){if(66!=a.length)return null;var b=D.getAddress("0x"+a.substring(26));return"0x0000000000000000000000000000000000000000"===b?null:b})}),D.defineProperty(v.prototype,"lookupAddress",function(a){a=D.getAddress(a);var b=a.substring(2)+".addr.reverse",c=D.namehash(b),d=this;return this._getResolver(b).then(function(a){if(!a)return null;var b="0x691f3431"+c.substring(2),e={to:a,data:b};return d.call(e)}).then(function(b){if(b=b.substring(2),b.length<64)return null;if(b=b.substring(64),b.length<64)return null;var c=D.bigNumberify("0x"+b.substring(0,64)).toNumber();if(b=b.substring(64),2*c>b.length)return null;var e=D.toUtf8String("0x"+b.substring(0,2*c));return d.resolveName(e).then(function(b){return b!=a?null:e})})}),D.defineProperty(v.prototype,"doPoll",function(){}),D.defineProperty(v.prototype,"perform",function(a,b){return Promise.reject(new Error("not implemented - "+a))}),D.defineProperty(v.prototype,"on",function(a,b){var c=y(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"on"}),this.polling=!0}),D.defineProperty(v.prototype,"once",function(a,b){var c=y(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"once"}),this.polling=!0}),D.defineProperty(v.prototype,"emit",function(a){var b=y(a),c=Array.prototype.slice.call(arguments,1),d=this._events[b];if(d){for(var e=0;e0){if(b.filter.topics.length>1)throw new Error("unsupported topic format");var l=b.filter.topics[0];if("string"!=typeof l||66!==l.length)throw new Error("unsupported topic0 format");c+="&topic0="+l}}catch(m){return Promise.reject(m)}return c+=f,j.fetchJSON(c,null,g)}return Promise.reject(new Error("not implemented - "+a))}),b.exports=f},{"./provider.js":24,"ethers-utils/convert.js":6,"ethers-utils/properties.js":9}],19:[function(a,b,c){"use strict";function d(a){if(0===a.length)throw new Error("no providers");var b={};if(["chainId","ensAddress","name","testnet"].forEach(function(c){for(var d=1;d3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function f(a){var b={};for(var c in a)b[c]=i.hexlify(a[c]);return["gasLimit","gasPrice","nonce","value"].forEach(function(a){b[a]&&(b[a]=e(b[a]))}),b}function g(a,b){if(!(this instanceof g))throw new Error("missing new");var c=[];"string"!=typeof a||null!=h.networks[a]?(c.push(a),null!=b&&c.push(b),a=null):2===arguments.length?c.push(arguments[1]):3===arguments.length&&(c.push(arguments[1]),c.push(arguments[2])),h.apply(this,c),a||(a="http://localhost:8545"),i.defineProperty(this,"url",a)}var h=a("./provider.js"),i=function(){var b=a("ethers-utils/convert");return{defineProperty:a("ethers-utils/properties").defineProperty,hexlify:b.hexlify,isHexString:b.isHexString}}();h.inherits(g),i.defineProperty(g.prototype,"send",function(a,b){var c={method:a,params:b,id:42,jsonrpc:"2.0"};return h.fetchJSON(this.url,JSON.stringify(c),d)}),i.defineProperty(g.prototype,"perform",function(a,b){switch(a){case"getBlockNumber":return this.send("eth_blockNumber",[]);case"getGasPrice":return this.send("eth_gasPrice",[]);case"getBalance":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getBalance",[b.address,c]);case"getTransactionCount":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getTransactionCount",[b.address,c]);case"getCode":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getCode",[b.address,c]);case"getStorageAt":var d=b.position;i.isHexString(d)&&(d=e(d));var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getStorageAt",[b.address,d,c]);case"sendTransaction":return this.send("eth_sendRawTransaction",[b.signedTransaction]);case"getBlock":if(b.blockTag){var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getBlockByNumber",[c,!1])}return b.blockHash?this.send("eth_getBlockByHash",[b.blockHash,!1]):Promise.reject(new Error("invalid block tag or block hash"));case"getTransaction":return this.send("eth_getTransactionByHash",[b.transactionHash]);case"getTransactionReceipt":return this.send("eth_getTransactionReceipt",[b.transactionHash]);case"call":return this.send("eth_call",[f(b.transaction),"latest"]);case"estimateGas":return this.send("eth_estimateGas",[f(b.transaction)]);case"getLogs":return this.send("eth_getLogs",[b.filter])}return Promise.reject(new Error("not implemented - "+a))}),b.exports=g},{"./provider.js":24,"ethers-utils/convert":6,"ethers-utils/properties":9}],23:[function(a,b,c){b.exports={unspecified:{chainId:0,name:"unspecified"},homestead:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},mainnet:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},morden:{chainId:2,name:"morden"},ropsten:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},testnet:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},rinkeby:{chainId:4,name:"rinkeby"},kovan:{chainId:42,name:"kovan"}}},{}],24:[function(a,b,c){"use strict";function d(a){var b={};for(var c in a)b[c]=a[c];return b}function e(a,b){var c={};for(var d in a)try{var e=a[d](b[d]);void 0!==e&&(c[d]=e)}catch(f){throw f.checkKey=d,f.checkValue=b[d],f}return c}function f(a,b){return function(c){return null==c?b:a(c)}}function g(a,b){return function(c){return c?a(c):b}}function h(a){return function(b){if(!Array.isArray(b))throw new Error("not an array");var c=[];return b.forEach(function(b){c.push(a(b))}),c}}function i(a){if(!D.isHexString(a)||66!==a.length)throw new Error("invalid hash - "+a);return a}function j(a){return D.bigNumberify(a).toNumber()}function k(a){if(!D.isHexString(a))throw new Error("invalid uint256");for(;a.length<66;)a="0x0"+a.substring(2);return a}function l(a){if("string"!=typeof a)throw new Error("invalid string");return a}function m(a){if(null==a)return"latest";if("earliest"===a)return"0x0";if("latest"===a||"pending"===a)return a;if("number"==typeof a)return D.hexlify(a);if(D.isHexString(a))return a;throw new Error("invalid blockTag")}function n(a){return null!=a.author&&null==a.miner&&(a.miner=a.author),e(E,a)}function o(a){if(null!=a.gas&&null==a.gasLimit&&(a.gasLimit=a.gas),a.to&&D.bigNumberify(a.to).isZero&&(a.to="0x0000000000000000000000000000000000000000"),null!=a.input&&null==a.data&&(a.data=a.input),null==a.to&&null==a.creates&&(a.creates=D.getContractAddress(a)),!a.raw&&a.v&&a.r&&a.s){var b=[D.hexlify(a.nonce),D.hexlify(a.gasPrice),D.hexlify(a.gasLimit),a.to||"0x",D.hexlify(a.value||"0x"),D.hexlify(a.data||"0x"),D.hexlify(a.v||"0x"),D.hexlify(a.r),D.hexlify(a.s)];a.raw=D.RLP.encode(b)}var c=e(F,a),d=a.networkId;return D.isHexString(d)&&(d=D.bigNumberify(d).toNumber()),"number"!=typeof d&&null!=c.v&&(d=(c.v-35)/2,d<0&&(d=0),d=parseInt(d)),"number"!=typeof d&&(d=0),c.networkId=d,c.blockHash&&"x"===c.blockHash.replace(/0/g,"")&&(c.blockHash=null),c}function p(a){return e(G,a)}function q(a){return e(H,a)}function r(a){var b=(a.status,a.root,e(I,a));return b.logs.forEach(function(a,b){null==a.transactionLogIndex&&(a.transactionLogIndex=b),null==a.type&&(a.type="mined")}),null!=a.status&&(b.byzantium=!0),b}function s(a){return Array.isArray(a)?a.forEach(function(a){s(a)}):null!=a&&i(a),a}function t(a){return e(J,a)}function u(a){return e(K,a)}function v(a){function b(){e.getBlockNumber().then(function(a){if(a!==f){null===f&&(f=a-1);for(var b=f+1;b<=a;b++)e.emit("block",b);var c={};Object.keys(d).forEach(function(b){var d=z(b);"transaction"===d.type?e.getTransaction(d.hash).then(function(a){a&&a.blockNumber&&e.emit(d.hash,a)}):"address"===d.type?(g[d.address]&&(c[d.address]=g[d.address]),e.getBalance(d.address,"latest").then(function(a){var b=g[d.address];b&&a.eq(b)||(g[d.address]=a,e.emit(d.address,a))})):"topic"===d.type&&e.getLogs({fromBlock:f+1,toBlock:a,topics:d.topic}).then(function(a){0!==a.length&&a.forEach(function(a){e.emit(d.topic,a)})})}),f=a,g=c}}),e.doPoll()}if(!(this instanceof v))throw new Error("missing new");a=v._legacyConstructor(a,arguments.length,arguments[0],arguments[1]);var c=null;a.ensAddress&&(c=D.getAddress(a.ensAddress)),D.defineProperty(this,"chainId",a.chainId),D.defineProperty(this,"ensAddress",c),D.defineProperty(this,"name",a.name),D.defineProperty(this,"testnet","homestead"!==a.name);var d={};D.defineProperty(this,"_events",d);var e=this,f=null,g={};D.defineProperty(this,"resetEventsBlock",function(a){f=a,e.doPoll()});var h=null;Object.defineProperty(this,"polling",{get:function(){return null!=h},set:function(a){setTimeout(function(){a&&!h?h=setInterval(b,4e3):!a&&h&&(clearInterval(h),h=null)},0)}})}function w(a){return function(b){A(b,a),D.defineProperty(b,"inherits",w(b))}}function x(a,b){if(Array.isArray(a)){var c=[];return a.forEach(function(a){c.push(x(a,b))}),c}return b(a)}function y(a){try{return"address:"+D.getAddress(a)}catch(b){}if("block"===a)return"block";if(D.isHexString(a)){if(66===a.length)return"tx:"+a}else if(Array.isArray(a)){a=x(a,function(a){return null==a&&(a="0x"),a});try{return"topic:"+D.RLP.encode(a)}catch(b){console.log(b)}}throw new Error("invalid event - "+a)}function z(a){if("tx:"===a.substring(0,3))return{type:"transaction",hash:a.substring(3)};if("block"===a)return{type:"block"};if("address:"===a.substring(0,8))return{type:"address",address:a.substring(8)};if("topic:"===a.substring(0,6))try{var b=D.RLP.decode(a.substring(6));return b=x(b,function(a){return"0x"===a&&(a=null),a}),{type:"topic",topic:b}}catch(c){console.log(c)}throw new Error("invalid event string")}var A=a("inherits"),B=a("xmlhttprequest").XMLHttpRequest,C=a("./networks.json"),D=function(){var b=a("ethers-utils/convert");return{defineProperty:a("ethers-utils/properties").defineProperty,getAddress:a("ethers-utils/address").getAddress,getContractAddress:a("ethers-utils/contract-address").getContractAddress,bigNumberify:a("ethers-utils/bignumber").bigNumberify,arrayify:b.arrayify,hexlify:b.hexlify,isHexString:b.isHexString,concat:b.concat,namehash:a("ethers-utils/namehash"),toUtf8String:a("ethers-utils/utf8").toUtf8String,RLP:a("ethers-utils/rlp")}}(),E={hash:i,parentHash:i,number:j,timestamp:j,nonce:f(D.hexlify),difficulty:f(j),gasLimit:D.bigNumberify,gasUsed:D.bigNumberify,miner:D.getAddress,extraData:D.hexlify,transactions:f(h(i))},F={hash:i,blockHash:f(i,null),blockNumber:f(j,null),transactionIndex:f(j,null),from:D.getAddress,gasPrice:D.bigNumberify,gasLimit:D.bigNumberify,to:f(D.getAddress,null),value:D.bigNumberify,nonce:j,data:D.hexlify,r:f(k),s:f(k),v:f(j),creates:f(D.getAddress,null),raw:f(D.hexlify)},G={from:f(D.getAddress),nonce:f(j),gasLimit:f(D.bigNumberify),gasPrice:f(D.bigNumberify),to:f(D.getAddress),value:f(D.bigNumberify),data:f(D.hexlify)},H={transactionLogIndex:f(j),transactionIndex:j,blockNumber:j,transactionHash:i,address:D.getAddress,type:f(l),topics:h(i),data:D.hexlify,logIndex:j,blockHash:i},I={contractAddress:f(D.getAddress,null),transactionIndex:j,root:f(i),gasUsed:D.bigNumberify,logsBloom:D.hexlify,blockHash:i,transactionHash:i,logs:h(q),blockNumber:j,cumulativeGasUsed:D.bigNumberify,status:f(j)},J={fromBlock:f(m,void 0),toBlock:f(m,void 0),address:f(D.getAddress,void 0),topics:f(s,void 0)},K={blockNumber:j,transactionIndex:j,address:D.getAddress,data:g(D.hexlify,"0x"),topics:h(i),transactionHash:i,logIndex:j};D.defineProperty(v,"inherits",w(v)),D.defineProperty(v,"_legacyConstructor",function(a,b,c,d){if("boolean"==typeof c||2===b){var e=!!c,f=d;a=C[e?"ropsten":"homestead"],2===b&&null!=f&&(a={chainId:f,ensAddress:a.ensAddress,name:a.name})}else if("string"==typeof a){if(a=C[a],!a)throw new Error("unknown network")}else null==a&&(a=C.homestead);if("number"!=typeof a.chainId)throw new Error("invalid chainId");return a}),D.defineProperty(v,"chainId",{homestead:1,morden:2,ropsten:3,rinkeby:4,kovan:42}),D.defineProperty(v,"networks",C),D.defineProperty(v,"fetchJSON",function(a,b,c){return new Promise(function(d,e){var f=new B;b?(f.open("POST",a,!0),f.setRequestHeader("Content-Type","application/json")):f.open("GET",a,!0),f.onreadystatechange=function(){if(4===f.readyState){try{var g=JSON.parse(f.responseText)}catch(h){var i=new Error("invalid json response");return i.orginialError=h,i.responseText=f.responseText,void e(i)}if(c)try{g=c(g)}catch(h){return h.url=a,h.body=b,h.responseText=f.responseText,void e(h)}if(200!=f.status){var h=new Error("invalid response - "+f.status);return h.statusCode=f.statusCode,void e(h)}d(g)}},f.onerror=function(a){e(a)};try{b?f.send(b):f.send()}catch(g){var h=new Error("connection error");h.error=g,e(h)}})}),D.defineProperty(v.prototype,"waitForTransaction",function(a,b){var c=this;return new Promise(function(d,e){function f(a){g&&clearTimeout(g),d(a)}var g=null;c.once(a,f),"number"==typeof b&&b>0&&(g=setTimeout(function(){c.removeListener(a,f),e(new Error("timeout"))},b))})}),D.defineProperty(v.prototype,"getBlockNumber",function(){try{return this.perform("getBlockNumber").then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getBlockNumber");return b})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"getGasPrice",function(){try{return this.perform("getGasPrice").then(function(a){return D.bigNumberify(a)})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"getBalance",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getBalance",d).then(function(a){return D.bigNumberify(a)})})}),D.defineProperty(v.prototype,"getTransactionCount",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getTransactionCount",d).then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getTransactionCount");return b})})}),D.defineProperty(v.prototype,"getCode",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getCode",d).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"getStorageAt",function(a,b,c){var d=this;return this.resolveName(a).then(function(a){var e={address:a,blockTag:m(c),position:D.hexlify(b)};return d.perform("getStorageAt",e).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"sendTransaction",function(a){try{var b={signedTransaction:D.hexlify(a)};return this.perform("sendTransaction",b).then(function(a){if(a=D.hexlify(a),66!==a.length)throw new Error("invalid response - sendTransaction");return a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"call",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:p(a)};return b.perform("call",c).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"estimateGas",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:p(a)};return b.perform("estimateGas",c).then(function(a){return D.bigNumberify(a)})})}),D.defineProperty(v.prototype,"getBlock",function(a){try{var b=D.hexlify(a);if(66===b.length)return this.perform("getBlock",{blockHash:b}).then(function(a){return n(a)})}catch(c){console.log("DEBUG",c)}try{var d=m(a);return this.perform("getBlock",{blockTag:d}).then(function(a){return n(a)})}catch(c){console.log("DEBUG",c)}return Promise.reject(new Error("invalid block hash or block tag"))}),D.defineProperty(v.prototype,"getTransaction",function(a){try{var b={transactionHash:i(a)};return this.perform("getTransaction",b).then(function(a){return null!=a&&(a=o(a)),a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"getTransactionReceipt",function(a){try{var b={transactionHash:i(a)};return this.perform("getTransactionReceipt",b).then(function(a){return null!=a&&(a=r(a)),a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"getLogs",function(a){var b=this;return this._resolveNames(a,["address"]).then(function(a){var c={filter:t(a)};return b.perform("getLogs",c).then(function(a){return h(u)(a)})})}),D.defineProperty(v.prototype,"getEtherPrice",function(){try{return this.perform("getEtherPrice",{}).then(function(a){return a})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"_resolveNames",function(a,b){var c=[],e=d(a);return b.forEach(function(a){void 0!==e[a]&&c.push(this.resolveName(e[a]).then(function(b){e[a]=b}))},this),Promise.all(c).then(function(){return e})}),D.defineProperty(v.prototype,"_getResolver",function(a){var b=D.namehash(a),c="0x0178b8bf"+b.substring(2),d={to:this.ensAddress,data:c};return this.call(d).then(function(a){return 66!=a.length?null:D.getAddress("0x"+a.substring(26))})}),D.defineProperty(v.prototype,"resolveName",function(a){try{return Promise.resolve(D.getAddress(a))}catch(b){}var c=this,d=D.namehash(a);return this._getResolver(a).then(function(a){var b="0x3b3b57de"+d.substring(2),e={to:a,data:b};return c.call(e)}).then(function(a){if(66!=a.length)return null;var b=D.getAddress("0x"+a.substring(26));return"0x0000000000000000000000000000000000000000"===b?null:b})}),D.defineProperty(v.prototype,"lookupAddress",function(a){a=D.getAddress(a);var b=a.substring(2)+".addr.reverse",c=D.namehash(b),d=this;return this._getResolver(b).then(function(a){if(!a)return null;var b="0x691f3431"+c.substring(2),e={to:a,data:b};return d.call(e)}).then(function(b){if(b=b.substring(2),b.length<64)return null;if(b=b.substring(64),b.length<64)return null;var c=D.bigNumberify("0x"+b.substring(0,64)).toNumber();if(b=b.substring(64),2*c>b.length)return null;var e=D.toUtf8String("0x"+b.substring(0,2*c));return d.resolveName(e).then(function(b){return b!=a?null:e})})}),D.defineProperty(v.prototype,"doPoll",function(){}),D.defineProperty(v.prototype,"perform",function(a,b){return Promise.reject(new Error("not implemented - "+a))}),D.defineProperty(v.prototype,"on",function(a,b){var c=y(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"on"}),this.polling=!0}),D.defineProperty(v.prototype,"once",function(a,b){var c=y(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"once"}),this.polling=!0}),D.defineProperty(v.prototype,"emit",function(a){var b=y(a),c=Array.prototype.slice.call(arguments,1),d=this._events[b];if(d){for(var e=0;e>2,this._Ke[c][b%4]=f[b],this._Kd[a-c][b%4]=f[b];for(var g,h=0,j=e;j>16&255]<<24^p[g>>8&255]<<16^p[255&g]<<8^p[g>>24&255]^o[h]<<24,h+=1,8!=e)for(var b=1;b>8&255]<<8^p[g>>16&255]<<16^p[g>>24&255]<<24;for(var b=e/2+1;b>2,l=j%4,this._Ke[k][l]=f[b],this._Kd[a-k][l]=f[b++],j++}for(var k=1;k>24&255]^A[g>>16&255]^B[g>>8&255]^C[255&g]},D.prototype.encrypt=function(a){if(16!=a.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var b=this._Ke.length-1,c=[0,0,0,0],d=i(a),e=0;e<4;e++)d[e]^=this._Ke[0][e];for(var f=1;f>24&255]^s[d[(e+1)%4]>>16&255]^t[d[(e+2)%4]>>8&255]^u[255&d[(e+3)%4]]^this._Ke[f][e];d=c.slice()}for(var h,j=g(16),e=0;e<4;e++)h=this._Ke[b][e],j[4*e]=255&(p[d[e]>>24&255]^h>>24),j[4*e+1]=255&(p[d[(e+1)%4]>>16&255]^h>>16),j[4*e+2]=255&(p[d[(e+2)%4]>>8&255]^h>>8),j[4*e+3]=255&(p[255&d[(e+3)%4]]^h);return j},D.prototype.decrypt=function(a){if(16!=a.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var b=this._Kd.length-1,c=[0,0,0,0],d=i(a),e=0;e<4;e++)d[e]^=this._Kd[0][e];for(var f=1;f>24&255]^w[d[(e+3)%4]>>16&255]^x[d[(e+2)%4]>>8&255]^y[255&d[(e+1)%4]]^this._Kd[f][e];d=c.slice()}for(var h,j=g(16),e=0;e<4;e++)h=this._Kd[b][e],j[4*e]=255&(q[d[e]>>24&255]^h>>24),j[4*e+1]=255&(q[d[(e+3)%4]>>16&255]^h>>16),j[4*e+2]=255&(q[d[(e+2)%4]>>8&255]^h>>8),j[4*e+3]=255&(q[255&d[(e+1)%4]]^h);return j};var E=function(a){if(!(this instanceof E))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new D(a)};E.prototype.encrypt=function(a){if(a=f(a),a.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var b=g(a.length),c=g(16),d=0;d=0;--b)this._counter[b]=a%256,a>>=8},I.prototype.setBytes=function(a){if(a=f(a,!0),16!=a.length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=a},I.prototype.increment=function(){for(var a=15;a>=0;a--){if(255!==this._counter[a]){this._counter[a]++;break}this._counter[a]=0}};var J=function(a,b){if(!(this instanceof J))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",b instanceof I||(b=new I(b)),this._counter=b,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new D(a)};J.prototype.encrypt=function(a){for(var b=f(a,!0),c=0;c=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return d}function h(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;g=49?h-49+10:h>=17?h-17+10:h}return e}function i(a){for(var b=new Array(a.bitLength()),c=0;c>>e}return b}function j(a,b,c){c.negative=b.negative^a.negative;var d=a.length+b.length|0;c.length=d,d=d-1|0;var e=0|a.words[0],f=0|b.words[0],g=e*f,h=67108863&g,i=g/67108864|0;c.words[0]=h;for(var j=1;j>>26,l=67108863&i,m=Math.min(j,b.length-1),n=Math.max(0,j-a.length+1);n<=m;n++){var o=j-n|0;e=0|a.words[o],f=0|b.words[n],g=e*f+l,k+=g/67108864|0,l=67108863&g}c.words[j]=0|l,i=0|k}return 0!==i?c.words[j]=0|i:c.length--,c.strip()}function k(a,b,c){c.negative=b.negative^a.negative,c.length=a.length+b.length;for(var d=0,e=0,f=0;f>>26)|0,e+=g>>>26,g&=67108863}c.words[f]=h,d=g,g=e}return 0!==d?c.words[f]=d:c.length--,c.strip()}function l(a,b,c){var d=new m;return d.mulp(a,b,c)}function m(a,b){this.x=a,this.y=b}function n(a,b){this.name=a,this.p=new f(b,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function o(){n.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){n.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){n.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function r(){n.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function s(a){if("string"==typeof a){var b=f._prime(a);this.m=b.p,this.prime=b}else d(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}function t(a){s.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof b?b.exports=f:c.BN=f,f.BN=f,f.wordSize=26;var u;try{u=a("buffer").Buffer}catch(v){}f.isBN=function(a){return a instanceof f||null!==a&&"object"==typeof a&&a.constructor.wordSize===f.wordSize&&Array.isArray(a.words)},f.max=function(a,b){return a.cmp(b)>0?a:b},f.min=function(a,b){return a.cmp(b)<0?a:b},f.prototype._init=function(a,b,c){if("number"==typeof a)return this._initNumber(a,b,c);if("object"==typeof a)return this._initArray(a,b,c);"hex"===b&&(b=16),d(b===(0|b)&&b>=2&&b<=36),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.negative=1),this.strip(),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initNumber=function(a,b,c){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[67108863&a],this.length=1):a<4503599627370496?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(d(a<9007199254740992),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initArray=function(a,b,c){if(d("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e=0;e-=3)g=a[e]|a[e-1]<<8|a[e-2]<<16,this.words[f]|=g<>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);else if("le"===c)for(e=0,f=0;e>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);return this.strip()},f.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c=b;c-=6)e=g(a,c,c+6),this.words[d]|=e<>>26-f&4194303,f+=24,f>=26&&(f-=26,d++);c+6!==b&&(e=g(a,b,c+6),this.words[d]|=e<>>26-f&4194303),this.strip()},f.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;e<=67108863;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,g=f%d,i=Math.min(f,f-g)+c,j=0,k=c;k1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(a,b){a=a||10,b=0|b||1;var c;if(16===a||"hex"===a){c="";for(var e=0,f=0,g=0;g>>24-e&16777215,c=0!==f||g!==this.length-1?w[6-i.length]+i+c:i+c,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(c=f.toString(16)+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(a===(0|a)&&a>=2&&a<=36){var j=x[a],k=y[a];c="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modn(k).toString(a);l=l.idivn(k),c=l.isZero()?m+c:w[j-m.length]+m+c}for(this.isZero()&&(c="0"+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}d(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var a=this.words[0];return 2===this.length?a+=67108864*this.words[1]:3===this.length&&1===this.words[2]?a+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-a:a},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(a,b){return d("undefined"!=typeof u),this.toArrayLike(u,a,b)},f.prototype.toArray=function(a,b){return this.toArrayLike(Array,a,b)},f.prototype.toArrayLike=function(a,b,c){var e=this.byteLength(),f=c||Math.max(1,e);d(e<=f,"byte array longer than desired length"),d(f>0,"Requested array length <= 0"),this.strip();var g,h,i="le"===b,j=new a(f),k=this.clone();if(i){for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[h]=g;for(;h=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},f.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},f.prototype.bitLength=function(){var a=this.words[this.length-1],b=this._countBits(a);return 26*(this.length-1)+b},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,b=0;ba.length?this.clone().ior(a):a.clone().ior(this)},f.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},f.prototype.iuand=function(a){var b;b=this.length>a.length?a:this;for(var c=0;ca.length?this.clone().iand(a):a.clone().iand(this)},f.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},f.prototype.iuxor=function(a){var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;da.length?this.clone().ixor(a):a.clone().ixor(this)},f.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},f.prototype.inotn=function(a){d("number"==typeof a&&a>=0);var b=0|Math.ceil(a/26),c=a%26;this._expand(b),c>0&&b--;for(var e=0;e0&&(this.words[e]=~this.words[e]&67108863>>26-c),this.strip()},f.prototype.notn=function(a){return this.clone().inotn(a)},f.prototype.setn=function(a,b){d("number"==typeof a&&a>=0);var c=a/26|0,e=a%26;return this._expand(c+1),b?this.words[c]=this.words[c]|1<a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f>>26;for(;0!==e&&f>>26;if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;fa.length?this.clone().iadd(a):a.clone().iadd(this)},f.prototype.isub=function(a){if(0!==a.negative){a.negative=0;var b=this.iadd(a);return a.negative=1,b._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var c=this.cmp(a);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g>26,this.words[g]=67108863&b;for(;0!==f&&g>26,this.words[g]=67108863&b;if(0===f&&g>>13,n=0|g[1],o=8191&n,p=n>>>13,q=0|g[2],r=8191&q,s=q>>>13,t=0|g[3],u=8191&t,v=t>>>13,w=0|g[4],x=8191&w,y=w>>>13,z=0|g[5],A=8191&z,B=z>>>13,C=0|g[6],D=8191&C,E=C>>>13,F=0|g[7],G=8191&F,H=F>>>13,I=0|g[8],J=8191&I,K=I>>>13,L=0|g[9],M=8191&L,N=L>>>13,O=0|h[0],P=8191&O,Q=O>>>13,R=0|h[1],S=8191&R,T=R>>>13,U=0|h[2],V=8191&U,W=U>>>13,X=0|h[3],Y=8191&X,Z=X>>>13,$=0|h[4],_=8191&$,aa=$>>>13,ba=0|h[5],ca=8191&ba,da=ba>>>13,ea=0|h[6],fa=8191&ea,ga=ea>>>13,ha=0|h[7],ia=8191&ha,ja=ha>>>13,ka=0|h[8],la=8191&ka,ma=ka>>>13,na=0|h[9],oa=8191&na,pa=na>>>13;c.negative=a.negative^b.negative,c.length=19,d=Math.imul(l,P),e=Math.imul(l,Q),e=e+Math.imul(m,P)|0,f=Math.imul(m,Q);var qa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(qa>>>26)|0,qa&=67108863,d=Math.imul(o,P),e=Math.imul(o,Q),e=e+Math.imul(p,P)|0,f=Math.imul(p,Q),d=d+Math.imul(l,S)|0,e=e+Math.imul(l,T)|0,e=e+Math.imul(m,S)|0,f=f+Math.imul(m,T)|0;var ra=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ra>>>26)|0,ra&=67108863,d=Math.imul(r,P),e=Math.imul(r,Q),e=e+Math.imul(s,P)|0,f=Math.imul(s,Q),d=d+Math.imul(o,S)|0,e=e+Math.imul(o,T)|0,e=e+Math.imul(p,S)|0,f=f+Math.imul(p,T)|0,d=d+Math.imul(l,V)|0,e=e+Math.imul(l,W)|0,e=e+Math.imul(m,V)|0,f=f+Math.imul(m,W)|0;var sa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(sa>>>26)|0,sa&=67108863,d=Math.imul(u,P),e=Math.imul(u,Q),e=e+Math.imul(v,P)|0,f=Math.imul(v,Q),d=d+Math.imul(r,S)|0,e=e+Math.imul(r,T)|0,e=e+Math.imul(s,S)|0,f=f+Math.imul(s,T)|0,d=d+Math.imul(o,V)|0,e=e+Math.imul(o,W)|0,e=e+Math.imul(p,V)|0,f=f+Math.imul(p,W)|0,d=d+Math.imul(l,Y)|0,e=e+Math.imul(l,Z)|0,e=e+Math.imul(m,Y)|0,f=f+Math.imul(m,Z)|0;var ta=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ta>>>26)|0,ta&=67108863,d=Math.imul(x,P),e=Math.imul(x,Q),e=e+Math.imul(y,P)|0,f=Math.imul(y,Q),d=d+Math.imul(u,S)|0,e=e+Math.imul(u,T)|0,e=e+Math.imul(v,S)|0,f=f+Math.imul(v,T)|0,d=d+Math.imul(r,V)|0,e=e+Math.imul(r,W)|0,e=e+Math.imul(s,V)|0,f=f+Math.imul(s,W)|0,d=d+Math.imul(o,Y)|0,e=e+Math.imul(o,Z)|0,e=e+Math.imul(p,Y)|0,f=f+Math.imul(p,Z)|0,d=d+Math.imul(l,_)|0,e=e+Math.imul(l,aa)|0,e=e+Math.imul(m,_)|0,f=f+Math.imul(m,aa)|0;var ua=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ua>>>26)|0,ua&=67108863,d=Math.imul(A,P),e=Math.imul(A,Q),e=e+Math.imul(B,P)|0,f=Math.imul(B,Q),d=d+Math.imul(x,S)|0,e=e+Math.imul(x,T)|0,e=e+Math.imul(y,S)|0,f=f+Math.imul(y,T)|0,d=d+Math.imul(u,V)|0,e=e+Math.imul(u,W)|0,e=e+Math.imul(v,V)|0,f=f+Math.imul(v,W)|0,d=d+Math.imul(r,Y)|0,e=e+Math.imul(r,Z)|0,e=e+Math.imul(s,Y)|0,f=f+Math.imul(s,Z)|0,d=d+Math.imul(o,_)|0,e=e+Math.imul(o,aa)|0,e=e+Math.imul(p,_)|0,f=f+Math.imul(p,aa)|0,d=d+Math.imul(l,ca)|0,e=e+Math.imul(l,da)|0,e=e+Math.imul(m,ca)|0,f=f+Math.imul(m,da)|0;var va=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(va>>>26)|0,va&=67108863,d=Math.imul(D,P),e=Math.imul(D,Q),e=e+Math.imul(E,P)|0,f=Math.imul(E,Q),d=d+Math.imul(A,S)|0,e=e+Math.imul(A,T)|0,e=e+Math.imul(B,S)|0,f=f+Math.imul(B,T)|0,d=d+Math.imul(x,V)|0,e=e+Math.imul(x,W)|0,e=e+Math.imul(y,V)|0,f=f+Math.imul(y,W)|0,d=d+Math.imul(u,Y)|0,e=e+Math.imul(u,Z)|0,e=e+Math.imul(v,Y)|0,f=f+Math.imul(v,Z)|0,d=d+Math.imul(r,_)|0,e=e+Math.imul(r,aa)|0,e=e+Math.imul(s,_)|0,f=f+Math.imul(s,aa)|0,d=d+Math.imul(o,ca)|0,e=e+Math.imul(o,da)|0,e=e+Math.imul(p,ca)|0,f=f+Math.imul(p,da)|0,d=d+Math.imul(l,fa)|0,e=e+Math.imul(l,ga)|0,e=e+Math.imul(m,fa)|0,f=f+Math.imul(m,ga)|0;var wa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(wa>>>26)|0,wa&=67108863,d=Math.imul(G,P),e=Math.imul(G,Q),e=e+Math.imul(H,P)|0,f=Math.imul(H,Q),d=d+Math.imul(D,S)|0,e=e+Math.imul(D,T)|0,e=e+Math.imul(E,S)|0,f=f+Math.imul(E,T)|0,d=d+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,e=e+Math.imul(B,V)|0,f=f+Math.imul(B,W)|0,d=d+Math.imul(x,Y)|0,e=e+Math.imul(x,Z)|0,e=e+Math.imul(y,Y)|0,f=f+Math.imul(y,Z)|0,d=d+Math.imul(u,_)|0,e=e+Math.imul(u,aa)|0,e=e+Math.imul(v,_)|0,f=f+Math.imul(v,aa)|0,d=d+Math.imul(r,ca)|0,e=e+Math.imul(r,da)|0,e=e+Math.imul(s,ca)|0,f=f+Math.imul(s,da)|0,d=d+Math.imul(o,fa)|0,e=e+Math.imul(o,ga)|0,e=e+Math.imul(p,fa)|0,f=f+Math.imul(p,ga)|0,d=d+Math.imul(l,ia)|0,e=e+Math.imul(l,ja)|0,e=e+Math.imul(m,ia)|0,f=f+Math.imul(m,ja)|0;var xa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(xa>>>26)|0,xa&=67108863,d=Math.imul(J,P),e=Math.imul(J,Q),e=e+Math.imul(K,P)|0,f=Math.imul(K,Q),d=d+Math.imul(G,S)|0,e=e+Math.imul(G,T)|0,e=e+Math.imul(H,S)|0,f=f+Math.imul(H,T)|0,d=d+Math.imul(D,V)|0,e=e+Math.imul(D,W)|0,e=e+Math.imul(E,V)|0,f=f+Math.imul(E,W)|0,d=d+Math.imul(A,Y)|0,e=e+Math.imul(A,Z)|0,e=e+Math.imul(B,Y)|0,f=f+Math.imul(B,Z)|0,d=d+Math.imul(x,_)|0,e=e+Math.imul(x,aa)|0,e=e+Math.imul(y,_)|0,f=f+Math.imul(y,aa)|0,d=d+Math.imul(u,ca)|0,e=e+Math.imul(u,da)|0,e=e+Math.imul(v,ca)|0,f=f+Math.imul(v,da)|0,d=d+Math.imul(r,fa)|0,e=e+Math.imul(r,ga)|0,e=e+Math.imul(s,fa)|0,f=f+Math.imul(s,ga)|0,d=d+Math.imul(o,ia)|0,e=e+Math.imul(o,ja)|0,e=e+Math.imul(p,ia)|0,f=f+Math.imul(p,ja)|0,d=d+Math.imul(l,la)|0,e=e+Math.imul(l,ma)|0,e=e+Math.imul(m,la)|0,f=f+Math.imul(m,ma)|0;var ya=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ya>>>26)|0,ya&=67108863,d=Math.imul(M,P),e=Math.imul(M,Q),e=e+Math.imul(N,P)|0,f=Math.imul(N,Q),d=d+Math.imul(J,S)|0,e=e+Math.imul(J,T)|0,e=e+Math.imul(K,S)|0,f=f+Math.imul(K,T)|0,d=d+Math.imul(G,V)|0,e=e+Math.imul(G,W)|0,e=e+Math.imul(H,V)|0,f=f+Math.imul(H,W)|0,d=d+Math.imul(D,Y)|0,e=e+Math.imul(D,Z)|0,e=e+Math.imul(E,Y)|0,f=f+Math.imul(E,Z)|0,d=d+Math.imul(A,_)|0,e=e+Math.imul(A,aa)|0,e=e+Math.imul(B,_)|0,f=f+Math.imul(B,aa)|0,d=d+Math.imul(x,ca)|0,e=e+Math.imul(x,da)|0,e=e+Math.imul(y,ca)|0,f=f+Math.imul(y,da)|0,d=d+Math.imul(u,fa)|0,e=e+Math.imul(u,ga)|0,e=e+Math.imul(v,fa)|0,f=f+Math.imul(v,ga)|0,d=d+Math.imul(r,ia)|0,e=e+Math.imul(r,ja)|0,e=e+Math.imul(s,ia)|0,f=f+Math.imul(s,ja)|0,d=d+Math.imul(o,la)|0,e=e+Math.imul(o,ma)|0,e=e+Math.imul(p,la)|0,f=f+Math.imul(p,ma)|0,d=d+Math.imul(l,oa)|0,e=e+Math.imul(l,pa)|0,e=e+Math.imul(m,oa)|0,f=f+Math.imul(m,pa)|0;var za=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(za>>>26)|0,za&=67108863,d=Math.imul(M,S),e=Math.imul(M,T),e=e+Math.imul(N,S)|0,f=Math.imul(N,T),d=d+Math.imul(J,V)|0,e=e+Math.imul(J,W)|0,e=e+Math.imul(K,V)|0,f=f+Math.imul(K,W)|0,d=d+Math.imul(G,Y)|0,e=e+Math.imul(G,Z)|0,e=e+Math.imul(H,Y)|0,f=f+Math.imul(H,Z)|0,d=d+Math.imul(D,_)|0,e=e+Math.imul(D,aa)|0,e=e+Math.imul(E,_)|0,f=f+Math.imul(E,aa)|0,d=d+Math.imul(A,ca)|0,e=e+Math.imul(A,da)|0,e=e+Math.imul(B,ca)|0,f=f+Math.imul(B,da)|0,d=d+Math.imul(x,fa)|0,e=e+Math.imul(x,ga)|0,e=e+Math.imul(y,fa)|0,f=f+Math.imul(y,ga)|0,d=d+Math.imul(u,ia)|0,e=e+Math.imul(u,ja)|0,e=e+Math.imul(v,ia)|0,f=f+Math.imul(v,ja)|0,d=d+Math.imul(r,la)|0,e=e+Math.imul(r,ma)|0,e=e+Math.imul(s,la)|0,f=f+Math.imul(s,ma)|0,d=d+Math.imul(o,oa)|0,e=e+Math.imul(o,pa)|0,e=e+Math.imul(p,oa)|0,f=f+Math.imul(p,pa)|0;var Aa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,d=Math.imul(M,V),e=Math.imul(M,W),e=e+Math.imul(N,V)|0,f=Math.imul(N,W),d=d+Math.imul(J,Y)|0,e=e+Math.imul(J,Z)|0,e=e+Math.imul(K,Y)|0,f=f+Math.imul(K,Z)|0,d=d+Math.imul(G,_)|0,e=e+Math.imul(G,aa)|0,e=e+Math.imul(H,_)|0,f=f+Math.imul(H,aa)|0,d=d+Math.imul(D,ca)|0,e=e+Math.imul(D,da)|0,e=e+Math.imul(E,ca)|0,f=f+Math.imul(E,da)|0,d=d+Math.imul(A,fa)|0,e=e+Math.imul(A,ga)|0,e=e+Math.imul(B,fa)|0,f=f+Math.imul(B,ga)|0,d=d+Math.imul(x,ia)|0,e=e+Math.imul(x,ja)|0,e=e+Math.imul(y,ia)|0,f=f+Math.imul(y,ja)|0,d=d+Math.imul(u,la)|0,e=e+Math.imul(u,ma)|0,e=e+Math.imul(v,la)|0,f=f+Math.imul(v,ma)|0,d=d+Math.imul(r,oa)|0,e=e+Math.imul(r,pa)|0,e=e+Math.imul(s,oa)|0,f=f+Math.imul(s,pa)|0;var Ba=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,d=Math.imul(M,Y),e=Math.imul(M,Z),e=e+Math.imul(N,Y)|0,f=Math.imul(N,Z),d=d+Math.imul(J,_)|0,e=e+Math.imul(J,aa)|0,e=e+Math.imul(K,_)|0,f=f+Math.imul(K,aa)|0,d=d+Math.imul(G,ca)|0,e=e+Math.imul(G,da)|0,e=e+Math.imul(H,ca)|0,f=f+Math.imul(H,da)|0,d=d+Math.imul(D,fa)|0,e=e+Math.imul(D,ga)|0,e=e+Math.imul(E,fa)|0,f=f+Math.imul(E,ga)|0,d=d+Math.imul(A,ia)|0,e=e+Math.imul(A,ja)|0,e=e+Math.imul(B,ia)|0,f=f+Math.imul(B,ja)|0,d=d+Math.imul(x,la)|0,e=e+Math.imul(x,ma)|0,e=e+Math.imul(y,la)|0,f=f+Math.imul(y,ma)|0,d=d+Math.imul(u,oa)|0,e=e+Math.imul(u,pa)|0,e=e+Math.imul(v,oa)|0,f=f+Math.imul(v,pa)|0;var Ca=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,d=Math.imul(M,_),e=Math.imul(M,aa),e=e+Math.imul(N,_)|0,f=Math.imul(N,aa),d=d+Math.imul(J,ca)|0,e=e+Math.imul(J,da)|0,e=e+Math.imul(K,ca)|0,f=f+Math.imul(K,da)|0,d=d+Math.imul(G,fa)|0,e=e+Math.imul(G,ga)|0,e=e+Math.imul(H,fa)|0,f=f+Math.imul(H,ga)|0,d=d+Math.imul(D,ia)|0,e=e+Math.imul(D,ja)|0,e=e+Math.imul(E,ia)|0,f=f+Math.imul(E,ja)|0,d=d+Math.imul(A,la)|0,e=e+Math.imul(A,ma)|0,e=e+Math.imul(B,la)|0,f=f+Math.imul(B,ma)|0,d=d+Math.imul(x,oa)|0,e=e+Math.imul(x,pa)|0,e=e+Math.imul(y,oa)|0,f=f+Math.imul(y,pa)|0;var Da=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Da>>>26)|0,Da&=67108863,d=Math.imul(M,ca),e=Math.imul(M,da),e=e+Math.imul(N,ca)|0,f=Math.imul(N,da),d=d+Math.imul(J,fa)|0,e=e+Math.imul(J,ga)|0,e=e+Math.imul(K,fa)|0,f=f+Math.imul(K,ga)|0,d=d+Math.imul(G,ia)|0,e=e+Math.imul(G,ja)|0,e=e+Math.imul(H,ia)|0,f=f+Math.imul(H,ja)|0,d=d+Math.imul(D,la)|0,e=e+Math.imul(D,ma)|0,e=e+Math.imul(E,la)|0,f=f+Math.imul(E,ma)|0,d=d+Math.imul(A,oa)|0,e=e+Math.imul(A,pa)|0,e=e+Math.imul(B,oa)|0,f=f+Math.imul(B,pa)|0;var Ea=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,d=Math.imul(M,fa),e=Math.imul(M,ga),e=e+Math.imul(N,fa)|0,f=Math.imul(N,ga),d=d+Math.imul(J,ia)|0,e=e+Math.imul(J,ja)|0,e=e+Math.imul(K,ia)|0,f=f+Math.imul(K,ja)|0,d=d+Math.imul(G,la)|0,e=e+Math.imul(G,ma)|0,e=e+Math.imul(H,la)|0,f=f+Math.imul(H,ma)|0,d=d+Math.imul(D,oa)|0,e=e+Math.imul(D,pa)|0,e=e+Math.imul(E,oa)|0,f=f+Math.imul(E,pa)|0;var Fa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,d=Math.imul(M,ia),e=Math.imul(M,ja),e=e+Math.imul(N,ia)|0,f=Math.imul(N,ja),d=d+Math.imul(J,la)|0,e=e+Math.imul(J,ma)|0,e=e+Math.imul(K,la)|0,f=f+Math.imul(K,ma)|0,d=d+Math.imul(G,oa)|0,e=e+Math.imul(G,pa)|0,e=e+Math.imul(H,oa)|0,f=f+Math.imul(H,pa)|0;var Ga=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,d=Math.imul(M,la),e=Math.imul(M,ma),e=e+Math.imul(N,la)|0,f=Math.imul(N,ma),d=d+Math.imul(J,oa)|0,e=e+Math.imul(J,pa)|0,e=e+Math.imul(K,oa)|0,f=f+Math.imul(K,pa)|0;var Ha=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,d=Math.imul(M,oa),e=Math.imul(M,pa),e=e+Math.imul(N,oa)|0,f=Math.imul(N,pa);var Ia=(j+d|0)+((8191&e)<<13)|0;return j=(f+(e>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,i[0]=qa,i[1]=ra,i[2]=sa,i[3]=ta,i[4]=ua,i[5]=va,i[6]=wa,i[7]=xa,i[8]=ya,i[9]=za,i[10]=Aa,i[11]=Ba,i[12]=Ca,i[13]=Da,i[14]=Ea,i[15]=Fa,i[16]=Ga,i[17]=Ha,i[18]=Ia,0!==j&&(i[19]=j,c.length++),c};Math.imul||(z=j),f.prototype.mulTo=function(a,b){var c,d=this.length+a.length;return c=10===this.length&&10===a.length?z(this,a,b):d<63?j(this,a,b):d<1024?k(this,a,b):l(this,a,b)},m.prototype.makeRBT=function(a){for(var b=new Array(a),c=f.prototype._countBits(a)-1,d=0;d>=1;return d},m.prototype.permute=function(a,b,c,d,e,f){for(var g=0;g>>=1)e++;return 1<>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b>>26-c}g&&(this.words[b]=g,this.length++)}if(0!==e){for(b=this.length-1;b>=0;b--)this.words[b+e]=this.words[b];for(b=0;b=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<g)for(this.length-=g,j=0;j=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&0!==k&&(i.words[i.length++]=k),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(a,b,c){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()),{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:ea.length)return 1;if(this.length=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){de&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function B(a){if(A[a])return A[a];var B;if("k256"===a)B=new o;else if("p224"===a)B=new p;else if("p192"===a)B=new q;else{if("p25519"!==a)throw new Error("Unknown prime "+a);B=new r}return A[a]=B,B},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:5}],4:[function(a,b,c){var d=a("ethers-utils").randomBytes;b.exports=function(a){return d(a)}},{"ethers-utils":40}],5:[function(a,b,c){},{}],6:[function(a,b,c){"use strict";var d=c;d.version=a("../package.json").version,d.utils=a("./elliptic/utils"),d.rand=a("brorand"),d.hmacDRBG=a("./elliptic/hmac-drbg"),d.curve=a("./elliptic/curve"),d.curves=a("./elliptic/curves"),d.ec=a("./elliptic/ec"),d.eddsa=a("./elliptic/eddsa")},{"../package.json":20,"./elliptic/curve":9,"./elliptic/curves":12,"./elliptic/ec":13,"./elliptic/eddsa":16,"./elliptic/hmac-drbg":17,"./elliptic/utils":19,brorand:4}],7:[function(a,b,c){"use strict";function d(a,b){this.type=a,this.p=new f(b.p,16),this.red=b.prime?f.red(b.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=b.n&&new f(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function e(a,b){this.curve=a,this.type=b,this.precomputed=null}var f=a("bn.js"),g=a("../../elliptic"),h=g.utils,i=h.getNAF,j=h.getJSF,k=h.assert;b.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(a,b){k(a.precomputed);var c=a._getDoubles(),d=i(b,1),e=(1<=g;b--)h=(h<<1)+d[b];f.push(h)}for(var j=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=e;m>0;m--){for(var g=0;g=0;h--){for(var b=0;h>=0&&0===f[h];h--)b++;if(h>=0&&b++,g=g.dblp(b),h<0)break;var j=f[h];k(0!==j),g="affine"===a.type?j>0?g.mixedAdd(e[j-1>>1]):g.mixedAdd(e[-j-1>>1].neg()):j>0?g.add(e[j-1>>1]):g.add(e[-j-1>>1].neg())}return"affine"===a.type?g.toP():g},d.prototype._wnafMulAdd=function(a,b,c,d,e){for(var f=this._wnafT1,g=this._wnafT2,h=this._wnafT3,k=0,l=0;l=1;l-=2){var o=l-1,p=l;if(1===f[o]&&1===f[p]){var q=[b[o],null,null,b[p]];0===b[o].y.cmp(b[p].y)?(q[1]=b[o].add(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg())):0===b[o].y.cmp(b[p].y.redNeg())?(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].add(b[p].neg())):(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg()));var r=[-3,-1,-5,-7,0,7,5,1,3],s=j(c[o],c[p]);k=Math.max(s[0].length,k),h[o]=new Array(k),h[p]=new Array(k);for(var t=0;t=0;l--){for(var y=0;l>=0;){for(var z=!0,t=0;t=0&&y++,w=w.dblp(y),l<0)break;for(var t=0;t0?m=g[t][A-1>>1]:A<0&&(m=g[t][-A-1>>1].neg()),w="affine"===m.type?w.mixedAdd(m):w.add(m))}}for(var l=0;l=Math.ceil((a.bitLength()+1)/b.step)},e.prototype._getDoubles=function(a,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,e=0;e=0&&(f=b,g=c),d.negative&&(d=d.neg(),e=e.neg()),f.negative&&(f=f.neg(),g=g.neg()),[{a:d,b:e},{a:f,b:g}]},d.prototype._endoSplit=function(a){var b=this.endo.basis,c=b[0],d=b[1],e=d.b.mul(a).divRound(this.n),f=c.b.neg().mul(a).divRound(this.n),g=e.mul(c.a),h=f.mul(d.a),i=e.mul(c.b),j=f.mul(d.b),k=a.sub(g).sub(h),l=i.add(j).neg();return{k1:k,k2:l}},d.prototype.pointFromX=function(a,b){a=new i(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),d=c.redSqrt();if(0!==d.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var e=d.fromRed().isOdd();return(b&&!e||!b&&e)&&(d=d.redNeg()),this.point(a,d)},d.prototype.validate=function(a){if(a.inf)return!0;var b=a.x,c=a.y,d=this.a.redMul(b),e=b.redSqr().redMul(b).redIAdd(d).redIAdd(this.b);return 0===c.redSqr().redISub(e).cmpn(0)},d.prototype._endoWnafMulAdd=function(a,b,c){for(var d=this._endoWnafT1,e=this._endoWnafT2,f=0;f":""},e.prototype.isInfinity=function(){return this.inf},e.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(0===this.x.cmp(a.x))return this.curve.point(null,null);var b=this.y.redSub(a.y);0!==b.cmpn(0)&&(b=b.redMul(this.x.redSub(a.x).redInvm()));var c=b.redSqr().redISub(this.x).redISub(a.x),d=b.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,d)},e.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(0===a.cmpn(0))return this.curve.point(null,null);var b=this.curve.a,c=this.x.redSqr(),d=a.redInvm(),e=c.redAdd(c).redIAdd(c).redIAdd(b).redMul(d),f=e.redSqr().redISub(this.x.redAdd(this.x)),g=e.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,g)},e.prototype.getX=function(){return this.x.fromRed()},e.prototype.getY=function(){return this.y.fromRed()},e.prototype.mul=function(a){return a=new i(a,16),this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},e.prototype.mulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e):this.curve._wnafMulAdd(1,d,e,2)},e.prototype.jmulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e,!0):this.curve._wnafMulAdd(1,d,e,2,!0)},e.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||0===this.x.cmp(a.x)&&0===this.y.cmp(a.y))},e.prototype.neg=function(a){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var c=this.precomputed,d=function(a){return a.neg()};b.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(d)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(d)}}}return b},e.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a},j(f,k.BasePoint),d.prototype.jpoint=function(a,b,c){return new f(this,a,b,c)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),b=a.redSqr(),c=this.x.redMul(b),d=this.y.redMul(b).redMul(a);return this.curve.point(c,d)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.z.redSqr(),c=this.z.redSqr(),d=this.x.redMul(b),e=a.x.redMul(c),f=this.y.redMul(b.redMul(a.z)),g=a.y.redMul(c.redMul(this.z)),h=d.redSub(e),i=f.redSub(g);if(0===h.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var j=h.redSqr(),k=j.redMul(h),l=d.redMul(j),m=i.redSqr().redIAdd(k).redISub(l).redISub(l),n=i.redMul(l.redISub(m)).redISub(f.redMul(k)),o=this.z.redMul(a.z).redMul(h);return this.curve.jpoint(m,n,o)},f.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var b=this.z.redSqr(),c=this.x,d=a.x.redMul(b),e=this.y,f=a.y.redMul(b).redMul(this.z),g=c.redSub(d),h=e.redSub(f);if(0===g.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=g.redSqr(),j=i.redMul(g),k=c.redMul(i),l=h.redSqr().redIAdd(j).redISub(k).redISub(k),m=h.redMul(k.redISub(l)).redISub(e.redMul(j)),n=this.z.redMul(g); return this.curve.jpoint(l,m,n)},f.prototype.dblp=function(a){if(0===a)return this;if(this.isInfinity())return this;if(!a)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var b=this,c=0;c=0)return!1;if(c.redIAdd(e),0===this.x.cmp(c))return!0}return!1},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":6,"../curve":9,"bn.js":3,inherits:69}],12:[function(a,b,c){"use strict";function d(a){"short"===a.type?this.curve=new h.curve["short"](a):"edwards"===a.type?this.curve=new h.curve.edwards(a):this.curve=new h.curve.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function e(a,b){Object.defineProperty(f,a,{configurable:!0,enumerable:!0,get:function(){var c=new d(b);return Object.defineProperty(f,a,{configurable:!0,enumerable:!0,value:c}),c}})}var f=c,g=a("hash.js"),h=a("../elliptic"),i=h.utils.assert;f.PresetCurve=d,e("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:g.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),e("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:g.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),e("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:g.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),e("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:g.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),e("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:g.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),e("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["9"]}),e("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var j;try{j=a("./precomputed/secp256k1")}catch(k){j=void 0}e("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:g.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",j]})},{"../elliptic":6,"./precomputed/secp256k1":18,"hash.js":57}],13:[function(a,b,c){"use strict";function d(a){return this instanceof d?("string"==typeof a&&(h(f.curves.hasOwnProperty(a),"Unknown curve "+a),a=f.curves[a]),a instanceof f.curves.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),void(this.hash=a.hash||a.curve.hash)):new d(a)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert,i=a("./key"),j=a("./signature");b.exports=d,d.prototype.keyPair=function(a){return new i(this,a)},d.prototype.keyFromPrivate=function(a,b){return i.fromPrivate(this,a,b)},d.prototype.keyFromPublic=function(a,b){return i.fromPublic(this,a,b)},d.prototype.genKeyPair=function(a){a||(a={});for(var b=new f.hmacDRBG({hash:this.hash,pers:a.pers,entropy:a.entropy||f.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),c=this.n.byteLength(),d=this.n.sub(new e(2));;){var g=new e(b.generate(c));if(!(g.cmp(d)>0))return g.iaddn(1),this.keyFromPrivate(g)}},d.prototype._truncateToN=function(a,b){var c=8*a.byteLength()-this.n.bitLength();return c>0&&(a=a.ushrn(c)),!b&&a.cmp(this.n)>=0?a.sub(this.n):a},d.prototype.sign=function(a,b,c,d){"object"==typeof c&&(d=c,c=null),d||(d={}),b=this.keyFromPrivate(b,c),a=this._truncateToN(new e(a,16));for(var g=this.n.byteLength(),h=b.getPrivate().toArray("be",g),i=a.toArray("be",g),k=new f.hmacDRBG({hash:this.hash,entropy:h,nonce:i,pers:d.pers,persEnc:d.persEnc}),l=this.n.sub(new e(1)),m=0;!0;m++){var n=d.k?d.k(m):new e(k.generate(this.n.byteLength()));if(n=this._truncateToN(n,!0),!(n.cmpn(1)<=0||n.cmp(l)>=0)){var o=this.g.mul(n);if(!o.isInfinity()){var p=o.getX(),q=p.umod(this.n);if(0!==q.cmpn(0)){var r=n.invm(this.n).mul(q.mul(b.getPrivate()).iadd(a));if(r=r.umod(this.n),0!==r.cmpn(0)){var s=(o.getY().isOdd()?1:0)|(0!==p.cmp(q)?2:0);return d.canonical&&r.cmp(this.nh)>0&&(r=this.n.sub(r),s^=1),new j({r:q,s:r,recoveryParam:s})}}}}}},d.prototype.verify=function(a,b,c,d){a=this._truncateToN(new e(a,16)),c=this.keyFromPublic(c,d),b=new j(b,"hex");var f=b.r,g=b.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(g.cmpn(1)<0||g.cmp(this.n)>=0)return!1;var h=g.invm(this.n),i=h.mul(a).umod(this.n),k=h.mul(f).umod(this.n);if(!this.curve._maxwellTrick){var l=this.g.mulAdd(i,c.getPublic(),k);return!l.isInfinity()&&0===l.getX().umod(this.n).cmp(f)}var l=this.g.jmulAdd(i,c.getPublic(),k);return!l.isInfinity()&&l.eqXToP(f)},d.prototype.recoverPubKey=function(a,b,c,d){h((3&c)===c,"The recovery param is more than two bits"),b=new j(b,d);var f=this.n,g=new e(a),i=b.r,k=b.s,l=1&c,m=c>>1;if(i.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");i=m?this.curve.pointFromX(i.add(this.curve.n),l):this.curve.pointFromX(i,l);var n=b.r.invm(f),o=f.sub(g).mul(n).umod(f),p=k.mul(n).umod(f);return this.g.mulAdd(o,i,p)},d.prototype.getKeyRecoveryParam=function(a,b,c,d){if(b=new j(b,d),null!==b.recoveryParam)return b.recoveryParam;for(var e=0;e<4;e++){var f;try{f=this.recoverPubKey(a,b,e)}catch(a){continue}if(f.eq(c))return e}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":6,"./key":14,"./signature":15,"bn.js":3}],14:[function(a,b,c){"use strict";function d(a,b){this.ec=a,this.priv=null,this.pub=null,b.priv&&this._importPrivate(b.priv,b.privEnc),b.pub&&this._importPublic(b.pub,b.pubEnc)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.fromPublic=function(a,b,c){return b instanceof d?b:new d(a,{pub:b,pubEnc:c})},d.fromPrivate=function(a,b,c){return b instanceof d?b:new d(a,{priv:b,privEnc:c})},d.prototype.validate=function(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(a,b){return"string"==typeof a&&(b=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),b?this.pub.encode(b,a):this.pub},d.prototype.getPrivate=function(a){return"hex"===a?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(a,b){this.priv=new e(a,b||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(a,b){return a.x||a.y?("mont"===this.ec.curve.type?h(a.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||h(a.x&&a.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(a.x,a.y))):void(this.pub=this.ec.curve.decodePoint(a,b))},d.prototype.derive=function(a){return a.mul(this.priv).getX()},d.prototype.sign=function(a,b,c){return this.ec.sign(a,this,b,c)},d.prototype.verify=function(a,b){return this.ec.verify(a,b,this)},d.prototype.inspect=function(){return""}},{"../../elliptic":6,"bn.js":3}],15:[function(a,b,c){"use strict";function d(a,b){return a instanceof d?a:void(this._importDER(a,b)||(l(a.r&&a.s,"Signature without r or s"),this.r=new i(a.r,16),this.s=new i(a.s,16),void 0===a.recoveryParam?this.recoveryParam=null:this.recoveryParam=a.recoveryParam))}function e(){this.place=0}function f(a,b){var c=a[b.place++];if(!(128&c))return c;for(var d=15&c,e=0,f=0,g=b.place;f>>3);for(a.push(128|c);--c;)a.push(b>>>(c<<3)&255);a.push(b)}var i=a("bn.js"),j=a("../../elliptic"),k=j.utils,l=k.assert;b.exports=d,d.prototype._importDER=function(a,b){a=k.toArray(a,b);var c=new e;if(48!==a[c.place++])return!1;var d=f(a,c);if(d+c.place!==a.length)return!1;if(2!==a[c.place++])return!1;var g=f(a,c),h=a.slice(c.place,g+c.place);if(c.place+=g,2!==a[c.place++])return!1;var j=f(a,c);if(a.length!==j+c.place)return!1;var l=a.slice(c.place,j+c.place);return 0===h[0]&&128&h[1]&&(h=h.slice(1)),0===l[0]&&128&l[1]&&(l=l.slice(1)),this.r=new i(h),this.s=new i(l),this.recoveryParam=null,!0},d.prototype.toDER=function(a){var b=this.r.toArray(),c=this.s.toArray();for(128&b[0]&&(b=[0].concat(b)),128&c[0]&&(c=[0].concat(c)),b=g(b),c=g(c);!(c[0]||128&c[1]);)c=c.slice(1);var d=[2];h(d,b.length),d=d.concat(b),d.push(2),h(d,c.length);var e=d.concat(c),f=[48];return h(f,e.length),f=f.concat(e),k.encode(f,a)}},{"../../elliptic":6,"bn.js":3}],16:[function(a,b,c){arguments[4][8][0].apply(c,arguments)},{dup:8}],17:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);this.hash=a.hash,this.predResist=!!a.predResist,this.outLen=this.hash.outSize,this.minEntropy=a.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var b=g.toArray(a.entropy,a.entropyEnc),c=g.toArray(a.nonce,a.nonceEnc),e=g.toArray(a.pers,a.persEnc);h(b.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(b,c,e)}var e=a("hash.js"),f=a("../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.prototype._init=function(a,b,c){var d=a.concat(b).concat(c);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var e=0;e=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(a.concat(c||[])),this.reseed=1},d.prototype.generate=function(a,b,c,d){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof b&&(d=c,c=b,b=null),c&&(c=g.toArray(c,d),this._update(c));for(var e=[];e.length>8,g=255&e;f?c.push(f,g):c.push(g)}return c}function e(a){return 1===a.length?"0"+a:a}function f(a){for(var b="",c=0;c=0;){var f;if(e.isOdd()){var g=e.andln(d-1);f=g>(d>>1)-1?(d>>1)-g:g,e.isubn(f)}else f=0;c.push(f);for(var h=0!==e.cmpn(0)&&0===e.andln(d-1)?b+1:1,i=1;i0||b.cmpn(-e)>0;){var f=a.andln(3)+d&3,g=b.andln(3)+e&3;3===f&&(f=-1),3===g&&(g=-1);var h;if(0===(1&f))h=0;else{var i=a.andln(7)+d&7;h=3!==i&&5!==i||2!==g?f:-f}c[0].push(h);var j;if(0===(1&g))j=0;else{var i=b.andln(7)+e&7;j=3!==i&&5!==i||2!==f?g:-g}c[1].push(j),2*d===h+1&&(d=1-d),2*e===j+1&&(e=1-e),a.iushrn(1),b.iushrn(1)}return c}function i(a,b,c){var d="_"+b;a.prototype[b]=function(){return void 0!==this[d]?this[d]:this[d]=c.call(this)}}function j(a){return"string"==typeof a?l.toArray(a,"hex"):a}function k(a){return new m(a,"hex","le")}var l=c,m=a("bn.js");l.assert=function(a,b){if(!a)throw new Error(b||"Assertion failed")},l.toArray=d,l.zero2=e,l.toHex=f,l.encode=function(a,b){return"hex"===b?f(a):a},l.getNAF=g,l.getJSF=h,l.cachedProperty=i,l.parseBytes=j,l.intFromLE=k},{"bn.js":3}],20:[function(a,b,c){b.exports={version:"6.3.3"}},{}],21:[function(a,b,c){"use strict";function d(a,b,c){function h(c,d){return function(){var e={},h=Array.prototype.slice.call(arguments);if(h.length==c.inputs.length+1){if(e=h.pop(),"object"!=typeof e)throw new Error("invalid transaction overrides");for(var k in e)if(!g[k])throw new Error("unknown transaction override "+k)}["data","to"].forEach(function(a){if(null!=e[a])throw new Error("cannot override "+a)});var l=c.apply(b,h);switch(e.to=a,e.data=l.data,l.type){case"call":if(d)return Promise.resolve(new f.bigNumberify(0));["gasLimit","gasPrice","value"].forEach(function(a){if(null!=e[a])throw new Error("call cannot override "+a)});var m=null;return null==e.from&&i&&i.getAddress?(m=i.getAddress(),m instanceof Promise||(m=Promise.resolve(m))):m=Promise.resolve(null),m.then(function(a){return a&&(e.from=f.getAddress(a)),j.call(e)}).then(function(a){return l.parse(a)});case"transaction":if(!i)return Promise.reject(new Error("missing signer"));if(null!=e.from)throw new Error("transaction cannot override from");if(d)return i&&i.estimateGas?i.estimateGas(e):j.estimateGas(e);if(i.sendTransaction)return i.sendTransaction(e);if(!i.sign)return Promise.reject(new Error("custom signer does not support signing"));null==e.gasLimit&&(e.gasLimit=i.defaultGasLimit||2e6);var n=null;if(e.nonce)n=Promise.resolve(e.nonce);else if(i.getTransactionCount)n=i.getTransactionCount,n instanceof Promise||(n=Promise.resolve(n));else{var o=i.getAddress();o instanceof Promise||(o=Promise.resolve(o)),n=o.then(function(a){return j.getTransactionCount(a,"pending")})}var p=null;return p=e.gasPrice?Promise.resolve(e.gasPrice):j.getGasPrice(),Promise.all([n,p]).then(function(a){return e.nonce=a[0],e.gasPrice=a[1],i.sign(e)}).then(function(a){return j.sendTransaction(a)})}}}if(!(this instanceof d))throw new Error("missing new");if(b instanceof e||(b=new e(b)),!c)throw new Error("missing signer or provider");var i=c,j=null;c.provider?j=c.provider:(j=c,i=null),f.defineProperty(this,"address",a),f.defineProperty(this,"interface",b),f.defineProperty(this,"signer",i),f.defineProperty(this,"provider",j);var k={};f.defineProperty(this,"estimate",k);var l={};f.defineProperty(this,"functions",l);var m={};f.defineProperty(this,"events",m),Object.keys(b.functions).forEach(function(a){var c=b.functions[a],d=h(c,!1);null==this[a]?f.defineProperty(this,a,d):console.log("WARNING: Multiple definitions for "+c),null==l[c]&&(f.defineProperty(l,a,d),f.defineProperty(k,a,h(c,!0)))},this),Object.keys(b.events).forEach(function(a){function c(a){try{var b=d.parse(a.topics,a.data);e.apply(a,Array.prototype.slice.call(b))}catch(c){console.log(c)}}var d=b.events[a](),e=null,f={enumerable:!0,get:function(){return e},set:function(a){a||(a=null),!a&&e?j.removeListener(d.topics,c):a&&!e&&j.on(d.topics,c),e=a}},g="on"+a.toLowerCase();null==this[g]&&Object.defineProperty(this,g,f),Object.defineProperty(m,a,f)},this)}var e=a("./interface.js"),f=function(){return{defineProperty:a("ethers-utils/properties.js").defineProperty,getAddress:a("ethers-utils/address.js").getAddress,bigNumberify:a("ethers-utils/bignumber.js").bigNumberify,hexlify:a("ethers-utils/convert.js").hexlify}}(),g={data:!0,from:!0,gasLimit:!0,gasPrice:!0,to:!0,value:!0};f.defineProperty(d.prototype,"connect",function(a){return new d(this.address,this["interface"],a)}),f.defineProperty(d,"getDeployTransaction",function(a,b){b instanceof e||(b=new e(b));var c=Array.prototype.slice.call(arguments);return c.splice(1,1),{data:b.deployFunction.apply(b,c).bytecode}}),b.exports=d},{"./interface.js":23,"ethers-utils/address.js":33,"ethers-utils/bignumber.js":34,"ethers-utils/convert.js":37,"ethers-utils/properties.js":44}],22:[function(a,b,c){"use strict";var d=a("./contract.js"),e=a("./interface.js");b.exports={Contract:d,Interface:e},a("ethers-utils/standalone.js")(b.exports)},{"./contract.js":21,"./interface.js":23,"ethers-utils/standalone.js":47}],23:[function(a,b,c){"use strict";function d(a,b,c){var d=JSON.stringify(c);Object.defineProperty(a,b,{enumerable:!0,get:function(){return JSON.parse(d)}})}function e(a,b,c){Array.isArray(a)||x("invalid params",{params:a});for(var d=[],e=0;e=0?b:"")+"]";return{coder:a,length:b,name:"array",type:c,encode:function(c){Array.isArray(c)||x("invalid array");var d=b,e=new Uint8Array(0);d===-1&&(d=c.length,e=A.encode(d)),d!==c.length&&x("size mismatch");var f=[];return c.forEach(function(b){f.push(a)}),y.concat([e,k(f,c)])},decode:function(c,d){var e=0,f=b;if(f===-1){var g=A.decode(c,d);f=g.value.toNumber(),e+=g.consumed,d+=g.consumed}for(var h=[],i=0;i256||d%8!==0)&&x("invalid type",{type:a}),f(d/8,"int"===c[1])}var c=a.match(F);if(c){var d=parseInt(c[1]);return(0===d||d>32)&&x("invalid type "+a),g(d)}var c=a.match(H);if(c){var d=parseInt(c[2]||-1);return m(p(c[1]),d)}if("tuple("===a.substring(0,6)&&")"===a.substring(a.length-1)){var e=[];return o(a.substring(6,a.length-1)).forEach(function(a){e.push(p(a))}),n(e)}return""===a?z:void x("invalid type",{type:a})}function q(a,b){for(var c in b)y.defineProperty(a,c,b[c]);return a}function r(){}function s(){}function t(){}function u(){}function v(a){function b(a){switch(a.type){case"constructor":var b=function(){var b=e(a.inputs,"type"),c=function(a){y.isHexString(a)||x("invalid bytecode",{input:a});var c=Array.prototype.slice.call(arguments,1);c.lengthb.length&&x("too many parameters");var d={bytecode:a+v.encodeParams(b,c).substring(2)};return q(new s,d)};return d(c,"inputs",e(a.inputs,"name")),c}();h||(h=b);break;case"function":var b=function(){var b=e(a.inputs,"type");if(a.constant)var c=e(a.outputs,"type"),f=e(a.outputs,"name",!0);var g=a.name+"("+e(a.inputs,"type").join(",")+")",h=y.keccak256(y.toUtf8Bytes(g)).substring(0,10),i=function(){var d={name:a.name,signature:g,sighash:h},e=Array.prototype.slice.call(arguments,0);return e.lengthb.length&&x("too many parameters"),d.data=h+v.encodeParams(b,e).substring(2),a.constant?(d.parse=function(a){return v.decodeParams(f,c,y.arrayify(a))},q(new r,d)):q(new t,d)};return d(i,"inputs",e(a.inputs,"name")),d(i,"outputs",e(a.outputs,"name")),y.defineProperty(i,"signature",g),y.defineProperty(i,"sighash",h),i}();a.name&&"deployFunction"!==a.name&&null==f[a.name]&&y.defineProperty(f,a.name,b);break;case"event":var b=function(){var b=(e(a.inputs,"type"),function(){var b=a.name+"("+e(a.inputs,"type").join(",")+")",c={inputs:a.inputs,name:a.name,signature:b,topics:[y.keccak256(y.toUtf8Bytes(b))]};return c.parse=function(b,c){a.anonymous||(b=b.slice(1));var d=[],e=[],f=[],g=[];a.inputs.forEach(function(a){a.indexed?(d.push(a.name),f.push(a.type)):(e.push(a.name),g.push(a.type))});var h=v.decodeParams(d,f,y.concat(b)),i=v.decodeParams(e,g,y.arrayify(c)),j=new w,k=0,l=0;return a.inputs.forEach(function(a,b){a.indexed?j[b]=h[l++]:j[b]=i[k++],a.name&&(j[a.name]=j[b])}),j.length=a.inputs.length,j},q(new u,c)});return d(b,"inputs",e(a.inputs,"name")),b}();a.name&&null==g[a.name]&&y.defineProperty(g,a.name,b);break;case"fallback":break;default:console.log("WARNING: unsupported ABI type - "+a.type)}}if(!(this instanceof v))throw new Error("missing new");if("string"==typeof a)try{a=JSON.parse(a)}catch(c){x("invalid abi",{input:a})}d(this,"abi",a);var f={},g={},h=null;y.defineProperty(this,"functions",f),y.defineProperty(this,"events",g),this.abi.forEach(b,this),h||b({type:"constructor",inputs:[]}),y.defineProperty(this,"deployFunction",h)}function w(){}var x=a("ethers-utils/throw-error"),y=function(){var b=a("ethers-utils/convert.js"),c=a("ethers-utils/utf8.js");return{defineProperty:a("ethers-utils/properties.js").defineProperty,arrayify:b.arrayify,padZeros:b.padZeros,bigNumberify:a("ethers-utils/bignumber.js").bigNumberify,getAddress:a("ethers-utils/address").getAddress,concat:b.concat,toUtf8Bytes:c.toUtf8Bytes,toUtf8String:c.toUtf8String,hexlify:b.hexlify,isHexString:b.isHexString,keccak256:a("ethers-utils/keccak256.js")}}(),z={name:"null",type:"",encode:function(a){return y.arrayify([])},decode:function(a,b){if(b>a.length)throw new Error("invalid null");return{consumed:0,value:void 0}},dynamic:!1},A=f(32,!1),B={name:"boolean",type:"boolean",encode:function(a){return A.encode(a?1:0)},decode:function(a,b){var c=A.decode(a,b);return{consumed:c.consumed,value:!c.value.isZero()}}},C={name:"address",type:"address",encode:function(a){a=y.arrayify(y.getAddress(a));var b=new Uint8Array(32);return b.set(a,12),b},decode:function(a,b){return a.length3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function e(a){var b=[];for(var c in a)if(null!=a[c]){var e=k.hexlify(a[c]);({gasLimit:!0,gasPrice:!0,nonce:!0,value:!0})[c]&&(e=d(e)),b.push(c+"="+e)}return b.join("&")}function f(a,b){j.call(this,a);var c=null;switch(this.name){case"homestead":c="https://api.etherscan.io";break;case"ropsten":c="https://ropsten.etherscan.io";break;case"rinkeby":c="https://rinkeby.etherscan.io";break;case"kovan":c="https://kovan.etherscan.io";break;default:throw new Error("unsupported network")}k.defineProperty(this,"baseUrl",c),k.defineProperty(this,"apiKey",b||null)}function g(a){if(0==a.status&&"No records found"===a.message)return a.result;if(1!=a.status||"OK"!=a.message){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}return a.result}function h(a){if("2.0"!=a.jsonrpc){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}if(a.error){var b=new Error(a.error.message||"unknown error");throw a.error.code&&(b.code=a.error.code),a.error.data&&(b.data=a.error.data),b}return a.result}function i(a){if("pending"===a)throw new Error("pending not supported");return"latest"===a?a:parseInt(a.substring(2),16)}var j=a("./provider.js"),k=function(){var b=a("ethers-utils/convert.js");return{defineProperty:a("ethers-utils/properties.js").defineProperty,hexlify:b.hexlify}}();j.inherits(f),k.defineProperty(f.prototype,"_call",function(){}),k.defineProperty(f.prototype,"_callProxy",function(){}),k.defineProperty(f.prototype,"perform",function(a,b){b||(b={});var c=this.baseUrl,f="";switch(this.apiKey&&(f+="&apikey="+this.apiKey),a){case"getBlockNumber":return c+="/api?module=proxy&action=eth_blockNumber"+f,j.fetchJSON(c,null,h);case"getGasPrice":return c+="/api?module=proxy&action=eth_gasPrice"+f,j.fetchJSON(c,null,h);case"getBalance":return c+="/api?module=account&action=balance&address="+b.address,c+="&tag="+b.blockTag+f,j.fetchJSON(c,null,g);case"getTransactionCount":return c+="/api?module=proxy&action=eth_getTransactionCount&address="+b.address,c+="&tag="+b.blockTag+f,j.fetchJSON(c,null,h);case"getCode":return c+="/api?module=proxy&action=eth_getCode&address="+b.address,c+="&tag="+b.blockTag+f,j.fetchJSON(c,null,h);case"getStorageAt":return c+="/api?module=proxy&action=eth_getStorageAt&address="+b.address,c+="&position="+d(b.position),c+="&tag="+d(b.blockTag)+f,j.fetchJSON(c,null,h);case"sendTransaction":return c+="/api?module=proxy&action=eth_sendRawTransaction&hex="+b.signedTransaction,c+=f,j.fetchJSON(c,null,h);case"getBlock":if(b.blockTag)return c+="/api?module=proxy&action=eth_getBlockByNumber&tag="+d(b.blockTag),c+="&boolean=false",c+=f,j.fetchJSON(c,null,h);throw new Error("getBlock by blockHash not implmeneted");case"getTransaction":return c+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+b.transactionHash,c+=f,j.fetchJSON(c,null,h);case"getTransactionReceipt":return c+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+b.transactionHash,c+=f,j.fetchJSON(c,null,h);case"call":var k=e(b.transaction);return k&&(k="&"+k),c+="/api?module=proxy&action=eth_call"+k,c+=f,j.fetchJSON(c,null,h);case"estimateGas":var k=e(b.transaction);return k&&(k="&"+k),c+="/api?module=proxy&action=eth_estimateGas&"+k,c+=f,j.fetchJSON(c,null,h);case"getLogs":c+="/api?module=logs&action=getLogs";try{if(b.filter.fromBlock&&(c+="&fromBlock="+i(b.filter.fromBlock)),b.filter.toBlock&&(c+="&toBlock="+i(b.filter.toBlock)),b.filter.address&&(c+="&address="+b.filter.address),b.filter.topics&&b.filter.topics.length>0){if(b.filter.topics.length>1)throw new Error("unsupported topic format");var l=b.filter.topics[0];if("string"!=typeof l||66!==l.length)throw new Error("unsupported topic0 format");c+="&topic0="+l}}catch(m){return Promise.reject(m)}return c+=f,j.fetchJSON(c,null,g)}return Promise.reject(new Error("not implemented - "+a))}),b.exports=f},{"./provider.js":32,"ethers-utils/convert.js":37,"ethers-utils/properties.js":44}],26:[function(a,b,c){"use strict";function d(a){if(0===a.length)throw new Error("no providers");var b={};if(["chainId","ensAddress","name","testnet"].forEach(function(c){for(var d=1;d3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function f(a){var b={};for(var c in a)b[c]=i.hexlify(a[c]);return["gasLimit","gasPrice","nonce","value"].forEach(function(a){b[a]&&(b[a]=e(b[a]))}),b}function g(a,b){if(!(this instanceof g))throw new Error("missing new");var c=[];"string"!=typeof a||null!=h.networks[a]?(c.push(a),null!=b&&c.push(b),a=null):2===arguments.length?c.push(arguments[1]):3===arguments.length&&(c.push(arguments[1]),c.push(arguments[2])),h.apply(this,c),a||(a="http://localhost:8545"),i.defineProperty(this,"url",a)}var h=a("./provider.js"),i=function(){var b=a("ethers-utils/convert");return{defineProperty:a("ethers-utils/properties").defineProperty,hexlify:b.hexlify,isHexString:b.isHexString}}();h.inherits(g),i.defineProperty(g.prototype,"send",function(a,b){var c={method:a,params:b,id:42,jsonrpc:"2.0"};return h.fetchJSON(this.url,JSON.stringify(c),d)}),i.defineProperty(g.prototype,"perform",function(a,b){switch(a){case"getBlockNumber":return this.send("eth_blockNumber",[]);case"getGasPrice":return this.send("eth_gasPrice",[]);case"getBalance":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getBalance",[b.address,c]);case"getTransactionCount":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getTransactionCount",[b.address,c]);case"getCode":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getCode",[b.address,c]);case"getStorageAt":var d=b.position;i.isHexString(d)&&(d=e(d));var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getStorageAt",[b.address,d,c]);case"sendTransaction":return this.send("eth_sendRawTransaction",[b.signedTransaction]);case"getBlock":if(b.blockTag){var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getBlockByNumber",[c,!1])}return b.blockHash?this.send("eth_getBlockByHash",[b.blockHash,!1]):Promise.reject(new Error("invalid block tag or block hash"));case"getTransaction":return this.send("eth_getTransactionByHash",[b.transactionHash]);case"getTransactionReceipt":return this.send("eth_getTransactionReceipt",[b.transactionHash]);case"call":return this.send("eth_call",[f(b.transaction),"latest"]);case"estimateGas":return this.send("eth_estimateGas",[f(b.transaction)]);case"getLogs":return this.send("eth_getLogs",[b.filter])}return Promise.reject(new Error("not implemented - "+a))}),b.exports=g},{"./provider.js":32,"ethers-utils/convert":37,"ethers-utils/properties":44}],30:[function(a,b,c){b.exports={unspecified:{chainId:0,name:"unspecified"},homestead:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},mainnet:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},morden:{chainId:2,name:"morden"},ropsten:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},testnet:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},rinkeby:{chainId:4,name:"rinkeby"},kovan:{chainId:42,name:"kovan"}}},{}],31:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],32:[function(a,b,c){"use strict";function d(a){var b={};for(var c in a)b[c]=a[c];return b}function e(a,b){var c={};for(var d in a)try{var e=a[d](b[d]);void 0!==e&&(c[d]=e)}catch(f){throw f.checkKey=d,f.checkValue=b[d],f}return c}function f(a,b){return function(c){return null==c?b:a(c)}}function g(a,b){return function(c){return c?a(c):b}}function h(a){return function(b){if(!Array.isArray(b))throw new Error("not an array");var c=[];return b.forEach(function(b){c.push(a(b))}),c}}function i(a){if(!D.isHexString(a)||66!==a.length)throw new Error("invalid hash - "+a);return a}function j(a){return D.bigNumberify(a).toNumber()}function k(a){if(!D.isHexString(a))throw new Error("invalid uint256");for(;a.length<66;)a="0x0"+a.substring(2);return a}function l(a){if("string"!=typeof a)throw new Error("invalid string");return a}function m(a){if(null==a)return"latest";if("earliest"===a)return"0x0";if("latest"===a||"pending"===a)return a;if("number"==typeof a)return D.hexlify(a);if(D.isHexString(a))return a;throw new Error("invalid blockTag")}function n(a){return null!=a.author&&null==a.miner&&(a.miner=a.author),e(E,a)}function o(a){if(null!=a.gas&&null==a.gasLimit&&(a.gasLimit=a.gas),null!=a.input&&null==a.data&&(a.data=a.input),null==a.to&&null==a.creates&&(a.creates=D.getContractAddress(a)),!a.raw&&a.v&&a.r&&a.s){var b=[D.hexlify(a.nonce),D.hexlify(a.gasPrice),D.hexlify(a.gasLimit),a.to||"0x",D.hexlify(a.value||"0x"),D.hexlify(a.data||"0x"),D.hexlify(a.v||"0x"),D.hexlify(a.r),D.hexlify(a.s)];a.raw=D.RLP.encode(b)}var c=e(F,a),d=a.networkId;return D.isHexString(d)&&(d=D.bigNumberify(d).toNumber()),"number"!=typeof d&&null!=c.v&&(d=(c.v-35)/2,d<0&&(d=0),d=parseInt(d)),"number"!=typeof d&&(d=0),c.networkId=d,c.blockHash&&"x"===c.blockHash.replace(/0/g,"")&&(c.blockHash=null),c}function p(a){return e(G,a)}function q(a){return e(H,a)}function r(a){var b=a.status,c=a.root;if(!(null!=b^null!=c))throw new Error("invalid transaction receipt - exactly one of status and root should be present");var d=e(I,a);return d.logs.forEach(function(a,b){null==a.transactionLogIndex&&(a.transactionLogIndex=b),null==a.type&&(a.type="mined")}),null!=a.status&&(d.byzantium=!0),d}function s(a){return Array.isArray(a)?a.forEach(function(a){s(a)}):null!=a&&i(a),a}function t(a){return e(J,a)}function u(a){return e(K,a)}function v(a){function b(){e.getBlockNumber().then(function(a){if(a!==f){null===f&&(f=a-1);for(var b=f+1;b<=a;b++)e.emit("block",b);var c={};Object.keys(d).forEach(function(b){var d=z(b);"transaction"===d.type?e.getTransaction(d.hash).then(function(a){a&&a.blockNumber&&e.emit(d.hash,a)}):"address"===d.type?(g[d.address]&&(c[d.address]=g[d.address]),e.getBalance(d.address,"latest").then(function(a){var b=g[d.address];b&&a.eq(b)||(g[d.address]=a,e.emit(d.address,a))})):"topic"===d.type&&e.getLogs({fromBlock:f+1,toBlock:a,topics:d.topic}).then(function(a){0!==a.length&&a.forEach(function(a){e.emit(d.topic,a)})})}),f=a,g=c}}),e.doPoll()}if(!(this instanceof v))throw new Error("missing new");a=v._legacyConstructor(a,arguments.length,arguments[0],arguments[1]);var c=null;a.ensAddress&&(c=D.getAddress(a.ensAddress)),D.defineProperty(this,"chainId",a.chainId),D.defineProperty(this,"ensAddress",c),D.defineProperty(this,"name",a.name),D.defineProperty(this,"testnet","homestead"!==a.name);var d={};D.defineProperty(this,"_events",d);var e=this,f=null,g={};D.defineProperty(this,"resetEventsBlock",function(a){f=a,e.doPoll()});var h=null;Object.defineProperty(this,"polling",{get:function(){return null!=h},set:function(a){setTimeout(function(){a&&!h?h=setInterval(b,4e3):!a&&h&&(clearInterval(h),h=null)},0)}})}function w(a){return function(b){A(b,a),D.defineProperty(b,"inherits",w(b))}}function x(a,b){if(Array.isArray(a)){var c=[];return a.forEach(function(a){c.push(x(a,b))}),c}return b(a)}function y(a){try{return"address:"+D.getAddress(a)}catch(b){}if("block"===a)return"block";if(D.isHexString(a)){if(66===a.length)return"tx:"+a}else if(Array.isArray(a)){a=x(a,function(a){return null==a&&(a="0x"),a});try{return"topic:"+D.RLP.encode(a)}catch(b){console.log(b)}}throw new Error("invalid event - "+a)}function z(a){if("tx:"===a.substring(0,3))return{type:"transaction",hash:a.substring(3)};if("block"===a)return{type:"block"};if("address:"===a.substring(0,8))return{type:"address",address:a.substring(8)};if("topic:"===a.substring(0,6))try{var b=D.RLP.decode(a.substring(6));return b=x(b,function(a){return"0x"===a&&(a=null),a}),{type:"topic",topic:b}}catch(c){console.log(c)}throw new Error("invalid event string")}var A=a("inherits"),B=a("xmlhttprequest").XMLHttpRequest,C=a("./networks.json"),D=function(){var b=a("ethers-utils/convert");return{defineProperty:a("ethers-utils/properties").defineProperty,getAddress:a("ethers-utils/address").getAddress,getContractAddress:a("ethers-utils/contract-address").getContractAddress,bigNumberify:a("ethers-utils/bignumber").bigNumberify,arrayify:b.arrayify,hexlify:b.hexlify,isHexString:b.isHexString,concat:b.concat,namehash:a("ethers-utils/namehash"),toUtf8String:a("ethers-utils/utf8").toUtf8String,RLP:a("ethers-utils/rlp")}}(),E={hash:i,parentHash:i,number:j,timestamp:j,nonce:f(D.hexlify),difficulty:f(j),gasLimit:D.bigNumberify,gasUsed:D.bigNumberify,miner:D.getAddress,extraData:D.hexlify,transactions:f(h(i))},F={hash:i,blockHash:f(i,null),blockNumber:f(j,null),transactionIndex:f(j,null),from:D.getAddress,gasPrice:D.bigNumberify,gasLimit:D.bigNumberify,to:f(D.getAddress,null),value:D.bigNumberify,nonce:j,data:D.hexlify,r:f(k),s:f(k),v:f(j),creates:f(D.getAddress,null),raw:f(D.hexlify)},G={from:f(D.getAddress),nonce:f(j),gasLimit:f(D.bigNumberify),gasPrice:f(D.bigNumberify),to:f(D.getAddress),value:f(D.bigNumberify),data:f(D.hexlify)},H={transactionLogIndex:f(j),transactionIndex:j,blockNumber:j,transactionHash:i,address:D.getAddress,type:f(l),topics:h(i),data:D.hexlify,logIndex:j,blockHash:i},I={contractAddress:f(D.getAddress,null),transactionIndex:j,root:f(i),gasUsed:D.bigNumberify,logsBloom:D.hexlify,blockHash:i,transactionHash:i,logs:h(q),blockNumber:j,cumulativeGasUsed:D.bigNumberify,status:f(j)},J={fromBlock:f(m,void 0),toBlock:f(m,void 0),address:f(D.getAddress,void 0),topics:f(s,void 0)},K={blockNumber:j,transactionIndex:j,address:D.getAddress,data:g(D.hexlify,"0x"),topics:h(i),transactionHash:i,logIndex:j};D.defineProperty(v,"inherits",w(v)),D.defineProperty(v,"_legacyConstructor",function(a,b,c,d){if("boolean"==typeof c||2===b){var e=!!c,f=d;a=C[e?"ropsten":"homestead"],2===b&&null!=f&&(a={chainId:f,ensAddress:a.ensAddress,name:a.name})}else if("string"==typeof a){if(a=C[a],!a)throw new Error("unknown network")}else null==a&&(a=C.homestead);if("number"!=typeof a.chainId)throw new Error("invalid chainId");return a}),D.defineProperty(v,"chainId",{homestead:1,morden:2,ropsten:3,rinkeby:4,kovan:42}),D.defineProperty(v,"networks",C),D.defineProperty(v,"fetchJSON",function(a,b,c){return new Promise(function(d,e){var f=new B;b?(f.open("POST",a,!0),f.setRequestHeader("Content-Type","application/json")):f.open("GET",a,!0),f.onreadystatechange=function(){if(4===f.readyState){try{var g=JSON.parse(f.responseText)}catch(h){var i=new Error("invalid json response");return i.orginialError=h,i.responseText=f.responseText,void e(i)}if(c)try{g=c(g)}catch(h){return h.url=a,h.body=b,h.responseText=f.responseText,void e(h)}if(200!=f.status){var h=new Error("invalid response - "+f.status);return h.statusCode=f.statusCode,void e(h)}d(g)}},f.onerror=function(a){e(a)};try{b?f.send(b):f.send()}catch(g){var h=new Error("connection error");h.error=g,e(h)}})}),D.defineProperty(v.prototype,"waitForTransaction",function(a,b){var c=this;return new Promise(function(d,e){function f(a){g&&clearTimeout(g),d(a)}var g=null;c.once(a,f),"number"==typeof b&&b>0&&(g=setTimeout(function(){c.removeListener(a,f),e(new Error("timeout"))},b))})}),D.defineProperty(v.prototype,"getBlockNumber",function(){try{return this.perform("getBlockNumber").then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getBlockNumber");return b})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"getGasPrice",function(){try{return this.perform("getGasPrice").then(function(a){return D.bigNumberify(a)})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"getBalance",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getBalance",d).then(function(a){return D.bigNumberify(a)})})}),D.defineProperty(v.prototype,"getTransactionCount",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getTransactionCount",d).then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getTransactionCount");return b})})}),D.defineProperty(v.prototype,"getCode",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getCode",d).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"getStorageAt",function(a,b,c){var d=this;return this.resolveName(a).then(function(a){var e={address:a,blockTag:m(c),position:D.hexlify(b)};return d.perform("getStorageAt",e).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"sendTransaction",function(a){try{var b={signedTransaction:D.hexlify(a)};return this.perform("sendTransaction",b).then(function(a){if(a=D.hexlify(a),66!==a.length)throw new Error("invalid response - sendTransaction");return a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"call",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:p(a)};return b.perform("call",c).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"estimateGas",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:p(a)};return b.perform("estimateGas",c).then(function(a){return D.bigNumberify(a)})})}),D.defineProperty(v.prototype,"getBlock",function(a){try{var b=D.hexlify(a);if(66===b.length)return this.perform("getBlock",{blockHash:b}).then(function(a){return n(a)})}catch(c){console.log("DEBUG",c)}try{var d=m(a);return this.perform("getBlock",{blockTag:d}).then(function(a){return n(a)})}catch(c){console.log("DEBUG",c)}return Promise.reject(new Error("invalid block hash or block tag"))}),D.defineProperty(v.prototype,"getTransaction",function(a){try{var b={transactionHash:i(a)};return this.perform("getTransaction",b).then(function(a){return null!=a&&(a=o(a)),a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"getTransactionReceipt",function(a){try{var b={transactionHash:i(a)};return this.perform("getTransactionReceipt",b).then(function(a){return null!=a&&(a=r(a)),a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"getLogs",function(a){var b=this;return this._resolveNames(a,["address"]).then(function(a){var c={filter:t(a)};return b.perform("getLogs",c).then(function(a){return h(u)(a)})})}),D.defineProperty(v.prototype,"getEtherPrice",function(){try{return this.perform("getEtherPrice",{}).then(function(a){return a})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"_resolveNames",function(a,b){var c=[],e=d(a);return b.forEach(function(a){void 0!==e[a]&&c.push(this.resolveName(e[a]).then(function(b){e[a]=b}))},this),Promise.all(c).then(function(){return e})}),D.defineProperty(v.prototype,"_getResolver",function(a){var b=D.namehash(a),c="0x0178b8bf"+b.substring(2),d={to:this.ensAddress,data:c};return this.call(d).then(function(a){return 66!=a.length?null:D.getAddress("0x"+a.substring(26))})}),D.defineProperty(v.prototype,"resolveName",function(a){try{return Promise.resolve(D.getAddress(a))}catch(b){}var c=this,d=D.namehash(a);return this._getResolver(a).then(function(a){var b="0x3b3b57de"+d.substring(2),e={to:a,data:b};return c.call(e)}).then(function(a){if(66!=a.length)return null;var b=D.getAddress("0x"+a.substring(26));return"0x0000000000000000000000000000000000000000"===b?null:b})}),D.defineProperty(v.prototype,"lookupAddress",function(a){a=D.getAddress(a);var b=a.substring(2)+".addr.reverse",c=D.namehash(b),d=this;return this._getResolver(b).then(function(a){if(!a)return null;var b="0x691f3431"+c.substring(2),e={to:a,data:b};return d.call(e)}).then(function(b){if(b=b.substring(2),b.length<64)return null;if(b=b.substring(64),b.length<64)return null;var c=D.bigNumberify("0x"+b.substring(0,64)).toNumber();if(b=b.substring(64),2*c>b.length)return null;var e=D.toUtf8String("0x"+b.substring(0,2*c));return d.resolveName(e).then(function(b){return b!=a?null:e})})}),D.defineProperty(v.prototype,"doPoll",function(){}),D.defineProperty(v.prototype,"perform",function(a,b){return Promise.reject(new Error("not implemented - "+a))}),D.defineProperty(v.prototype,"on",function(a,b){var c=y(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"on"}),this.polling=!0}),D.defineProperty(v.prototype,"once",function(a,b){var c=y(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"once"}),this.polling=!0}),D.defineProperty(v.prototype,"emit",function(a){var b=y(a),c=Array.prototype.slice.call(arguments,1),d=this._events[b];if(d){for(var e=0;e>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":37,"./keccak256":41,"./throw-error":48,"bn.js":3}],34:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f}},{"./convert":37,"./properties":44,"./throw-error":48,"bn.js":3}],35:[function(a,b,c){(function(c){"use strict";function d(a){if(a<=0||a>1024||parseInt(a)!=a)throw new Error("invalid length");var b=new Uint8Array(a);return g.getRandomValues(b),e.arrayify(b)}var e=a("./convert"),f=a("./properties").defineProperty,g=c.crypto||c.msCrypto;g&&g.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),g={getRandomValues:function(a){for(var b=0;b<20;b++)for(var c=0;c=256||parseInt(c)!=c)return!1}return!0}function f(a,b){if(a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var c=[],f=0;f>4]+m[15&g])}return"0x"+d.join("")}l("invalid hexlify value",{name:b,input:a})}var l=(a("./properties.js").defineProperty,a("./throw-error")),m="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,hexlify:k,isHexString:j}},{"./properties.js":44,"./throw-error":48}],38:[function(a,b,c){"use strict";function d(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha256,a)}function e(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha512,a)}var f=a("hash.js"),g=a("./sha2.js"),h=a("./convert.js");b.exports={createSha256Hmac:d,createSha512Hmac:e}},{"./convert.js":37,"./sha2.js":46,"hash.js":57}],39:[function(a,b,c){"use strict";function d(a){return e(f.toUtf8Bytes(a))}var e=a("./keccak256"),f=a("./utf8");b.exports=d},{"./keccak256":41,"./utf8":50}],40:[function(a,b,c){"use strict";var d=a("./address"),e=a("./bignumber"),f=a("./contract-address"),g=a("./convert"),h=a("./id"),i=a("./keccak256"),j=a("./namehash"),k=a("./sha2").sha256,l=a("./random-bytes"),m=a("./properties"),n=a("./rlp"),o=a("./utf8"),p=a("./units"); -b.exports={RLP:n,defineProperty:m.defineProperty,etherSymbol:"Ξ",arrayify:g.arrayify,concat:g.concat,padZeros:g.padZeros,stripZeros:g.stripZeros,bigNumberify:e.bigNumberify,hexlify:g.hexlify,toUtf8Bytes:o.toUtf8Bytes,toUtf8String:o.toUtf8String,namehash:j,id:h,getAddress:d.getAddress,getContractAddress:f.getContractAddress,formatEther:p.formatEther,parseEther:p.parseEther,keccak256:i,sha256:k,randomBytes:l},a("./standalone")({utils:b.exports})},{"./address":33,"./bignumber":34,"./contract-address":36,"./convert":37,"./id":39,"./keccak256":41,"./namehash":42,"./properties":44,"./random-bytes":35,"./rlp":45,"./sha2":46,"./standalone":47,"./units":49,"./utf8":50}],41:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":37,"js-sha3":70}],42:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>24&255,j[b.length+1]=m>>16&255,j[b.length+2]=m>>8&255,j[b.length+3]=255&m;var n=f(a).update(j).digest();g||(g=n.length,l=new Uint8Array(g),h=Math.ceil(d/g),k=d-(h-1)*g),l.set(n);for(var o=1;o>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":37}],46:[function(a,b,c){"use strict";function d(a){return a=g.arrayify(a),"0x"+f.sha256().update(a).digest("hex")}function e(a){return a=g.arrayify(a),"0x"+f.sha512().update(a).digest("hex")}var f=a("hash.js"),g=a("./convert.js");b.exports={sha256:d,sha512:e,createSha256:f.sha256,createSha512:f.sha512}},{"./convert.js":37,"hash.js":57}],47:[function(a,b,c){(function(c){function d(){}function e(a){null==c.ethers&&f(c,"ethers",new d);for(var b in a)null==c.ethers[b]&&f(c.ethers,b,a[b])}var f=a("./properties.js").defineProperty;b.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./properties.js":44}],48:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],49:[function(a,b,c){function d(a,b){a=f(a),b||(b={});var c=a.lt(h);c&&(a=a.mul(i));for(var d=a.mod(j).toString(10);d.length<18;)d="0"+d;b.pad||(d=d.match(/^([0-9]*[1-9]|0)(0*)/)[1]);var e=a.div(j).toString(10);b.commify&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,","));var g=e+"."+d;return c&&(g="-"+g),g}function e(a){"string"==typeof a&&a.match(/^-?[0-9.,]+$/)||g("invalid value",{input:a});var b=a.replace(/,/g,""),c="-"===b.substring(0,1);c&&(b=b.substring(1)),"."===b&&g("invalid value",{input:a});var d=b.split(".");d.length>2&&g("too many decimal points",{input:a});var e=d[0],h=d[1];for(e||(e="0"),h||(h="0"),h.length>18&&g("too many decimal places",{input:a,decimals:h.length});h.length<18;)h+="0";e=f(e),h=f(h);var k=e.mul(j).add(h);return c&&(k=k.mul(i)),k}var f=a("./bignumber.js").bigNumberify,g=a("./throw-error"),h=new f(0),i=new f((-1)),j=new f("1000000000000000000");b.exports={formatEther:d,parseEther:e}},{"./bignumber.js":34,"./throw-error":48}],50:[function(a,b,c){function d(a){for(var b=[],c=0,d=0;d>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":37}],51:[function(a,b,c){function d(a){return(1<127)throw new Error("passwords with non-ASCII characters not supported in this environment")}else b="";a=m.toUtf8Bytes(a,"NFKD");var e=m.toUtf8Bytes("mnemonic"+b,"NFKD");return m.hexlify(m.pbkdf2(a,e,2048,64,m.createSha512Hmac))}function h(a){var b=a.toLowerCase().split(" ");if(b.length%3!==0)throw new Error("invalid mnemonic");for(var c=m.arrayify(new Uint8Array(Math.ceil(11*b.length/8))),e=0,f=0;f>3]|=1<<7-e%8),e++}var i=32*b.length/3,j=b.length/3,k=d(j),n=m.arrayify(m.sha256(c.slice(0,i/8)))[0];if(n&=k,n!==(c[c.length-1]&k))throw new Error("invalid checksum");return m.hexlify(c.slice(0,i/8))}function i(a){if(a=m.arrayify(a),a.length%4!==0||a.length<16||a.length>32)throw new Error("invalid entropy");for(var b=[0],c=11,f=0;f8?(b[b.length-1]<<=8,b[b.length-1]|=a[f],c-=8):(b[b.length-1]<<=c,b[b.length-1]|=a[f]>>8-c,b.push(a[f]&e(8-c)),c+=3);var g=m.arrayify(m.sha256(a))[0],h=a.length/4;g&=d(h),b[b.length-1]<<=h,b[b.length-1]|=g>>8-h;for(var f=0;f=o)throw new Error("cannot derive child of neutered node");throw new Error("not implemented")}var b=new Uint8Array(37);a&o?b.set(m.arrayify(this.privateKey),1):b.set(this._keyPair.getPublic().encode(null,!0));for(var c=24;c>=0;c-=8)b[33+(c>>3)]=a>>24-c&255;var d=m.arrayify(m.createSha512Hmac(this.chainCode).update(b).digest()),e=m.bigNumberify(d.slice(0,32)),g=(d.slice(32),e.add("0x"+this._keyPair.getPrivate("hex")).mod("0x"+k.curve.n.toString(16)));return new f(k.keyFromPrivate(m.arrayify(g)),d.slice(32),a,this.depth+1)}),m.defineProperty(f.prototype,"derivePath",function(a){var b=a.split("/");if(0===b.length||"m"===b[0]&&0!==this.depth)throw new Error("invalid path");"m"===b[0]&&b.shift();for(var c=this,d=0;d=o)throw new Error("invalid path index - "+e);c=c._derive(o+f)}else{if(!e.match(/^[0-9]+$/))throw new Error("invlaid path component - "+e);var f=parseInt(e);if(f>=o)throw new Error("invalid path index - "+e);c=c._derive(f)}}return c}),m.defineProperty(f,"fromMnemonic",function(a){return h(a),f.fromSeed(g(a))}),m.defineProperty(f,"fromSeed",function(a){if(a=m.arrayify(a),a.length<16||a.length>64)throw new Error("invalid seed");var b=m.arrayify(m.createSha512Hmac(n).update(a).digest());return new f(k.keyFromPrivate(b.slice(0,32)),b.slice(32),0,0,0)}),b.exports={fromMnemonic:f.fromMnemonic,fromSeed:f.fromSeed,mnemonicToEntropy:h,entropyToMnemonic:i,mnemonicToSeed:g,isValidMnemonic:j}},{"./words.json":56,elliptic:6,"ethers-utils/bignumber.js":34,"ethers-utils/convert.js":37,"ethers-utils/hmac":38,"ethers-utils/pbkdf2.js":43,"ethers-utils/properties.js":44,"ethers-utils/sha2":46,"ethers-utils/utf8.js":50}],52:[function(a,b,c){"use strict";var d=a("./wallet"),e=a("./hdnode"),f=a("./signing-key");b.exports={HDNode:e,Wallet:d,SigningKey:f,_SigningKey:f},a("ethers-utils/standalone.js")(b.exports)},{"./hdnode":51,"./signing-key":54,"./wallet":55,"ethers-utils/standalone.js":47}],53:[function(a,b,c){"use strict";function d(a){return"string"==typeof a&&"0x"!==a.substring(0,2)&&(a="0x"+a),l.arrayify(a)}function e(a){return"string"==typeof a?l.toUtf8Bytes(a,"NFKC"):l.arrayify(a,"password")}function f(a,b){for(var c=a,d=b.toLowerCase().split("/"),e=0;e0){var e=new Error("invalid "+b.name);throw e.reason="wrong length",e.value=c,e}if(b.maxLength&&(c=h.stripZeros(c),c.length>b.maxLength)){var e=new Error("invalid "+b.name);throw e.reason="too long",e.value=c,e}d.push(h.hexlify(c))}),b&&(d.push(h.hexlify(b)),d.push("0x"),d.push("0x"));var e=h.keccak256(h.RLP.encode(d)),f=c.signDigest(e),g=27+f.recoveryParam;return b&&(d.pop(),d.pop(),d.pop(),g+=2*b+8),d.push(h.hexlify(g)),d.push(f.r),d.push(f.s),h.RLP.encode(d)})}function e(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function f(a){var b=h.concat([h.toUtf8Bytes("Ethereum Signed Message:\n"),h.toUtf8Bytes(String(a.length)),h.toUtf8Bytes(a)]);return h.keccak256(b)}var g=a("scrypt-js"),h=a("ethers-utils"),i=a("./hdnode"),j=a("./secret-storage"),k=a("./signing-key");a("setimmediate");var l="m/44'/60'/0'/0/0",m=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}];h.defineProperty(d,"parseTransaction",function(a){a=h.hexlify(a,"rawTransaction");var b=h.RLP.decode(a);if(9!==b.length)throw new Error("invalid transaction");var c=[],d={};m.forEach(function(a,e){d[a.name]=b[e],c.push(b[e])}),d.to&&("0x"==d.to?delete d.to:d.to=h.getAddress(d.to)),["gasPrice","gasLimit","nonce","value"].forEach(function(a){d[a]&&(0===d[a].length?d[a]=h.bigNumberify(0):d[a]=h.bigNumberify(d[a]))}),d.nonce?d.nonce=d.nonce.toNumber():d.nonce=0;var e=h.arrayify(b[6]),f=h.arrayify(b[7]),g=h.arrayify(b[8]);if(1===e.length&&f.length>=1&&f.length<=32&&g.length>=1&&g.length<=32){d.v=e[0],d.r=b[7],d.s=b[8];var i=(d.v-35)/2;i<0&&(i=0),i=parseInt(i),d.chainId=i;var j=d.v-27;i&&(c.push(h.hexlify(i)),c.push("0x"),c.push("0x"),j-=2*i+8);var l=h.keccak256(h.RLP.encode(c));try{d.from=k.recover(l,f,g,j)}catch(n){console.log(n)}}return d}),h.defineProperty(d.prototype,"getAddress",function(){return this.address}),h.defineProperty(d.prototype,"getBalance",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,a)}),h.defineProperty(d.prototype,"getTransactionCount",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,a)}),h.defineProperty(d.prototype,"estimateGas",function(a){if(!this.provider)throw new Error("missing provider");var b={};return["from","to","data","value"].forEach(function(c){null!=a[c]&&(b[c]=a[c])}),null==a.from&&(b.from=this.address),this.provider.estimateGas(b)}),h.defineProperty(d.prototype,"sendTransaction",function(a){if(!this.provider)throw new Error("missing provider");var b=a.gasLimit;null==b&&(b=this.defaultGasLimit);var c=this,e=null;e=a.gasPrice?Promise.resolve(a.gasPrice):this.provider.getGasPrice();var f=null;f=a.nonce?Promise.resolve(a.nonce):this.provider.getTransactionCount(c.address,"pending");var g=this.provider.chainId,i=null;i=a.to?this.provider.resolveName(a.to):Promise.resolve(void 0);var j=h.hexlify(a.data||"0x"),k=h.hexlify(a.value||0);return Promise.all([e,f,i]).then(function(a){var e=c.sign({to:a[2],data:j,gasLimit:b,gasPrice:a[0],nonce:a[1],value:k,chainId:g});return c.provider.sendTransaction(e).then(function(a){var b=d.parseTransaction(e);return b.hash=a,b})})}),h.defineProperty(d.prototype,"send",function(a,b,c){return c||(c={}),this.sendTransaction({to:a,gasLimit:c.gasLimit,gasPrice:c.gasPrice,nonce:c.nonce,value:b})}),h.defineProperty(d.prototype,"signMessage",function(a){var b=new k(this.privateKey),c=b.signDigest(f(a));return e(c.r)+e(c.s).substring(2)+(c.recoveryParam?"1c":"1b")}),h.defineProperty(d,"verifyMessage",function(a,b){if(b=h.hexlify(b),132!=b.length)throw new Error("invalid signature");var c=f(a),d=parseInt(b.substring(130),16)-27;if(d<0)throw new Error("invalid signature");return k.recover(c,b.substring(0,66),"0x"+b.substring(66,130),parseInt(b.substring(130),16)-27)}),h.defineProperty(d.prototype,"encrypt",function(a,b,c){if("function"!=typeof b||c||(c=b,b={}),c&&"function"!=typeof c)throw new Error("invalid callback");return b||(b={}),j.encrypt(this.privateKey,a,b,c)}),h.defineProperty(d,"isEncryptedWallet",function(a){return j.isValidWallet(a)||j.isCrowdsaleWallet(a)}),h.defineProperty(d,"createRandom",function(a){var b=h.randomBytes(16);a||(a={}),a.extraEntropy&&(b=h.keccak256(h.concat([b,a.extraEntropy])).substring(0,34));var c=i.entropyToMnemonic(b);return d.fromMnemonic(c,a.path)}),h.defineProperty(d,"fromEncryptedWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return new Promise(function(e,f){if(j.isCrowdsaleWallet(a))try{var g=j.decryptCrowdsale(a,b);e(new d(g))}catch(h){f(h)}else j.isValidWallet(a)?j.decrypt(a,b,c).then(function(a){e(new d(a))},function(a){f(a)}):f("invalid wallet JSON")})}),h.defineProperty(d,"fromMnemonic",function(a,b){b||(b=l);var c=i.fromMnemonic(a).derivePath(b),e=new d(c.privateKey);return h.defineProperty(e,"mnemonic",a),h.defineProperty(e,"path",b),e}),h.defineProperty(d,"fromBrainWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return a="string"==typeof a?h.toUtf8Bytes(a,"NFKC"):h.arrayify(a,"password"),b="string"==typeof b?h.toUtf8Bytes(b,"NFKC"):h.arrayify(b,"password"),new Promise(function(e,f){g(b,a,1<<18,8,1,32,function(a,b,g){if(a)f(a);else if(g)e(new d(h.hexlify(g)));else if(c)return c(b)})})}),b.exports=d},{"./hdnode":51,"./secret-storage":53,"./signing-key":54,"ethers-utils":40,"scrypt-js":73,setimmediate:74}],56:[function(a,b,c){b.exports="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; +"ethers-utils/keccak256.js":41,"ethers-utils/properties.js":44,"ethers-utils/throw-error":48,"ethers-utils/utf8.js":50}],24:[function(a,b,c){"use strict";try{b.exports.XMLHttpRequest=XMLHttpRequest}catch(d){console.log("Warning: XMLHttpRequest is not defined"),b.exports.XMLHttpRequest=null}},{}],25:[function(a,b,c){"use strict";function d(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function e(a){var b=[];for(var c in a)if(null!=a[c]){var e=k.hexlify(a[c]);({gasLimit:!0,gasPrice:!0,nonce:!0,value:!0})[c]&&(e=d(e)),b.push(c+"="+e)}return b.join("&")}function f(a,b){j.call(this,a);var c=null;switch(this.name){case"homestead":c="https://api.etherscan.io";break;case"ropsten":c="https://ropsten.etherscan.io";break;case"rinkeby":c="https://rinkeby.etherscan.io";break;case"kovan":c="https://kovan.etherscan.io";break;default:throw new Error("unsupported network")}k.defineProperty(this,"baseUrl",c),k.defineProperty(this,"apiKey",b||null)}function g(a){if(0==a.status&&"No records found"===a.message)return a.result;if(1!=a.status||"OK"!=a.message){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}return a.result}function h(a){if("2.0"!=a.jsonrpc){var b=new Error("invalid response");throw b.result=JSON.stringify(a),b}if(a.error){var b=new Error(a.error.message||"unknown error");throw a.error.code&&(b.code=a.error.code),a.error.data&&(b.data=a.error.data),b}return a.result}function i(a){if("pending"===a)throw new Error("pending not supported");return"latest"===a?a:parseInt(a.substring(2),16)}var j=a("./provider.js"),k=function(){var b=a("ethers-utils/convert.js");return{defineProperty:a("ethers-utils/properties.js").defineProperty,hexlify:b.hexlify}}();j.inherits(f),k.defineProperty(f.prototype,"_call",function(){}),k.defineProperty(f.prototype,"_callProxy",function(){}),k.defineProperty(f.prototype,"perform",function(a,b){b||(b={});var c=this.baseUrl,f="";switch(this.apiKey&&(f+="&apikey="+this.apiKey),a){case"getBlockNumber":return c+="/api?module=proxy&action=eth_blockNumber"+f,j.fetchJSON(c,null,h);case"getGasPrice":return c+="/api?module=proxy&action=eth_gasPrice"+f,j.fetchJSON(c,null,h);case"getBalance":return c+="/api?module=account&action=balance&address="+b.address,c+="&tag="+b.blockTag+f,j.fetchJSON(c,null,g);case"getTransactionCount":return c+="/api?module=proxy&action=eth_getTransactionCount&address="+b.address,c+="&tag="+b.blockTag+f,j.fetchJSON(c,null,h);case"getCode":return c+="/api?module=proxy&action=eth_getCode&address="+b.address,c+="&tag="+b.blockTag+f,j.fetchJSON(c,null,h);case"getStorageAt":return c+="/api?module=proxy&action=eth_getStorageAt&address="+b.address,c+="&position="+d(b.position),c+="&tag="+d(b.blockTag)+f,j.fetchJSON(c,null,h);case"sendTransaction":return c+="/api?module=proxy&action=eth_sendRawTransaction&hex="+b.signedTransaction,c+=f,j.fetchJSON(c,null,h);case"getBlock":if(b.blockTag)return c+="/api?module=proxy&action=eth_getBlockByNumber&tag="+d(b.blockTag),c+="&boolean=false",c+=f,j.fetchJSON(c,null,h);throw new Error("getBlock by blockHash not implmeneted");case"getTransaction":return c+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+b.transactionHash,c+=f,j.fetchJSON(c,null,h);case"getTransactionReceipt":return c+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+b.transactionHash,c+=f,j.fetchJSON(c,null,h);case"call":var k=e(b.transaction);return k&&(k="&"+k),c+="/api?module=proxy&action=eth_call"+k,c+=f,j.fetchJSON(c,null,h);case"estimateGas":var k=e(b.transaction);return k&&(k="&"+k),c+="/api?module=proxy&action=eth_estimateGas&"+k,c+=f,j.fetchJSON(c,null,h);case"getLogs":c+="/api?module=logs&action=getLogs";try{if(b.filter.fromBlock&&(c+="&fromBlock="+i(b.filter.fromBlock)),b.filter.toBlock&&(c+="&toBlock="+i(b.filter.toBlock)),b.filter.address&&(c+="&address="+b.filter.address),b.filter.topics&&b.filter.topics.length>0){if(b.filter.topics.length>1)throw new Error("unsupported topic format");var l=b.filter.topics[0];if("string"!=typeof l||66!==l.length)throw new Error("unsupported topic0 format");c+="&topic0="+l}}catch(m){return Promise.reject(m)}return c+=f,j.fetchJSON(c,null,g)}return Promise.reject(new Error("not implemented - "+a))}),b.exports=f},{"./provider.js":32,"ethers-utils/convert.js":37,"ethers-utils/properties.js":44}],26:[function(a,b,c){"use strict";function d(a){if(0===a.length)throw new Error("no providers");var b={};if(["chainId","ensAddress","name","testnet"].forEach(function(c){for(var d=1;d3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);return a}function f(a){var b={};for(var c in a)b[c]=i.hexlify(a[c]);return["gasLimit","gasPrice","nonce","value"].forEach(function(a){b[a]&&(b[a]=e(b[a]))}),b}function g(a,b){if(!(this instanceof g))throw new Error("missing new");var c=[];"string"!=typeof a||null!=h.networks[a]?(c.push(a),null!=b&&c.push(b),a=null):2===arguments.length?c.push(arguments[1]):3===arguments.length&&(c.push(arguments[1]),c.push(arguments[2])),h.apply(this,c),a||(a="http://localhost:8545"),i.defineProperty(this,"url",a)}var h=a("./provider.js"),i=function(){var b=a("ethers-utils/convert");return{defineProperty:a("ethers-utils/properties").defineProperty,hexlify:b.hexlify,isHexString:b.isHexString}}();h.inherits(g),i.defineProperty(g.prototype,"send",function(a,b){var c={method:a,params:b,id:42,jsonrpc:"2.0"};return h.fetchJSON(this.url,JSON.stringify(c),d)}),i.defineProperty(g.prototype,"perform",function(a,b){switch(a){case"getBlockNumber":return this.send("eth_blockNumber",[]);case"getGasPrice":return this.send("eth_gasPrice",[]);case"getBalance":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getBalance",[b.address,c]);case"getTransactionCount":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getTransactionCount",[b.address,c]);case"getCode":var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getCode",[b.address,c]);case"getStorageAt":var d=b.position;i.isHexString(d)&&(d=e(d));var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getStorageAt",[b.address,d,c]);case"sendTransaction":return this.send("eth_sendRawTransaction",[b.signedTransaction]);case"getBlock":if(b.blockTag){var c=b.blockTag;return i.isHexString(c)&&(c=e(c)),this.send("eth_getBlockByNumber",[c,!1])}return b.blockHash?this.send("eth_getBlockByHash",[b.blockHash,!1]):Promise.reject(new Error("invalid block tag or block hash"));case"getTransaction":return this.send("eth_getTransactionByHash",[b.transactionHash]);case"getTransactionReceipt":return this.send("eth_getTransactionReceipt",[b.transactionHash]);case"call":return this.send("eth_call",[f(b.transaction),"latest"]);case"estimateGas":return this.send("eth_estimateGas",[f(b.transaction)]);case"getLogs":return this.send("eth_getLogs",[b.filter])}return Promise.reject(new Error("not implemented - "+a))}),b.exports=g},{"./provider.js":32,"ethers-utils/convert":37,"ethers-utils/properties":44}],30:[function(a,b,c){b.exports={unspecified:{chainId:0,name:"unspecified"},homestead:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},mainnet:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},morden:{chainId:2,name:"morden"},ropsten:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},testnet:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},rinkeby:{chainId:4,name:"rinkeby"},kovan:{chainId:42,name:"kovan"}}},{}],31:[function(a,b,c){"function"==typeof Object.create?b.exports=function(a,b){a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}},{}],32:[function(a,b,c){"use strict";function d(a){var b={};for(var c in a)b[c]=a[c];return b}function e(a,b){var c={};for(var d in a)try{var e=a[d](b[d]);void 0!==e&&(c[d]=e)}catch(f){throw f.checkKey=d,f.checkValue=b[d],f}return c}function f(a,b){return function(c){return null==c?b:a(c)}}function g(a,b){return function(c){return c?a(c):b}}function h(a){return function(b){if(!Array.isArray(b))throw new Error("not an array");var c=[];return b.forEach(function(b){c.push(a(b))}),c}}function i(a){if(!D.isHexString(a)||66!==a.length)throw new Error("invalid hash - "+a);return a}function j(a){return D.bigNumberify(a).toNumber()}function k(a){if(!D.isHexString(a))throw new Error("invalid uint256");for(;a.length<66;)a="0x0"+a.substring(2);return a}function l(a){if("string"!=typeof a)throw new Error("invalid string");return a}function m(a){if(null==a)return"latest";if("earliest"===a)return"0x0";if("latest"===a||"pending"===a)return a;if("number"==typeof a)return D.hexlify(a);if(D.isHexString(a))return a;throw new Error("invalid blockTag")}function n(a){return null!=a.author&&null==a.miner&&(a.miner=a.author),e(E,a)}function o(a){if(null!=a.gas&&null==a.gasLimit&&(a.gasLimit=a.gas),a.to&&D.bigNumberify(a.to).isZero&&(a.to="0x0000000000000000000000000000000000000000"),null!=a.input&&null==a.data&&(a.data=a.input),null==a.to&&null==a.creates&&(a.creates=D.getContractAddress(a)),!a.raw&&a.v&&a.r&&a.s){var b=[D.hexlify(a.nonce),D.hexlify(a.gasPrice),D.hexlify(a.gasLimit),a.to||"0x",D.hexlify(a.value||"0x"),D.hexlify(a.data||"0x"),D.hexlify(a.v||"0x"),D.hexlify(a.r),D.hexlify(a.s)];a.raw=D.RLP.encode(b)}var c=e(F,a),d=a.networkId;return D.isHexString(d)&&(d=D.bigNumberify(d).toNumber()),"number"!=typeof d&&null!=c.v&&(d=(c.v-35)/2,d<0&&(d=0),d=parseInt(d)),"number"!=typeof d&&(d=0),c.networkId=d,c.blockHash&&"x"===c.blockHash.replace(/0/g,"")&&(c.blockHash=null),c}function p(a){return e(G,a)}function q(a){return e(H,a)}function r(a){var b=(a.status,a.root,e(I,a));return b.logs.forEach(function(a,b){null==a.transactionLogIndex&&(a.transactionLogIndex=b),null==a.type&&(a.type="mined")}),null!=a.status&&(b.byzantium=!0),b}function s(a){return Array.isArray(a)?a.forEach(function(a){s(a)}):null!=a&&i(a),a}function t(a){return e(J,a)}function u(a){return e(K,a)}function v(a){function b(){e.getBlockNumber().then(function(a){if(a!==f){null===f&&(f=a-1);for(var b=f+1;b<=a;b++)e.emit("block",b);var c={};Object.keys(d).forEach(function(b){var d=z(b);"transaction"===d.type?e.getTransaction(d.hash).then(function(a){a&&a.blockNumber&&e.emit(d.hash,a)}):"address"===d.type?(g[d.address]&&(c[d.address]=g[d.address]),e.getBalance(d.address,"latest").then(function(a){var b=g[d.address];b&&a.eq(b)||(g[d.address]=a,e.emit(d.address,a))})):"topic"===d.type&&e.getLogs({fromBlock:f+1,toBlock:a,topics:d.topic}).then(function(a){0!==a.length&&a.forEach(function(a){e.emit(d.topic,a)})})}),f=a,g=c}}),e.doPoll()}if(!(this instanceof v))throw new Error("missing new");a=v._legacyConstructor(a,arguments.length,arguments[0],arguments[1]);var c=null;a.ensAddress&&(c=D.getAddress(a.ensAddress)),D.defineProperty(this,"chainId",a.chainId),D.defineProperty(this,"ensAddress",c),D.defineProperty(this,"name",a.name),D.defineProperty(this,"testnet","homestead"!==a.name);var d={};D.defineProperty(this,"_events",d);var e=this,f=null,g={};D.defineProperty(this,"resetEventsBlock",function(a){f=a,e.doPoll()});var h=null;Object.defineProperty(this,"polling",{get:function(){return null!=h},set:function(a){setTimeout(function(){a&&!h?h=setInterval(b,4e3):!a&&h&&(clearInterval(h),h=null)},0)}})}function w(a){return function(b){A(b,a),D.defineProperty(b,"inherits",w(b))}}function x(a,b){if(Array.isArray(a)){var c=[];return a.forEach(function(a){c.push(x(a,b))}),c}return b(a)}function y(a){try{return"address:"+D.getAddress(a)}catch(b){}if("block"===a)return"block";if(D.isHexString(a)){if(66===a.length)return"tx:"+a}else if(Array.isArray(a)){a=x(a,function(a){return null==a&&(a="0x"),a});try{return"topic:"+D.RLP.encode(a)}catch(b){console.log(b)}}throw new Error("invalid event - "+a)}function z(a){if("tx:"===a.substring(0,3))return{type:"transaction",hash:a.substring(3)};if("block"===a)return{type:"block"};if("address:"===a.substring(0,8))return{type:"address",address:a.substring(8)};if("topic:"===a.substring(0,6))try{var b=D.RLP.decode(a.substring(6));return b=x(b,function(a){return"0x"===a&&(a=null),a}),{type:"topic",topic:b}}catch(c){console.log(c)}throw new Error("invalid event string")}var A=a("inherits"),B=a("xmlhttprequest").XMLHttpRequest,C=a("./networks.json"),D=function(){var b=a("ethers-utils/convert");return{defineProperty:a("ethers-utils/properties").defineProperty,getAddress:a("ethers-utils/address").getAddress,getContractAddress:a("ethers-utils/contract-address").getContractAddress,bigNumberify:a("ethers-utils/bignumber").bigNumberify,arrayify:b.arrayify,hexlify:b.hexlify,isHexString:b.isHexString,concat:b.concat,namehash:a("ethers-utils/namehash"),toUtf8String:a("ethers-utils/utf8").toUtf8String,RLP:a("ethers-utils/rlp")}}(),E={hash:i,parentHash:i,number:j,timestamp:j,nonce:f(D.hexlify),difficulty:f(j),gasLimit:D.bigNumberify,gasUsed:D.bigNumberify,miner:D.getAddress,extraData:D.hexlify,transactions:f(h(i))},F={hash:i,blockHash:f(i,null),blockNumber:f(j,null),transactionIndex:f(j,null),from:D.getAddress,gasPrice:D.bigNumberify,gasLimit:D.bigNumberify,to:f(D.getAddress,null),value:D.bigNumberify,nonce:j,data:D.hexlify,r:f(k),s:f(k),v:f(j),creates:f(D.getAddress,null),raw:f(D.hexlify)},G={from:f(D.getAddress),nonce:f(j),gasLimit:f(D.bigNumberify),gasPrice:f(D.bigNumberify),to:f(D.getAddress),value:f(D.bigNumberify),data:f(D.hexlify)},H={transactionLogIndex:f(j),transactionIndex:j,blockNumber:j,transactionHash:i,address:D.getAddress,type:f(l),topics:h(i),data:D.hexlify,logIndex:j,blockHash:i},I={contractAddress:f(D.getAddress,null),transactionIndex:j,root:f(i),gasUsed:D.bigNumberify,logsBloom:D.hexlify,blockHash:i,transactionHash:i,logs:h(q),blockNumber:j,cumulativeGasUsed:D.bigNumberify,status:f(j)},J={fromBlock:f(m,void 0),toBlock:f(m,void 0),address:f(D.getAddress,void 0),topics:f(s,void 0)},K={blockNumber:j,transactionIndex:j,address:D.getAddress,data:g(D.hexlify,"0x"),topics:h(i),transactionHash:i,logIndex:j};D.defineProperty(v,"inherits",w(v)),D.defineProperty(v,"_legacyConstructor",function(a,b,c,d){if("boolean"==typeof c||2===b){var e=!!c,f=d;a=C[e?"ropsten":"homestead"],2===b&&null!=f&&(a={chainId:f,ensAddress:a.ensAddress,name:a.name})}else if("string"==typeof a){if(a=C[a],!a)throw new Error("unknown network")}else null==a&&(a=C.homestead);if("number"!=typeof a.chainId)throw new Error("invalid chainId");return a}),D.defineProperty(v,"chainId",{homestead:1,morden:2,ropsten:3,rinkeby:4,kovan:42}),D.defineProperty(v,"networks",C),D.defineProperty(v,"fetchJSON",function(a,b,c){return new Promise(function(d,e){var f=new B;b?(f.open("POST",a,!0),f.setRequestHeader("Content-Type","application/json")):f.open("GET",a,!0),f.onreadystatechange=function(){if(4===f.readyState){try{var g=JSON.parse(f.responseText)}catch(h){var i=new Error("invalid json response");return i.orginialError=h,i.responseText=f.responseText,void e(i)}if(c)try{g=c(g)}catch(h){return h.url=a,h.body=b,h.responseText=f.responseText,void e(h)}if(200!=f.status){var h=new Error("invalid response - "+f.status);return h.statusCode=f.statusCode,void e(h)}d(g)}},f.onerror=function(a){e(a)};try{b?f.send(b):f.send()}catch(g){var h=new Error("connection error");h.error=g,e(h)}})}),D.defineProperty(v.prototype,"waitForTransaction",function(a,b){var c=this;return new Promise(function(d,e){function f(a){g&&clearTimeout(g),d(a)}var g=null;c.once(a,f),"number"==typeof b&&b>0&&(g=setTimeout(function(){c.removeListener(a,f),e(new Error("timeout"))},b))})}),D.defineProperty(v.prototype,"getBlockNumber",function(){try{return this.perform("getBlockNumber").then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getBlockNumber");return b})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"getGasPrice",function(){try{return this.perform("getGasPrice").then(function(a){return D.bigNumberify(a)})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"getBalance",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getBalance",d).then(function(a){return D.bigNumberify(a)})})}),D.defineProperty(v.prototype,"getTransactionCount",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getTransactionCount",d).then(function(a){var b=parseInt(a);if(b!=a)throw new Error("invalid response - getTransactionCount");return b})})}),D.defineProperty(v.prototype,"getCode",function(a,b){var c=this;return this.resolveName(a).then(function(a){var d={address:a,blockTag:m(b)};return c.perform("getCode",d).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"getStorageAt",function(a,b,c){var d=this;return this.resolveName(a).then(function(a){var e={address:a,blockTag:m(c),position:D.hexlify(b)};return d.perform("getStorageAt",e).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"sendTransaction",function(a){try{var b={signedTransaction:D.hexlify(a)};return this.perform("sendTransaction",b).then(function(a){if(a=D.hexlify(a),66!==a.length)throw new Error("invalid response - sendTransaction");return a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"call",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:p(a)};return b.perform("call",c).then(function(a){return D.hexlify(a)})})}),D.defineProperty(v.prototype,"estimateGas",function(a){var b=this;return this._resolveNames(a,["to","from"]).then(function(a){var c={transaction:p(a)};return b.perform("estimateGas",c).then(function(a){return D.bigNumberify(a)})})}),D.defineProperty(v.prototype,"getBlock",function(a){try{var b=D.hexlify(a);if(66===b.length)return this.perform("getBlock",{blockHash:b}).then(function(a){return n(a)})}catch(c){console.log("DEBUG",c)}try{var d=m(a);return this.perform("getBlock",{blockTag:d}).then(function(a){return n(a)})}catch(c){console.log("DEBUG",c)}return Promise.reject(new Error("invalid block hash or block tag"))}),D.defineProperty(v.prototype,"getTransaction",function(a){try{var b={transactionHash:i(a)};return this.perform("getTransaction",b).then(function(a){return null!=a&&(a=o(a)),a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"getTransactionReceipt",function(a){try{var b={transactionHash:i(a)};return this.perform("getTransactionReceipt",b).then(function(a){return null!=a&&(a=r(a)),a})}catch(c){return Promise.reject(c)}}),D.defineProperty(v.prototype,"getLogs",function(a){var b=this;return this._resolveNames(a,["address"]).then(function(a){var c={filter:t(a)};return b.perform("getLogs",c).then(function(a){return h(u)(a)})})}),D.defineProperty(v.prototype,"getEtherPrice",function(){try{return this.perform("getEtherPrice",{}).then(function(a){return a})}catch(a){return Promise.reject(a)}}),D.defineProperty(v.prototype,"_resolveNames",function(a,b){var c=[],e=d(a);return b.forEach(function(a){void 0!==e[a]&&c.push(this.resolveName(e[a]).then(function(b){e[a]=b}))},this),Promise.all(c).then(function(){return e})}),D.defineProperty(v.prototype,"_getResolver",function(a){var b=D.namehash(a),c="0x0178b8bf"+b.substring(2),d={to:this.ensAddress,data:c};return this.call(d).then(function(a){return 66!=a.length?null:D.getAddress("0x"+a.substring(26))})}),D.defineProperty(v.prototype,"resolveName",function(a){try{return Promise.resolve(D.getAddress(a))}catch(b){}var c=this,d=D.namehash(a);return this._getResolver(a).then(function(a){var b="0x3b3b57de"+d.substring(2),e={to:a,data:b};return c.call(e)}).then(function(a){if(66!=a.length)return null;var b=D.getAddress("0x"+a.substring(26));return"0x0000000000000000000000000000000000000000"===b?null:b})}),D.defineProperty(v.prototype,"lookupAddress",function(a){a=D.getAddress(a);var b=a.substring(2)+".addr.reverse",c=D.namehash(b),d=this;return this._getResolver(b).then(function(a){if(!a)return null;var b="0x691f3431"+c.substring(2),e={to:a,data:b};return d.call(e)}).then(function(b){if(b=b.substring(2),b.length<64)return null;if(b=b.substring(64),b.length<64)return null;var c=D.bigNumberify("0x"+b.substring(0,64)).toNumber();if(b=b.substring(64),2*c>b.length)return null;var e=D.toUtf8String("0x"+b.substring(0,2*c));return d.resolveName(e).then(function(b){return b!=a?null:e})})}),D.defineProperty(v.prototype,"doPoll",function(){}),D.defineProperty(v.prototype,"perform",function(a,b){return Promise.reject(new Error("not implemented - "+a))}),D.defineProperty(v.prototype,"on",function(a,b){var c=y(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"on"}),this.polling=!0}),D.defineProperty(v.prototype,"once",function(a,b){var c=y(a);this._events[c]||(this._events[c]=[]),this._events[c].push({eventName:a,listener:b,type:"once"}),this.polling=!0}),D.defineProperty(v.prototype,"emit",function(a){var b=y(a),c=Array.prototype.slice.call(arguments,1),d=this._events[b];if(d){for(var e=0;e>1]>>4>=8&&(a[c]=a[c].toUpperCase()),(15&b[c>>1])>=8&&(a[c+1]=a[c+1].toUpperCase());return"0x"+a.join("")}function e(a){return Math.log10?Math.log10(a):Math.log(a)/Math.LN10}function f(a,b){var c=null;if("string"!=typeof a&&i("invalid address",{input:a}),a.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==a.substring(0,2)&&(a="0x"+a),c=d(a),a.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&c!==a&&i("invalid address checksum",{input:a,expected:c});else if(a.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(a.substring(2,4)!==l(a)&&i("invalid address icap checksum",{input:a}),c=new g(a.substring(4),36).toString(16);c.length<40;)c="0"+c;c=d("0x"+c)}else i("invalid address",{input:a});if(b){for(var e=new g(c.substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e}return c}var g=a("bn.js"),h=a("./convert"),i=a("./throw-error"),j=a("./keccak256"),k=9007199254740991,l=function(){for(var a={},b=0;b<10;b++)a[String(b)]=String(b);for(var b=0;b<26;b++)a[String.fromCharCode(65+b)]=String(10+b);var c=Math.floor(e(k));return function(b){b=b.toUpperCase(),b=b.substring(4)+b.substring(0,2)+"00";for(var d=b.split(""),e=0;e=c;){var f=d.substring(0,c);d=parseInt(f,10)%97+d.substring(f.length)}for(var g=String(98-parseInt(d,10)%97);g.length<2;)g="0"+g;return g}}();b.exports={getAddress:f}},{"./convert":37,"./keccak256":41,"./throw-error":48,"bn.js":3}],34:[function(a,b,c){function d(a){if(!(this instanceof d))throw new Error("missing new");i.isHexString(a)?("0x"==a&&(a="0x0"),a=new g(a.substring(2),16)):"string"==typeof a&&a.match(/^-?[0-9]*$/)?(""==a&&(a="0"),a=new g(a)):"number"==typeof a&&parseInt(a)==a?a=new g(a):g.isBN(a)||(e(a)?a=a._bn:i.isArrayish(a)?a=new g(i.hexlify(a).substring(2),16):j("invalid BigNumber value",{input:a})),h(this,"_bn",a)}function e(a){return a._bn&&a._bn.mod}function f(a){return e(a)?a:new d(a)}var g=a("bn.js"),h=a("./properties").defineProperty,i=a("./convert"),j=a("./throw-error");h(d,"constantNegativeOne",f(-1)),h(d,"constantZero",f(0)),h(d,"constantOne",f(1)),h(d,"constantTwo",f(2)),h(d,"constantWeiPerEther",f(new g("1000000000000000000"))),h(d.prototype,"fromTwos",function(a){return new d(this._bn.fromTwos(a))}),h(d.prototype,"toTwos",function(a){return new d(this._bn.toTwos(a))}),h(d.prototype,"add",function(a){return new d(this._bn.add(f(a)._bn))}),h(d.prototype,"sub",function(a){return new d(this._bn.sub(f(a)._bn))}),h(d.prototype,"div",function(a){return new d(this._bn.div(f(a)._bn))}),h(d.prototype,"mul",function(a){return new d(this._bn.mul(f(a)._bn))}),h(d.prototype,"mod",function(a){return new d(this._bn.mod(f(a)._bn))}),h(d.prototype,"pow",function(a){return new d(this._bn.pow(f(a)._bn))}),h(d.prototype,"maskn",function(a){return new d(this._bn.maskn(a))}),h(d.prototype,"eq",function(a){return this._bn.eq(f(a)._bn)}),h(d.prototype,"lt",function(a){return this._bn.lt(f(a)._bn)}),h(d.prototype,"lte",function(a){return this._bn.lte(f(a)._bn)}),h(d.prototype,"gt",function(a){return this._bn.gt(f(a)._bn)}),h(d.prototype,"gte",function(a){return this._bn.gte(f(a)._bn)}),h(d.prototype,"isZero",function(){return this._bn.isZero()}),h(d.prototype,"toNumber",function(a){return this._bn.toNumber()}),h(d.prototype,"toString",function(){return this._bn.toString(10)}),h(d.prototype,"toHexString",function(){var a=this._bn.toString(16);return a.length%2&&(a="0"+a),"0x"+a}),b.exports={isBigNumber:e,bigNumberify:f}},{"./convert":37,"./properties":44,"./throw-error":48,"bn.js":3}],35:[function(a,b,c){(function(c){"use strict";function d(a){if(a<=0||a>1024||parseInt(a)!=a)throw new Error("invalid length");var b=new Uint8Array(a);return g.getRandomValues(b),e.arrayify(b)}var e=a("./convert"),f=a("./properties").defineProperty,g=c.crypto||c.msCrypto;g&&g.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),g={getRandomValues:function(a){for(var b=0;b<20;b++)for(var c=0;c=256||parseInt(c)!=c)return!1}return!0}function f(a,b){if(a&&a.toHexString&&(a=a.toHexString()),j(a)){a=a.substring(2),a.length%2&&(a="0"+a);for(var c=[],f=0;f>4]+m[15&g])}return"0x"+d.join("")}l("invalid hexlify value",{name:b,input:a})}var l=(a("./properties.js").defineProperty,a("./throw-error")),m="0123456789abcdef";b.exports={arrayify:f,isArrayish:e,concat:g,padZeros:i,stripZeros:h,hexlify:k,isHexString:j}},{"./properties.js":44,"./throw-error":48}],38:[function(a,b,c){"use strict";function d(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha256,a)}function e(a){return a.buffer||(a=h.arrayify(a)),new f.hmac(g.createSha512,a)}var f=a("hash.js"),g=a("./sha2.js"),h=a("./convert.js");b.exports={createSha256Hmac:d,createSha512Hmac:e}},{"./convert.js":37,"./sha2.js":46,"hash.js":57}],39:[function(a,b,c){"use strict";function d(a){return e(f.toUtf8Bytes(a))}var e=a("./keccak256"),f=a("./utf8");b.exports=d},{"./keccak256":41,"./utf8":50}],40:[function(a,b,c){"use strict";var d=a("./address"),e=a("./bignumber"),f=a("./contract-address"),g=a("./convert"),h=a("./id"),i=a("./keccak256"),j=a("./namehash"),k=a("./sha2").sha256,l=a("./random-bytes"),m=a("./properties"),n=a("./rlp"),o=a("./utf8"),p=a("./units");b.exports={ +RLP:n,defineProperty:m.defineProperty,etherSymbol:"Ξ",arrayify:g.arrayify,concat:g.concat,padZeros:g.padZeros,stripZeros:g.stripZeros,bigNumberify:e.bigNumberify,hexlify:g.hexlify,toUtf8Bytes:o.toUtf8Bytes,toUtf8String:o.toUtf8String,namehash:j,id:h,getAddress:d.getAddress,getContractAddress:f.getContractAddress,formatEther:p.formatEther,parseEther:p.parseEther,keccak256:i,sha256:k,randomBytes:l},a("./standalone")({utils:b.exports})},{"./address":33,"./bignumber":34,"./contract-address":36,"./convert":37,"./id":39,"./keccak256":41,"./namehash":42,"./properties":44,"./random-bytes":35,"./rlp":45,"./sha2":46,"./standalone":47,"./units":49,"./utf8":50}],41:[function(a,b,c){"use strict";function d(a){return a=f.arrayify(a),"0x"+e.keccak_256(a)}var e=a("js-sha3"),f=a("./convert.js");b.exports=d},{"./convert.js":37,"js-sha3":70}],42:[function(a,b,c){"use strict";function d(a,b){if(a=a.toLowerCase(),!a.match(j))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var c=h,d=0;a.length&&(!b||d>24&255,j[b.length+1]=m>>16&255,j[b.length+2]=m>>8&255,j[b.length+3]=255&m;var n=f(a).update(j).digest();g||(g=n.length,l=new Uint8Array(g),h=Math.ceil(d/g),k=d-(h-1)*g),l.set(n);for(var o=1;o>=8;return b}function e(a,b,c){for(var d=0,e=0;eb+1+d)throw new Error("invalid rlp")}return{consumed:1+d,result:e}}function i(a,b){if(0===a.length)throw new Error("invalid rlp data");if(a[b]>=248){var c=a[b]-247;if(b+1+c>a.length)throw new Error("too short");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("to short");return h(a,b,b+1+c,c+d)}if(a[b]>=192){var d=a[b]-192;if(b+1+d>a.length)throw new Error("invalid rlp data");return h(a,b,b+1,d)}if(a[b]>=184){var c=a[b]-183;if(b+1+c>a.length)throw new Error("invalid rlp data");var d=e(a,b+1,c);if(b+1+c+d>a.length)throw new Error("invalid rlp data");var f=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){var d=a[b]-128;if(b+1+d>a.offset)throw new Error("invlaid rlp data");var f=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}function j(a){a=k.arrayify(a);var b=i(a,0);if(b.consumed!==a.length)throw new Error("invalid rlp data");return b.result}var k=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":37}],46:[function(a,b,c){"use strict";function d(a){return a=g.arrayify(a),"0x"+f.sha256().update(a).digest("hex")}function e(a){return a=g.arrayify(a),"0x"+f.sha512().update(a).digest("hex")}var f=a("hash.js"),g=a("./convert.js");b.exports={sha256:d,sha512:e,createSha256:f.sha256,createSha512:f.sha512}},{"./convert.js":37,"hash.js":57}],47:[function(a,b,c){(function(c){function d(){}function e(a){null==c.ethers&&f(c,"ethers",new d);for(var b in a)null==c.ethers[b]&&f(c.ethers,b,a[b])}var f=a("./properties.js").defineProperty;b.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./properties.js":44}],48:[function(a,b,c){"use strict";function d(a,b){var c=new Error(a);for(var d in b)c[d]=b[d];throw c}b.exports=d},{}],49:[function(a,b,c){function d(a,b){a=f(a),b||(b={});var c=a.lt(h);c&&(a=a.mul(i));for(var d=a.mod(j).toString(10);d.length<18;)d="0"+d;b.pad||(d=d.match(/^([0-9]*[1-9]|0)(0*)/)[1]);var e=a.div(j).toString(10);b.commify&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,","));var g=e+"."+d;return c&&(g="-"+g),g}function e(a){"string"==typeof a&&a.match(/^-?[0-9.,]+$/)||g("invalid value",{input:a});var b=a.replace(/,/g,""),c="-"===b.substring(0,1);c&&(b=b.substring(1)),"."===b&&g("invalid value",{input:a});var d=b.split(".");d.length>2&&g("too many decimal points",{input:a});var e=d[0],h=d[1];for(e||(e="0"),h||(h="0"),h.length>18&&g("too many decimal places",{input:a,decimals:h.length});h.length<18;)h+="0";e=f(e),h=f(h);var k=e.mul(j).add(h);return c&&(k=k.mul(i)),k}var f=a("./bignumber.js").bigNumberify,g=a("./throw-error"),h=new f(0),i=new f((-1)),j=new f("1000000000000000000");b.exports={formatEther:d,parseEther:e}},{"./bignumber.js":34,"./throw-error":48}],50:[function(a,b,c){function d(a){for(var b=[],c=0,d=0;d>6|192,b[c++]=63&e|128):55296==(64512&e)&&d+1>18|240,b[c++]=e>>12&63|128,b[c++]=e>>6&63|128,b[c++]=63&e|128):(b[c++]=e>>12|224,b[c++]=e>>6&63|128,b[c++]=63&e|128)}return f.arrayify(b)}function e(a){a=f.arrayify(a);for(var b="",c=0;c>7!=0){if(d>>6!=2){var e=null;if(d>>5==6)e=1;else if(d>>4==14)e=2;else if(d>>3==30)e=3;else if(d>>2==62)e=4;else{if(d>>1!=126)continue;e=5}if(c+e>a.length){for(;c>6==2;c++);if(c!=a.length)continue;return b}var g,h=d&(1<<8-e-1)-1;for(g=0;g>6!=2)break;h=h<<6|63&i}g==e?h<=65535?b+=String.fromCharCode(h):(h-=65536,b+=String.fromCharCode((h>>10&1023)+55296,(1023&h)+56320)):c--}}else b+=String.fromCharCode(d)}return b}var f=a("./convert.js");b.exports={toUtf8Bytes:d,toUtf8String:e}},{"./convert.js":37}],51:[function(a,b,c){function d(a){return(1<127)throw new Error("passwords with non-ASCII characters not supported in this environment")}else b="";a=m.toUtf8Bytes(a,"NFKD");var e=m.toUtf8Bytes("mnemonic"+b,"NFKD");return m.hexlify(m.pbkdf2(a,e,2048,64,m.createSha512Hmac))}function h(a){var b=a.toLowerCase().split(" ");if(b.length%3!==0)throw new Error("invalid mnemonic");for(var c=m.arrayify(new Uint8Array(Math.ceil(11*b.length/8))),e=0,f=0;f>3]|=1<<7-e%8),e++}var i=32*b.length/3,j=b.length/3,k=d(j),n=m.arrayify(m.sha256(c.slice(0,i/8)))[0];if(n&=k,n!==(c[c.length-1]&k))throw new Error("invalid checksum");return m.hexlify(c.slice(0,i/8))}function i(a){if(a=m.arrayify(a),a.length%4!==0||a.length<16||a.length>32)throw new Error("invalid entropy");for(var b=[0],c=11,f=0;f8?(b[b.length-1]<<=8,b[b.length-1]|=a[f],c-=8):(b[b.length-1]<<=c,b[b.length-1]|=a[f]>>8-c,b.push(a[f]&e(8-c)),c+=3);var g=m.arrayify(m.sha256(a))[0],h=a.length/4;g&=d(h),b[b.length-1]<<=h,b[b.length-1]|=g>>8-h;for(var f=0;f=o)throw new Error("cannot derive child of neutered node");throw new Error("not implemented")}var b=new Uint8Array(37);a&o?b.set(m.arrayify(this.privateKey),1):b.set(this._keyPair.getPublic().encode(null,!0));for(var c=24;c>=0;c-=8)b[33+(c>>3)]=a>>24-c&255;var d=m.arrayify(m.createSha512Hmac(this.chainCode).update(b).digest()),e=m.bigNumberify(d.slice(0,32)),g=(d.slice(32),e.add("0x"+this._keyPair.getPrivate("hex")).mod("0x"+k.curve.n.toString(16)));return new f(k.keyFromPrivate(m.arrayify(g)),d.slice(32),a,this.depth+1)}),m.defineProperty(f.prototype,"derivePath",function(a){var b=a.split("/");if(0===b.length||"m"===b[0]&&0!==this.depth)throw new Error("invalid path");"m"===b[0]&&b.shift();for(var c=this,d=0;d=o)throw new Error("invalid path index - "+e);c=c._derive(o+f)}else{if(!e.match(/^[0-9]+$/))throw new Error("invlaid path component - "+e);var f=parseInt(e);if(f>=o)throw new Error("invalid path index - "+e);c=c._derive(f)}}return c}),m.defineProperty(f,"fromMnemonic",function(a){return h(a),f.fromSeed(g(a))}),m.defineProperty(f,"fromSeed",function(a){if(a=m.arrayify(a),a.length<16||a.length>64)throw new Error("invalid seed");var b=m.arrayify(m.createSha512Hmac(n).update(a).digest());return new f(k.keyFromPrivate(b.slice(0,32)),b.slice(32),0,0,0)}),b.exports={fromMnemonic:f.fromMnemonic,fromSeed:f.fromSeed,mnemonicToEntropy:h,entropyToMnemonic:i,mnemonicToSeed:g,isValidMnemonic:j}},{"./words.json":56,elliptic:6,"ethers-utils/bignumber.js":34,"ethers-utils/convert.js":37,"ethers-utils/hmac":38,"ethers-utils/pbkdf2.js":43,"ethers-utils/properties.js":44,"ethers-utils/sha2":46,"ethers-utils/utf8.js":50}],52:[function(a,b,c){"use strict";var d=a("./wallet"),e=a("./hdnode"),f=a("./signing-key");b.exports={HDNode:e,Wallet:d,SigningKey:f,_SigningKey:f},a("ethers-utils/standalone.js")(b.exports)},{"./hdnode":51,"./signing-key":54,"./wallet":55,"ethers-utils/standalone.js":47}],53:[function(a,b,c){"use strict";function d(a){return"string"==typeof a&&"0x"!==a.substring(0,2)&&(a="0x"+a),l.arrayify(a)}function e(a){return"string"==typeof a?l.toUtf8Bytes(a,"NFKC"):l.arrayify(a,"password")}function f(a,b){for(var c=a,d=b.toLowerCase().split("/"),e=0;e0){var e=new Error("invalid "+b.name);throw e.reason="wrong length",e.value=c,e}if(b.maxLength&&(c=h.stripZeros(c),c.length>b.maxLength)){var e=new Error("invalid "+b.name);throw e.reason="too long",e.value=c,e}d.push(h.hexlify(c))}),b&&(d.push(h.hexlify(b)),d.push("0x"),d.push("0x"));var e=h.keccak256(h.RLP.encode(d)),f=c.signDigest(e),g=27+f.recoveryParam;return b&&(d.pop(),d.pop(),d.pop(),g+=2*b+8),d.push(h.hexlify(g)),d.push(f.r),d.push(f.s),h.RLP.encode(d)})}function e(a,b){for(;a.length<2*b+2;)a="0x0"+a.substring(2);return a}function f(a){var b=h.concat([h.toUtf8Bytes("Ethereum Signed Message:\n"),h.toUtf8Bytes(String(a.length)),h.toUtf8Bytes(a)]);return h.keccak256(b)}var g=a("scrypt-js"),h=a("ethers-utils"),i=a("./hdnode"),j=a("./secret-storage"),k=a("./signing-key");a("setimmediate");var l="m/44'/60'/0'/0/0",m=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}];h.defineProperty(d,"parseTransaction",function(a){a=h.hexlify(a,"rawTransaction");var b=h.RLP.decode(a);if(9!==b.length)throw new Error("invalid transaction");var c=[],d={};m.forEach(function(a,e){d[a.name]=b[e],c.push(b[e])}),d.to&&("0x"==d.to?delete d.to:d.to=h.getAddress(d.to)),["gasPrice","gasLimit","nonce","value"].forEach(function(a){d[a]&&(0===d[a].length?d[a]=h.bigNumberify(0):d[a]=h.bigNumberify(d[a]))}),d.nonce?d.nonce=d.nonce.toNumber():d.nonce=0;var e=h.arrayify(b[6]),f=h.arrayify(b[7]),g=h.arrayify(b[8]);if(1===e.length&&f.length>=1&&f.length<=32&&g.length>=1&&g.length<=32){d.v=e[0],d.r=b[7],d.s=b[8];var i=(d.v-35)/2;i<0&&(i=0),i=parseInt(i),d.chainId=i;var j=d.v-27;i&&(c.push(h.hexlify(i)),c.push("0x"),c.push("0x"),j-=2*i+8);var l=h.keccak256(h.RLP.encode(c));try{d.from=k.recover(l,f,g,j)}catch(n){console.log(n)}}return d}),h.defineProperty(d.prototype,"getAddress",function(){return this.address}),h.defineProperty(d.prototype,"getBalance",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,a)}),h.defineProperty(d.prototype,"getTransactionCount",function(a){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,a)}),h.defineProperty(d.prototype,"estimateGas",function(a){if(!this.provider)throw new Error("missing provider");var b={};return["from","to","data","value"].forEach(function(c){null!=a[c]&&(b[c]=a[c])}),null==a.from&&(b.from=this.address),this.provider.estimateGas(b)}),h.defineProperty(d.prototype,"sendTransaction",function(a){if(!this.provider)throw new Error("missing provider");var b=a.gasLimit;null==b&&(b=this.defaultGasLimit);var c=this,e=null;e=a.gasPrice?Promise.resolve(a.gasPrice):this.provider.getGasPrice();var f=null;f=a.nonce?Promise.resolve(a.nonce):this.provider.getTransactionCount(c.address,"pending");var g=this.provider.chainId,i=null;i=a.to?this.provider.resolveName(a.to):Promise.resolve(void 0);var j=h.hexlify(a.data||"0x"),k=h.hexlify(a.value||0);return Promise.all([e,f,i]).then(function(a){var e=c.sign({to:a[2],data:j,gasLimit:b,gasPrice:a[0],nonce:a[1],value:k,chainId:g});return c.provider.sendTransaction(e).then(function(a){var b=d.parseTransaction(e);return b.hash=a,b})})}),h.defineProperty(d.prototype,"send",function(a,b,c){return c||(c={}),this.sendTransaction({to:a,gasLimit:c.gasLimit,gasPrice:c.gasPrice,nonce:c.nonce,value:b})}),h.defineProperty(d.prototype,"signMessage",function(a){var b=new k(this.privateKey),c=b.signDigest(f(a));return e(c.r)+e(c.s).substring(2)+(c.recoveryParam?"1c":"1b")}),h.defineProperty(d,"verifyMessage",function(a,b){if(b=h.hexlify(b),132!=b.length)throw new Error("invalid signature");var c=f(a),d=parseInt(b.substring(130),16)-27;if(d<0)throw new Error("invalid signature");return k.recover(c,b.substring(0,66),"0x"+b.substring(66,130),parseInt(b.substring(130),16)-27)}),h.defineProperty(d.prototype,"encrypt",function(a,b,c){if("function"!=typeof b||c||(c=b,b={}),c&&"function"!=typeof c)throw new Error("invalid callback");return b||(b={}),j.encrypt(this.privateKey,a,b,c)}),h.defineProperty(d,"isEncryptedWallet",function(a){return j.isValidWallet(a)||j.isCrowdsaleWallet(a)}),h.defineProperty(d,"createRandom",function(a){var b=h.randomBytes(16);a||(a={}),a.extraEntropy&&(b=h.keccak256(h.concat([b,a.extraEntropy])).substring(0,34));var c=i.entropyToMnemonic(b);return d.fromMnemonic(c,a.path)}),h.defineProperty(d,"fromEncryptedWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return new Promise(function(e,f){if(j.isCrowdsaleWallet(a))try{var g=j.decryptCrowdsale(a,b);e(new d(g))}catch(h){f(h)}else j.isValidWallet(a)?j.decrypt(a,b,c).then(function(a){e(new d(a))},function(a){f(a)}):f("invalid wallet JSON")})}),h.defineProperty(d,"fromMnemonic",function(a,b){b||(b=l);var c=i.fromMnemonic(a).derivePath(b),e=new d(c.privateKey);return h.defineProperty(e,"mnemonic",a),h.defineProperty(e,"path",b),e}),h.defineProperty(d,"fromBrainWallet",function(a,b,c){if(c&&"function"!=typeof c)throw new Error("invalid callback");return a="string"==typeof a?h.toUtf8Bytes(a,"NFKC"):h.arrayify(a,"password"),b="string"==typeof b?h.toUtf8Bytes(b,"NFKC"):h.arrayify(b,"password"),new Promise(function(e,f){g(b,a,1<<18,8,1,32,function(a,b,g){if(a)f(a);else if(g)e(new d(h.hexlify(g)));else if(c)return c(b)})})}),b.exports=d},{"./hdnode":51,"./secret-storage":53,"./signing-key":54,"ethers-utils":40,"scrypt-js":73,setimmediate:74}],56:[function(a,b,c){b.exports="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; },{}],57:[function(a,b,c){var d=c;d.utils=a("./hash/utils"),d.common=a("./hash/common"),d.sha=a("./hash/sha"),d.ripemd=a("./hash/ripemd"),d.hmac=a("./hash/hmac"),d.sha1=d.sha.sha1,d.sha256=d.sha.sha256,d.sha224=d.sha.sha224,d.sha384=d.sha.sha384,d.sha512=d.sha.sha512,d.ripemd160=d.ripemd.ripemd160},{"./hash/common":58,"./hash/hmac":59,"./hash/ripemd":60,"./hash/sha":61,"./hash/utils":68}],58:[function(a,b,c){"use strict";function d(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var e=a("./utils"),f=a("minimalistic-assert");c.BlockHash=d,d.prototype.update=function(a,b){if(a=e.toArray(a,b),this.pending?this.pending=this.pending.concat(a):this.pending=a,this.pendingTotal+=a.length,this.pending.length>=this._delta8){a=this.pending;var c=a.length%this._delta8;this.pending=a.slice(a.length-c,a.length),0===this.pending.length&&(this.pending=null),a=e.join32(a,0,a.length-c,this.endian);for(var d=0;d>>24&255,d[e++]=a>>>16&255,d[e++]=a>>>8&255,d[e++]=255&a}else for(d[e++]=255&a,d[e++]=a>>>8&255,d[e++]=a>>>16&255,d[e++]=a>>>24&255,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=0,f=8;fthis.blockSize&&(a=(new this.Hash).update(a).digest()),f(a.length<=this.blockSize);for(var b=a.length;b>>3}function k(a){return m(a,17)^m(a,19)^a>>>10}var l=a("../utils"),m=l.rotr32;c.ft_1=d,c.ch32=e,c.maj32=f,c.p32=g,c.s0_256=h,c.s1_256=i,c.g0_256=j,c.g1_256=k},{"../utils":68}],68:[function(a,b,c){"use strict";function d(a,b){if(Array.isArray(a))return a.slice();if(!a)return[];var c=[];if("string"==typeof a)if(b){if("hex"===b)for(a=a.replace(/[^a-z0-9]+/gi,""),a.length%2!==0&&(a="0"+a),d=0;d>8,g=255&e;f?c.push(f,g):c.push(g)}else for(d=0;d>>24|a>>>8&65280|a<<8&16711680|(255&a)<<24;return b>>>0}function g(a,b){for(var c="",d=0;d>>0}return f}function k(a,b){for(var c=new Array(4*a.length),d=0,e=0;d>>24,c[e+1]=f>>>16&255,c[e+2]=f>>>8&255,c[e+3]=255&f):(c[e+3]=f>>>24,c[e+2]=f>>>16&255,c[e+1]=f>>>8&255,c[e]=255&f)}return c}function l(a,b){return a>>>b|a<<32-b}function m(a,b){return a<>>32-b}function n(a,b){return a+b>>>0}function o(a,b,c){return a+b+c>>>0}function p(a,b,c,d){return a+b+c+d>>>0}function q(a,b,c,d,e){return a+b+c+d+e>>>0}function r(a,b,c,d){var e=a[b],f=a[b+1],g=d+f>>>0,h=(g>>0,a[b+1]=g}function s(a,b,c,d){var e=b+d>>>0,f=(e>>0}function t(a,b,c,d){var e=b+d;return e>>>0}function u(a,b,c,d,e,f,g,h){var i=0,j=b;j=j+d>>>0,i+=j>>0,i+=j>>0,i+=j>>0}function v(a,b,c,d,e,f,g,h){var i=b+d+f+h;return i>>>0}function w(a,b,c,d,e,f,g,h,i,j){var k=0,l=b;l=l+d>>>0,k+=l>>0,k+=l>>0,k+=l>>0,k+=l>>0}function x(a,b,c,d,e,f,g,h,i,j){var k=b+d+f+h+j;return k>>>0}function y(a,b,c){var d=b<<32-c|a>>>c;return d>>>0}function z(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}function A(a,b,c){return a>>>c}function B(a,b,c){var d=a<<32-c|b>>>c;return d>>>0}var C=a("minimalistic-assert"),D=a("inherits");c.inherits=D,c.toArray=d,c.toHex=e,c.htonl=f,c.toHex32=g,c.zero2=h,c.zero8=i,c.join32=j,c.split32=k,c.rotr32=l,c.rotl32=m,c.sum32=n,c.sum32_3=o,c.sum32_4=p,c.sum32_5=q,c.sum64=r,c.sum64_hi=s,c.sum64_lo=t,c.sum64_4_hi=u,c.sum64_4_lo=v,c.sum64_5_hi=w,c.sum64_5_lo=x,c.rotr64_hi=y,c.rotr64_lo=z,c.shr64_hi=A,c.shr64_lo=B},{inherits:69,"minimalistic-assert":71}],69:[function(a,b,c){arguments[4][31][0].apply(c,arguments)},{dup:31}],70:[function(a,b,c){(function(a,c){!function(){"use strict";function d(a,b,c){this.blocks=[],this.s=[],this.padding=b,this.outputBits=c,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(a<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(31&c)>>3;for(var d=0;d<50;++d)this.s[d]=0}var e="object"==typeof window?window:{},f=!e.JS_SHA3_NO_NODE_JS&&"object"==typeof a&&a.versions&&a.versions.node;f&&(e=c);for(var g=!e.JS_SHA3_NO_COMMON_JS&&"object"==typeof b&&b.exports,h="0123456789abcdef".split(""),i=[31,7936,2031616,520093696],j=[1,256,65536,16777216],k=[6,1536,393216,100663296],l=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],n=[224,256,384,512],o=[128,256],p=["hex","buffer","arrayBuffer","array"],q=function(a,b,c){return function(e){return new d(a,b,a).update(e)[c]()}},r=function(a,b,c){return function(e,f){return new d(a,b,f).update(e)[c]()}},s=function(a,b){var c=q(a,b,"hex");c.create=function(){return new d(a,b,a)},c.update=function(a){return c.create().update(a)};for(var e=0;e>2]|=a[i]<>2]|=d<>2]|=(192|d>>6)<>2]|=(128|63&d)<=57344?(f[c>>2]|=(224|d>>12)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<>2]|=(240|d>>18)<>2]|=(128|d>>12&63)<>2]|=(128|d>>6&63)<>2]|=(128|63&d)<=g){for(this.start=c-g,this.block=f[h],c=0;c>2]|=this.padding[3&b],this.lastByteIndex===this.byteCount)for(a[0]=a[c],b=1;b>4&15]+h[15&a]+h[a>>12&15]+h[a>>8&15]+h[a>>20&15]+h[a>>16&15]+h[a>>28&15]+h[a>>24&15];g%b===0&&(C(c),f=0)}return e&&(a=c[f],e>0&&(i+=h[a>>4&15]+h[15&a]),e>1&&(i+=h[a>>12&15]+h[a>>8&15]),e>2&&(i+=h[a>>20&15]+h[a>>16&15])),i},d.prototype.arrayBuffer=function(){this.finalize();var a,b=this.blockCount,c=this.s,d=this.outputBlocks,e=this.extraBytes,f=0,g=0,h=this.outputBits>>3;a=e?new ArrayBuffer(d+1<<2):new ArrayBuffer(h);for(var i=new Uint32Array(a);g>8&255,i[a+2]=b>>16&255,i[a+3]=b>>24&255;h%c===0&&C(d)}return f&&(a=h<<2,b=d[g],f>0&&(i[a]=255&b),f>1&&(i[a+1]=b>>8&255),f>2&&(i[a+2]=b>>16&255)),i};var C=function(a){var b,c,d,e,f,g,h,i,j,k,l,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka;for(d=0;d<48;d+=2)e=a[0]^a[10]^a[20]^a[30]^a[40],f=a[1]^a[11]^a[21]^a[31]^a[41],g=a[2]^a[12]^a[22]^a[32]^a[42],h=a[3]^a[13]^a[23]^a[33]^a[43],i=a[4]^a[14]^a[24]^a[34]^a[44],j=a[5]^a[15]^a[25]^a[35]^a[45],k=a[6]^a[16]^a[26]^a[36]^a[46],l=a[7]^a[17]^a[27]^a[37]^a[47],n=a[8]^a[18]^a[28]^a[38]^a[48],o=a[9]^a[19]^a[29]^a[39]^a[49],b=n^(g<<1|h>>>31),c=o^(h<<1|g>>>31),a[0]^=b,a[1]^=c,a[10]^=b,a[11]^=c,a[20]^=b,a[21]^=c,a[30]^=b,a[31]^=c,a[40]^=b,a[41]^=c,b=e^(i<<1|j>>>31),c=f^(j<<1|i>>>31),a[2]^=b,a[3]^=c,a[12]^=b,a[13]^=c,a[22]^=b,a[23]^=c,a[32]^=b,a[33]^=c,a[42]^=b,a[43]^=c,b=g^(k<<1|l>>>31),c=h^(l<<1|k>>>31),a[4]^=b,a[5]^=c,a[14]^=b,a[15]^=c,a[24]^=b,a[25]^=c,a[34]^=b,a[35]^=c,a[44]^=b,a[45]^=c,b=i^(n<<1|o>>>31),c=j^(o<<1|n>>>31),a[6]^=b,a[7]^=c,a[16]^=b,a[17]^=c,a[26]^=b,a[27]^=c,a[36]^=b,a[37]^=c,a[46]^=b,a[47]^=c,b=k^(e<<1|f>>>31),c=l^(f<<1|e>>>31),a[8]^=b,a[9]^=c,a[18]^=b,a[19]^=c,a[28]^=b,a[29]^=c,a[38]^=b,a[39]^=c,a[48]^=b,a[49]^=c,p=a[0],q=a[1],V=a[11]<<4|a[10]>>>28,W=a[10]<<4|a[11]>>>28,D=a[20]<<3|a[21]>>>29,E=a[21]<<3|a[20]>>>29,ha=a[31]<<9|a[30]>>>23,ia=a[30]<<9|a[31]>>>23,R=a[40]<<18|a[41]>>>14,S=a[41]<<18|a[40]>>>14,J=a[2]<<1|a[3]>>>31,K=a[3]<<1|a[2]>>>31,r=a[13]<<12|a[12]>>>20,s=a[12]<<12|a[13]>>>20,X=a[22]<<10|a[23]>>>22,Y=a[23]<<10|a[22]>>>22,F=a[33]<<13|a[32]>>>19,G=a[32]<<13|a[33]>>>19,ja=a[42]<<2|a[43]>>>30,ka=a[43]<<2|a[42]>>>30,ba=a[5]<<30|a[4]>>>2,ca=a[4]<<30|a[5]>>>2,L=a[14]<<6|a[15]>>>26,M=a[15]<<6|a[14]>>>26,t=a[25]<<11|a[24]>>>21,u=a[24]<<11|a[25]>>>21,Z=a[34]<<15|a[35]>>>17,$=a[35]<<15|a[34]>>>17,H=a[45]<<29|a[44]>>>3,I=a[44]<<29|a[45]>>>3,z=a[6]<<28|a[7]>>>4,A=a[7]<<28|a[6]>>>4,da=a[17]<<23|a[16]>>>9,ea=a[16]<<23|a[17]>>>9,N=a[26]<<25|a[27]>>>7,O=a[27]<<25|a[26]>>>7,v=a[36]<<21|a[37]>>>11,w=a[37]<<21|a[36]>>>11,_=a[47]<<24|a[46]>>>8,aa=a[46]<<24|a[47]>>>8,T=a[8]<<27|a[9]>>>5,U=a[9]<<27|a[8]>>>5,B=a[18]<<20|a[19]>>>12,C=a[19]<<20|a[18]>>>12,fa=a[29]<<7|a[28]>>>25,ga=a[28]<<7|a[29]>>>25,P=a[38]<<8|a[39]>>>24,Q=a[39]<<8|a[38]>>>24,x=a[48]<<14|a[49]>>>18,y=a[49]<<14|a[48]>>>18,a[0]=p^~r&t,a[1]=q^~s&u,a[10]=z^~B&D,a[11]=A^~C&E,a[20]=J^~L&N,a[21]=K^~M&O,a[30]=T^~V&X,a[31]=U^~W&Y,a[40]=ba^~da&fa,a[41]=ca^~ea&ga,a[2]=r^~t&v,a[3]=s^~u&w,a[12]=B^~D&F,a[13]=C^~E&G,a[22]=L^~N&P,a[23]=M^~O&Q,a[32]=V^~X&Z,a[33]=W^~Y&$,a[42]=da^~fa&ha,a[43]=ea^~ga&ia,a[4]=t^~v&x,a[5]=u^~w&y,a[14]=D^~F&H,a[15]=E^~G&I,a[24]=N^~P&R,a[25]=O^~Q&S,a[34]=X^~Z&_,a[35]=Y^~$&aa,a[44]=fa^~ha&ja,a[45]=ga^~ia&ka,a[6]=v^~x&p,a[7]=w^~y&q,a[16]=F^~H&z,a[17]=G^~I&A,a[26]=P^~R&J,a[27]=Q^~S&K,a[36]=Z^~_&T,a[37]=$^~aa&U,a[46]=ha^~ja&ba,a[47]=ia^~ka&ca,a[8]=x^~p&r,a[9]=y^~q&s,a[18]=H^~z&B,a[19]=I^~A&C,a[28]=R^~J&L,a[29]=S^~K&M,a[38]=_^~T&V,a[39]=aa^~U&W,a[48]=ja^~ba&da,a[49]=ka^~ca&ea,a[0]^=m[d],a[1]^=m[d+1]};if(g)b.exports=v;else for(var x=0;x=64;){var n,o,p,q,r,s=d,t=e,u=f,v=g,w=h,x=i,y=j,z=k;for(o=0;o<16;o++)p=b+4*o,l[o]=(255&a[p])<<24|(255&a[p+1])<<16|(255&a[p+2])<<8|255&a[p+3];for(o=16;o<64;o++)n=l[o-2],q=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,n=l[o-15],r=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,l[o]=(q+l[o-7]|0)+(r+l[o-16]|0)|0;for(o=0;o<64;o++)q=(((w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7))+(w&x^~w&y)|0)+(z+(c[o]+l[o]|0)|0)|0,r=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&t^s&u^t&u)|0,z=y,y=x,x=w,w=v+q|0,v=u,u=t,t=s,s=q+r|0;d=d+s|0,e=e+t|0,f=f+u|0,g=g+v|0,h=h+w|0,i=i+x|0,j=j+y|0,k=k+z|0,b+=64,m-=64}}var c=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=1779033703,e=3144134277,f=1013904242,g=2773480762,h=1359893119,i=2600822924,j=528734635,k=1541459225,l=new Array(64);b(a);var m,n=a.length%64,o=a.length/536870912|0,p=a.length<<3,q=n<56?56:120,r=a.slice(a.length-n,a.length);for(r.push(128),m=n+1;m>>24&255),r.push(o>>>16&255),r.push(o>>>8&255),r.push(o>>>0&255),r.push(p>>>24&255),r.push(p>>>16&255),r.push(p>>>8&255),r.push(p>>>0&255),b(r),[d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255,e>>>24&255,e>>>16&255,e>>>8&255,e>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,g>>>24&255,g>>>16&255,g>>>8&255,g>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255,k>>>24&255,k>>>16&255,k>>>8&255,k>>>0&255]}function e(a,b,c){function e(){for(var a=g-1;a>=g-4;a--){if(h[a]++,h[a]<=255)return;h[a]=0}}a=a.length<=64?a:d(a);var f,g=64+b.length+4,h=new Array(g),i=new Array(64),j=[];for(f=0;f<64;f++)h[f]=54;for(f=0;f=32;)e(),j=j.concat(d(i.concat(d(h)))),c-=32;return c>0&&(e(),j=j.concat(d(i.concat(d(h))).slice(0,c))),j}function f(a,b,c,d,e){var f;for(j(a,16*(2*c-1),e,0,16),f=0;f<2*c;f++)i(a,16*f,e,16),h(e,d),j(e,0,a,b+16*f,16);for(f=0;f>>32-b}function h(a,b){j(a,0,b,0,16);for(var c=8;c>0;c-=2)b[4]^=g(b[0]+b[12],7),b[8]^=g(b[4]+b[0],9),b[12]^=g(b[8]+b[4],13),b[0]^=g(b[12]+b[8],18),b[9]^=g(b[5]+b[1],7),b[13]^=g(b[9]+b[5],9),b[1]^=g(b[13]+b[9],13),b[5]^=g(b[1]+b[13],18),b[14]^=g(b[10]+b[6],7),b[2]^=g(b[14]+b[10],9),b[6]^=g(b[2]+b[14],13),b[10]^=g(b[6]+b[2],18),b[3]^=g(b[15]+b[11],7),b[7]^=g(b[3]+b[15],9),b[11]^=g(b[7]+b[3],13),b[15]^=g(b[11]+b[7],18),b[1]^=g(b[0]+b[3],7),b[2]^=g(b[1]+b[0],9),b[3]^=g(b[2]+b[1],13),b[0]^=g(b[3]+b[2],18),b[6]^=g(b[5]+b[4],7),b[7]^=g(b[6]+b[5],9),b[4]^=g(b[7]+b[6],13),b[5]^=g(b[4]+b[7],18),b[11]^=g(b[10]+b[9],7),b[8]^=g(b[11]+b[10],9),b[9]^=g(b[8]+b[11],13),b[10]^=g(b[9]+b[8],18),b[12]^=g(b[15]+b[14],7),b[13]^=g(b[12]+b[15],9),b[14]^=g(b[13]+b[12],13),b[15]^=g(b[14]+b[13],18);for(c=0;c<16;++c)a[c]+=b[c]}function i(a,b,c,d){for(var e=0;e=256)return!1}return!0}function l(a,b){var c=parseInt(a);if(a!=c)throw new Error("invalid "+b);return c}function m(a,b,c,d,g,h,m){if(!m)throw new Error("missing callback");if(c=l(c,"N"),d=l(d,"r"),g=l(g,"p"),h=l(h,"dkLen"),0===c||0!==(c&c-1))throw new Error("N must be power of 2");if(c>n/128/d)throw new Error("N too large");if(d>n/128/g)throw new Error("r too large");if(!k(a))throw new Error("password must be an array or buffer");if(!k(b))throw new Error("salt must be an array or buffer");for(var o=e(a,b,128*g*d),p=new Uint32Array(32*g*d),q=0;qF&&(b=F);for(var k=0;kF&&(b=F);for(var k=0;k>0&255),o.push(p[k]>>8&255),o.push(p[k]>>16&255),o.push(p[k]>>24&255);var r=e(a,o,h);return m(null,1,r)}G(H)};H()}var n=2147483647;"undefined"!=typeof c?b.exports=m:"function"==typeof define&&define.amd?define(m):a&&(a.scrypt&&(a._scrypt=a.scrypt),a.scrypt=m)}(this)},{}],74:[function(a,b,c){(function(a,b){!function(b,c){"use strict";function d(a){return p[o]=e.apply(c,a),o++}function e(a){var b=[].slice.call(arguments,1);return function(){"function"==typeof a?a.apply(c,b):new Function(""+a)()}}function f(a){if(q)setTimeout(e(f,a),0);else{var b=p[a];if(b){q=!0;try{b()}finally{g(a),q=!1}}}}function g(a){delete p[a]}function h(){n=function(){var b=d(arguments);return a.nextTick(e(f,b)),b}}function i(){if(b.postMessage&&!b.importScripts){var a=!0,c=b.onmessage;return b.onmessage=function(){a=!1},b.postMessage("","*"),b.onmessage=c,a}}function j(){var a="setImmediate$"+Math.random()+"$",c=function(c){c.source===b&&"string"==typeof c.data&&0===c.data.indexOf(a)&&f(+c.data.slice(a.length))};b.addEventListener?b.addEventListener("message",c,!1):b.attachEvent("onmessage",c),n=function(){var c=d(arguments);return b.postMessage(a+c,"*"),c}}function k(){var a=new MessageChannel;a.port1.onmessage=function(a){var b=a.data;f(b)},n=function(){var b=d(arguments);return a.port2.postMessage(b),b}}function l(){var a=r.documentElement;n=function(){var b=d(arguments),c=r.createElement("script");return c.onreadystatechange=function(){f(b),c.onreadystatechange=null,a.removeChild(c),c=null},a.appendChild(c),b}}function m(){n=function(){var a=d(arguments);return setTimeout(e(f,a),0),a}}if(!b.setImmediate){var n,o=1,p={},q=!1,r=b.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(b);s=s&&s.setTimeout?s:b,"[object process]"==={}.toString.call(b.process)?h():i()?j():b.MessageChannel?k():r&&"onreadystatechange"in r.createElement("script")?l():m(),s.setImmediate=n,s.clearImmediate=g}}("undefined"==typeof self?"undefined"==typeof b?this:b:self)}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:72}],75:[function(a,b,c){(function(a){var c;if(a.crypto&&crypto.getRandomValues){var d=new Uint8Array(16);c=function(){return crypto.getRandomValues(d),d}}if(!c){var e=new Array(16);c=function(){for(var a,b=0;b<16;b++)0===(3&b)&&(a=4294967296*Math.random()),e[b]=a>>>((3&b)<<3)&255;return e}}b.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],76:[function(a,b,c){function d(a,b,c){var d=b&&c||0,e=0;for(b=b||[],a.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){e<16&&(b[d+e++]=j[a])});e<16;)b[d+e++]=0;return b}function e(a,b){var c=b||0,d=i;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function f(a,b,c){var d=b&&c||0,f=b||[];a=a||{};var g=void 0!==a.clockseq?a.clockseq:n,h=void 0!==a.msecs?a.msecs:(new Date).getTime(),i=void 0!==a.nsecs?a.nsecs:p+1,j=h-o+(i-p)/1e4;if(j<0&&void 0===a.clockseq&&(g=g+1&16383),(j<0||h>o)&&void 0===a.nsecs&&(i=0),i>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=h,p=i,n=g,h+=122192928e5;var k=(1e4*(268435455&h)+i)%4294967296;f[d++]=k>>>24&255,f[d++]=k>>>16&255,f[d++]=k>>>8&255,f[d++]=255&k;var l=h/4294967296*1e4&268435455;f[d++]=l>>>8&255,f[d++]=255&l,f[d++]=l>>>24&15|16,f[d++]=l>>>16&255,f[d++]=g>>>8|128,f[d++]=255&g;for(var q=a.node||m,r=0;r<6;r++)f[d+r]=q[r];return b?b:e(f)}function g(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"==a?new Array(16):null,a=null),a=a||{};var f=a.random||(a.rng||h)();if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b)for(var g=0;g<16;g++)b[d+g]=f[g];return b||e(f)}for(var h=a("./rng"),i=[],j={},k=0;k<256;k++)i[k]=(k+256).toString(16).substr(1),j[i[k]]=k;var l=h(),m=[1|l[0],l[1],l[2],l[3],l[4],l[5]],n=16383&(l[6]<<8|l[7]),o=0,p=0,q=g;q.v1=f,q.v4=g,q.parse=d,q.unparse=e,b.exports=q},{"./rng":75}]},{},[1]); \ No newline at end of file diff --git a/package.json b/package.json index 5c577a883..1824bfae2 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "ethers-contracts": "^2.1.5", - "ethers-providers": "^2.1.9", + "ethers-providers": "^2.1.11", "ethers-utils": "^2.1.6", "ethers-wallet": "^2.1.4" },