!functiona(b,c,d){functione(g,h){if(!c[g]){if(!b[g]){vari="function"==typeofrequire&&require;if(!h&&i)returni(g,!0);if(f)returnf(g,!0);varj=newError("Cannot find module '"+g+"'");throwj.code="MODULE_NOT_FOUND",j}vark=c[g]={exports:{}};b[g][0].call(k.exports,function(a){varc=b[g][1][a];returne(c?c:a)},k,k.exports,a,b,c,d)}returnc[g].exports}for(varf="function"==typeofrequire&&require,g=0;g<d.length;g++)e(d[g]);returne}({1:[function(a,b,c){b.exports=void0},{}],2:[function(a,b,c){"use strict";try{b.exports.XMLHttpRequest=XMLHttpRequest}catch(d){console.log("Warning: XMLHttpRequest is not defined"),b.exports.XMLHttpRequest=null}},{}],3:[function(a,b,c){"use strict";functiond(a){varb=[];for(varcina)null!=a[c]&&b.push(c+"="+j.hexlify(a[c]));returnb.join("&")}functione(a,b){i.call(this,a),j.defineProperty(this,"apiKey",b||null)}functionf(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}functiong(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}functionh(a){if("pending"===a)thrownewError("pending not supported");return"latest"===a?a:parseInt(a.substring(2),16)}vari=a("./provider.js"),j=function(){varb=a("ethers-utils/convert.js");return{defineProperty:a("ethers-utils/properties.js").defineProperty,hexlify:b.hexlify}}();i.inherits(e),j.defineProperty(e.prototype,"_call",function(){}),j.defineProperty(e.prototype,"_callProxy",function(){}),j.defineProperty(e.prototype,"perform",function(a,b){b||(b={});varc=this.testnet?"https://testnet.etherscan.io":"https://api.etherscan.io",e="";switch(this.apiKey&&(e+="&apikey="+this.apiKey),a){case"getBlockNumber":returnc+="/api?module=proxy&action=eth_blockNumber"+e,i.fetchJSON(c,null,g);case"getGasPrice":returnc+="/api?module=proxy&action=eth_gasPrice"+e,i.fetchJSON(c,null,g);case"getBalance":returnc+="/api?module=account&action=balance&address="+b.address,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,f);case"getTransactionCount":returnc+="/api?module=proxy&action=eth_getTransactionCount&address="+b.address,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,g);case"getCode":returnc+="/api?module=proxy&action=eth_getCode&address="+b.address,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,g);case"getStorageAt":returnc+="/api?module=proxy&action=eth_getStorageAt&address="+b.address,c+="&position="+b.position,c+="&tag="+b.blockTag+e,i.fetchJSON(c,null,g);case"sendTransaction":returnc+="/api?module=proxy&action=eth_sendRawTransaction&hex="+b.signedTransaction,c+=e,i.fetchJSON(c,null,g);case"getBlock":if(b.blockTag)returnc+="/api?module=proxy&action=eth_getBlockByNumber&tag="+b.blockTag,c+="&boolean=false",c+=e,i.fetchJSON(c,null,g);thrownewError("getBlock by blockHash not implmeneted");case"getTransaction":returnc+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+b.transactionHash,c+=e,i.fetchJSON(c,null,g);case"getTransactionReceipt":returnc+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+b.transactionHash,c+=e,i.fetchJSON(c,null,g);case"call":varj=d(b.transaction);returnj&&(j="&"+j),c+="/api?module=proxy&action=eth_call"+j,c+=e,i.fetchJSON(c,null,g);case"estimateGas":varj=d(b.transaction);returnj&&(j="&"+j),c+="/api?module=proxy&action=eth_estimateGas&"+j,c+=e,i.fetchJSON(c,null,g);case"getLogs":c+="/api?module=logs&action=getLogs";try{if(b.filter.fromBlock&&(c+="&fromBlock="+h(b.filter.fromBlock)),b.filter.toBlock&&(c+="&toBlock="+h(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)thrownewError("unsupported topic format");vark=b.filter.topics[0];if("string"!=typeofk||66!==k.length)thrownewError("unsupported topic0 format");c+="&topic0="+k}}catch(l){returnPromise.reject(l)}returnc+=e,i.fetchJSON(c,null,f
f.prototype.toString=function(a,b){a=a||10,b=0|b||1;varc;if(16===a||"hex"===a){c="";for(vare=0,f=0,g=0;g<this.length;g++){varh=this.words[g],i=(16777215&(h<<e|f)).toString(16);f=h>>>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;return0!==this.negative&&(c="-"+c),c}if(a===(0|a)&&a>=2&&a<=36){varj=x[a],k=y[a];c="";varl=this.clone();for(l.negative=0;!l.isZero();){varm=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;return0!==this.negative&&(c="-"+c),c}d(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){vara=this.words[0];return2===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(){returnthis.toString(16)},f.prototype.toBuffer=function(a,b){returnd("undefined"!=typeofu),this.toArrayLike(u,a,b)},f.prototype.toArray=function(a,b){returnthis.toArrayLike(Array,a,b)},f.prototype.toArrayLike=function(a,b,c){vare=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();varg,h,i="le"===b,j=newa(f),k=this.clone();if(i){for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[h]=g;for(;h<f;h++)j[h]=0}else{for(h=0;h<f-e;h++)j[h]=0;for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[f-h-1]=g}returnj},Math.clz32?f.prototype._countBits=function(a){return32-Math.clz32(a)}:f.prototype._countBits=function(a){varb=a,c=0;returnb>=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)return26;varb=a,c=0;return0===(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(){vara=this.words[this.length-1],b=this._countBits(a);return26*(this.length-1)+b},f.prototype.zeroBits=function(){if(this.isZero())return0;for(vara=0,b=0;b<this.length;b++){varc=this._zeroBits(this.words[b]);if(a+=c,26!==c)break}returna},f.prototype.byteLength=function(){returnMath.ceil(this.bitLength()/8)},f.prototype.toTwos=function(a){return0!==this.negative?this.abs().inotn(a).iaddn(1):this.clone()},f.prototype.fromTwos=function(a){returnthis.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return0!==this.negative},f.prototype.neg=function(){returnthis.clone().ineg()},f.prototype.ineg=function(){returnthis.isZero()||(this.negative^=1),this},f.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(varb=0;b<a.length;b++)this.words[b]=this.words[b]|a.words[b];returnthis.strip()},f.prototype.ior=function(a){returnd(0===(this.negative|a.negative)),this.iuor(a)},f.prototype.or=function(a){returnthis.length>a.length?this.clone().ior(a):a.clone().ior(this)},f.prototype.uor=function(a){returnthis.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},f.prototype.iuand=function(a){varb;b=this.length>a.length?a:this;for(varc=0;c<b.length;c++)this.words[c]=this.words[c]&a.words[c];returnthis.length=b.length,this.strip()},f.prototype.iand=function(a){returnd(0===(this.negative|a.negative)),this.iuand(a)},f.prototype.and=function(a){returnthis.length>a.length?this.clone().iand(a):a.clone().iand(this)},f.prototype.uand=function(a){returnthis.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},f.prototype.iuxor=function(a){varb,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(vard=0;d<c.length;d++)this.words[d]=b.words[d]^c.words[d];if(this!==b)for(;d<b.length;d++)this.words[d]=b.words[d];returnthis.length=b.length,this.strip()},f.prototype.ixor=function(a){returnd(0===(this.negative|a.negative)),this.iuxor(a)},f.prototype.xor=function(a){returnthis.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},f.prototype.uxor=function(a){returnth
void(a.length=1);varf=a.words[9];for(b.words[b.length++]=f&c,e=10;e<a.length;e++){varg=0|a.words[e];a.words[e-10]=(g&c)<<4|f>>>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(varb=0,c=0;c<a.length;c++){vard=0|a.words[c];b+=977*d,a.words[c]=67108863&b,b=64*d+(b/67108864|0)}return0===a.words[a.length-1]&&(a.length--,0===a.words[a.length-1]&&a.length--),a},e(p,n),e(q,n),e(r,n),r.prototype.imulK=function(a){for(varb=0,c=0;c<a.length;c++){vard=19*(0|a.words[c])+b,e=67108863&d;d>>>=26,a.words[c]=e,b=d}return0!==b&&(a.words[a.length++]=b),a},f._prime=functionB(a){if(A[a])returnA[a];varB;if("k256"===a)B=newo;elseif("p224"===a)B=newp;elseif("p192"===a)B=newq;else{if("p25519"!==a)thrownewError("Unknown prime "+a);B=newr}returnA[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){returnthis.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){returna.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);varc=a.add(b);returnc.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);varc=a.iadd(b);returnc.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);varc=a.sub(b);returnc.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);varc=a.isub(b);returnc.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){returnthis._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){returnthis._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){returnthis._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){returnthis.imul(a,a.clone())},s.prototype.sqr=function(a){returnthis.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())returna.clone();varb=this.m.andln(3);if(d(b%2===1),3===b){varc=this.m.add(newf(1)).iushrn(2);returnthis.pow(a,c)}for(vare=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());varh=newf(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=newf(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(varl=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(varp=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q<o);varr=this.pow(l,newf(1).iushln(o-q-1));m=m.redMul(r),l=r.redSqr(),n=n.redMul(l),o=q}returnm},s.prototype.invm=function(a){varb=a._invmp(this.m);return0!==b.negative?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},s.prototype.pow=function(a,b){if(b.isZero())returnnewf(1);if(0===b.cmpn(1))returna.clone();varc=4,d=newArray(1<<c);d[0]=newf(1).toRed(this),d[1]=a;for(vare=2;e<d.length;e++)d[e]=this.mul(d[e-1],a);varg=d[0],h=0,i=0,j=b.bitLength()%26;for(0===j&&(j=26),e=b.length-1;e>=0;e--){for(vark=b.words[e],l=j-1;l>=0;l--){varm=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}returng},s.prototype.convertTo=function(a){varb=a.umod(this.m);returnb===a?b.clone():b},s.prototype.convertFrom=function(a){varb=a.clone();returnb.red=null,b},f.mont=function(a){returnnewt(a)},e(t,s),t.prototype.convertTo=function(a){returnthis.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){varb=this.imod(a.mul(this.rinv));returnb.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())returna.words[0]=0,a.length=1,a;varc=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;returne.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