if(!(thisinstanceofD))throwError("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:f(a,!0)}),this._prepare()};D.prototype._prepare=function(){vara=n[this.key.length];if(null==a)thrownewError("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(varb=0;b<=a;b++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(varc,d=4*(a+1),e=this.key.length/4,f=i(this.key),b=0;b<e;b++)c=b>>2,this._Ke[c][b%4]=f[b],this._Kd[a-c][b%4]=f[b];for(varg,h=0,j=e;j<d;){if(g=f[e-1],f[0]^=p[g>>16&255]<<24^p[g>>8&255]<<16^p[255&g]<<8^p[g>>24&255]^o[h]<<24,h+=1,8!=e)for(varb=1;b<e;b++)f[b]^=f[b-1];else{for(varb=1;b<e/2;b++)f[b]^=f[b-1];g=f[e/2-1],f[e/2]^=p[255&g]^p[g>>8&255]<<8^p[g>>16&255]<<16^p[g>>24&255]<<24;for(varb=e/2+1;b<e;b++)f[b]^=f[b-1]}for(vark,l,b=0;b<e&&j<d;)k=j>>2,l=j%4,this._Ke[k][l]=f[b],this._Kd[a-k][l]=f[b++],j++}for(vark=1;k<a;k++)for(varl=0;l<4;l++)g=this._Kd[k][l],this._Kd[k][l]=z[g>>24&255]^A[g>>16&255]^B[g>>8&255]^C[255&g]},D.prototype.encrypt=function(a){if(16!=a.length)thrownewError("invalid plaintext size (must be 16 bytes)");for(varb=this._Ke.length-1,c=[0,0,0,0],d=i(a),e=0;e<4;e++)d[e]^=this._Ke[0][e];for(varf=1;f<b;f++){for(vare=0;e<4;e++)c[e]=r[d[e]>>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(varh,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);returnj},D.prototype.decrypt=function(a){if(16!=a.length)thrownewError("invalid ciphertext size (must be 16 bytes)");for(varb=this._Kd.length-1,c=[0,0,0,0],d=i(a),e=0;e<4;e++)d[e]^=this._Kd[0][e];for(varf=1;f<b;f++){for(vare=0;e<4;e++)c[e]=v[d[e]>>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(varh,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);returnj};varE=function(a){if(!(thisinstanceofE))throwError("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=newD(a)};E.prototype.encrypt=function(a){if(a=f(a),a.length%16!==0)thrownewError("invalid plaintext size (must be multiple of 16 bytes)");for(varb=g(a.length),c=g(16),d=0;d<a.length;d+=16)h(a,c,0,d,d+16),c=this._aes.encrypt(c),h(c,b,d);returnb},E.prototype.decrypt=function(a){if(a=f(a),a.length%16!==0)thrownewError("invalid ciphertext size (must be multiple of 16 bytes)");for(varb=g(a.length),c=g(16),d=0;d<a.length;d+=16)h(a,c,0,d,d+16),c=this._aes.decrypt(c),h(c,b,d);returnb};varF=function(a,b){if(!(thisinstanceofF))throwError("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",b){if(16!=b.length)thrownewError("invalid initialation vector size (must be 16 bytes)")}elseb=g(16);this._lastCipherblock=f(b,!0),this._aes=newD(a)};F.prototype.encrypt=function(a){if(a=f(a),a.length%16!==0)thrownewError("invalid plaintext size (must be multiple of 16 bytes)");for(varb=g(a.length),c=g(16),d=0;d<a.length;d+=16){h(a,c,0,d,d+16);for(vare=0;e<16;e++)c[e]^=this._lastCipherblock[e];this._lastCipherblock=this._aes.encrypt(c),h(this._lastCipherblock,b,d)}returnb},F.prototype.decrypt=function(a){if(a=f(a),a.length%16!==0)thrownewError("invalid ciphertext size (must be multiple of 16 bytes)");for(varb=g(a.length),c=g(16),d=0;d<a.length;d+=16){h(a,c,0,d,d+16),c=this._aes.decrypt(c);for(vare=0;e<16;e++)b[d+e]=c[e]^this._lastCipherblock[e];h(a,this._lastCipherblock,0,d,d+16)}returnb};varG=function(a,b,c){if(!(thisinstanceofG))throwError("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",b){if(16!=b.length)thrownewError("invalid initialation vector size (must be 16 size)")}elseb=g(16);c||(c=1),this.segmentSize=c,this._shiftRegister=f(b,!0),this._aes=newD(a)};G.prototype.encrypt=function(a){if(a.length%
c[2*g]=8191&f,f>>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g<e;++g)c[g]=0;d(0===f),d(0===(f&-8192))},m.prototype.stub=function(a){for(varb=newArray(a),c=0;c<a;c++)b[c]=0;returnb},m.prototype.mulp=function(a,b,c){vard=2*this.guessLen13b(a.length,b.length),e=this.makeRBT(d),f=this.stub(d),g=newArray(d),h=newArray(d),i=newArray(d),j=newArray(d),k=newArray(d),l=newArray(d),m=c.words;m.length=d,this.convert13b(a.words,a.length,g,d),this.convert13b(b.words,b.length,j,d),this.transform(g,f,h,i,d,e),this.transform(j,f,k,l,d,e);for(varn=0;n<d;n++){varo=h[n]*k[n]-i[n]*l[n];i[n]=h[n]*l[n]+i[n]*k[n],h[n]=o}returnthis.conjugate(h,i,d),this.transform(h,i,m,f,d,e),this.conjugate(m,f,d),this.normalize13b(m,d),c.negative=a.negative^b.negative,c.length=a.length+b.length,c.strip()},f.prototype.mul=function(a){varb=newf(null);returnb.words=newArray(this.length+a.length),this.mulTo(a,b)},f.prototype.mulf=function(a){varb=newf(null);returnb.words=newArray(this.length+a.length),l(this,a,b)},f.prototype.imul=function(a){returnthis.clone().mulTo(a,this)},f.prototype.imuln=function(a){d("number"==typeofa),d(a<67108864);for(varb=0,c=0;c<this.length;c++){vare=(0|this.words[c])*a,f=(67108863&e)+(67108863&b);b>>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){returnthis.clone().imuln(a)},f.prototype.sqr=function(){returnthis.mul(this)},f.prototype.isqr=function(){returnthis.imul(this.clone())},f.prototype.pow=function(a){varb=i(a);if(0===b.length)returnnewf(1);for(varc=this,d=0;d<b.length&&0===b[d];d++,c=c.sqr());if(++d<b.length)for(vare=c.sqr();d<b.length;d++,e=e.sqr())0!==b[d]&&(c=c.mul(e));returnc},f.prototype.iushln=function(a){d("number"==typeofa&&a>=0);varb,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){varg=0;for(b=0;b<this.length;b++){varh=this.words[b]&f,i=(0|this.words[b])-h<<c;this.words[b]=i|g,g=h>>>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<e;b++)this.words[b]=0;this.length+=e}returnthis.strip()},f.prototype.ishln=function(a){returnd(0===this.negative),this.iushln(a)},f.prototype.iushrn=function(a,b,c){d("number"==typeofa&&a>=0);vare;e=b?(b-b%26)/26:0;varf=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<<f,i=c;if(e-=g,e=Math.max(0,e),i){for(varj=0;j<g;j++)i.words[j]=this.words[j];i.length=g}if(0===g);elseif(this.length>g)for(this.length-=g,j=0;j<this.length;j++)this.words[j]=this.words[j+g];elsethis.words[0]=0,this.length=1;vark=0;for(j=this.length-1;j>=0&&(0!==k||j>=e);j--){varl=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}returni&&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){returnd(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){returnthis.clone().ishln(a)},f.prototype.ushln=function(a){returnthis.clone().iushln(a)},f.prototype.shrn=function(a){returnthis.clone().ishrn(a)},f.prototype.ushrn=function(a){returnthis.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeofa&&a>=0);varb=a%26,c=(a-b)/26,e=1<<b;if(this.length<=c)return!1;varf=this.words[c];return!!(f&e)},f.prototype.imaskn=function(a){d("number"==typeofa&&a>=0);varb=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)returnthis;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){vare=67108863^67108863>>>b<<b;this.words[this.length-1]&=e}returnthis.strip()},f.prototype.maskn=function(a){returnthis.clone().imaskn(a)},f.prototype.iaddn=function(a){returnd("number"==typeofa),d(a<67108864),a<0?this.isubn(-a):0!==this.negative?1===this.length&&(0|this.words[0])<a?(this.words[0]=a-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},f.prototype._iaddn=function(a){this.words[0]+=a;for(varb=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;returnthi
},decode:function(a,b){if(b>a.length)thrownewError("invalid null");return{consumed:0,value:void0}},dynamic:!1},C=g(32,!1),D=function(a){return{localName:a,name:"boolean",type:"boolean",encode:function(a){returnC.encode(a?1:0)},decode:function(a,b){varc=C.decode(a,b);return{consumed:c.consumed,value:!c.value.isZero()}}}},E=function(a){return{localName:a,name:"address",type:"address",encode:function(a){a=A.arrayify(A.getAddress(a));varb=newUint8Array(32);returnb.set(a,12),b},decode:function(a,b){returna.length<b+32&&z("invalid address"),{consumed:32,value:A.getAddress(A.hexlify(a.slice(b+12,b+32)))}}}},F=function(a){return{localName:a,name:"bytes",type:"bytes",encode:function(a){returni(A.arrayify(a))},decode:function(a,b){varc=j(a,b);returnc.value=A.hexlify(c.value),c},dynamic:!0}},G=function(a){return{localName:a,name:"string",type:"string",encode:function(a){returni(A.toUtf8Bytes(a))},decode:function(a,b){varc=j(a,b);returnc.value=A.toUtf8String(c.value),c},dynamic:!0}},H=newRegExp(/^bytes([0-9]*)$/),I=newRegExp(/^(u?int)([0-9]*)$/),J=newRegExp(/^(.*)\[([0-9]*)\]$/),K={address:E,bool:D,string:G,bytes:F};A.defineProperty(s.prototype,"type","call"),A.defineProperty(t.prototype,"type","deploy"),A.defineProperty(u.prototype,"type","transaction"),A.defineProperty(v.prototype,"type","event"),A.defineProperty(x,"encodeParams",function(a,b,c){arguments.length<3&&(c=b,b=a,a=null),b.length!==c.length&&z("types/values mismatch",{types:b,values:c});vard=[];returnb.forEach(function(b,c){d.push(q(b,a?a[c]:void0))}),A.hexlify(o(d).encode(c))}),A.defineProperty(x,"decodeParams",function(a,b,c){arguments.length<3&&(c=b,b=a,a=null),c=A.arrayify(c);vard=[];b.forEach(function(b,c){d.push(q(b,a?a[c]:void0))});newy;returno(d).decode(c,0).value}),b.exports=x},{"ethers-utils/address":34,"ethers-utils/bignumber.js":35,"ethers-utils/convert.js":38,"ethers-utils/keccak256.js":42,"ethers-utils/properties.js":45,"ethers-utils/throw-error":50,"ethers-utils/utf8.js":52}],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";functiond(a){for(;a.length>3&&"0x0"===a.substring(0,3);)a="0x"+a.substring(3);returna}functione(a){varb=[];for(varcina)if(null!=a[c]){vare=k.hexlify(a[c]);({gasLimit:!0,gasPrice:!0,nonce:!0,value:!0})[c]&&(e=d(e)),b.push(c+"="+e)}returnb.join("&")}functionf(a,b){j.call(this,a);varc=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:thrownewError("unsupported network")}k.defineProperty(this,"baseUrl",c),k.defineProperty(this,"apiKey",b||null)}functiong(a){if(0==a.status&&"No records found"===a.message)returna.result;if(1!=a.status||"OK"!=a.message){varb=newError("invalid response");throwb.result=JSON.stringify(a),b}returna.result}functionh(a){if("2.0"!=a.jsonrpc){varb=newError("invalid response");throwb.result=JSON.stringify(a),b}if(a.error){varb=newError(a.error.message||"unknown error");throwa.error.code&&(b.code=a.error.code),a.error.data&&(b.data=a.error.data),b}returna.result}functioni(a){if("pending"===a)thrownewError("pending not supported");return"latest"===a?a:parseInt(a.substring(2),16)}varj=a("./provider.js"),k=function(){varb=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={});varc=this.baseUrl,f="";switch(this.apiKey&&(f+="&apikey="+this.apiKey),a){case"getBlockNumber":returnc+="/api?module=proxy&action=eth_blockNumber"+f,j.fetchJSON(c,null,h);case"getGasPrice":returnc+="/api?module=proxy&action=eth_gasPrice"+f,j.fetchJSON(c,null,h);case"getBalance":returnc+="/api?module=accou