2020-10-05 23:49:47 +03:00
|
|
|
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).ethers={})}(this,(function(e){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e,r){return e(r={exports:{}},r.exports),r.exports}function o(e){return e&&e.default||e}var i=Object.freeze({default:{}}),a=o(i),s=n((function(e){!function(e,r){function t(e,r){if(!e)throw new Error(r||"Assertion failed")}function n(e,r){e.super_=r;var t=function(){};t.prototype=r.prototype,e.prototype=new t,e.prototype.constructor=e}function o(e,r,t){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==r&&"be"!==r||(t=r,r=10),this._init(e||0,r||10,t||"be"))}var i;"object"==typeof e?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{i=a.Buffer}catch(e){}function s(e,r,t){for(var n=0,o=Math.min(e.length,t),i=r;i<o;i++){var a=e.charCodeAt(i)-48;n<<=4,n|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(e,r,t,n){for(var o=0,i=Math.min(e.length,t),a=r;a<i;a++){var s=e.charCodeAt(a)-48;o*=n,o+=s>=49?s-49+10:s>=17?s-17+10:s}return o}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,r){return e.cmp(r)>0?e:r},o.min=function(e,r){return e.cmp(r)<0?e:r},o.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"==typeof e)return this._initArray(e,r,n);"hex"===r&&(r=16),t(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&o++,16===r?this._parseHex(e,o):this._parseBase(e,r,o),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initNumber=function(e,r,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(t(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initArray=function(e,r,n){if(t("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},o.prototype._parseHex=function(e,r){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var t=0;t<this.length;t++)this.words[t]=0;var n,o,i=0;for(t=e.length-6,n=0;t>=r;t-=6)o=s(e,t,t+6),this.words[n]|=o<<i&67108863,this.words[n+1]|=o>>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);t+6!==r&&(o=s(e,r,t+6),this.words[n]|=o<<i&67108863,this.words[n+1]|=o>>>26-i&4194303),this.strip()},o.prototype._parseBase=function(e,r,t){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=r)n++;n--,o=o/r|0;for(var i=e.length-t,a=i%n,s=Math.min(i,i-a)+t,l=0,c=t;c<s;c+=n)l=u(e,c,c+n,r),this.imuln(o),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var f=1;for(l=u(e,c,e.length,r),c=0;c<a;c++)f*=r;this.imuln(f),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}},o.prototype.copy=function(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.l
|
2020-10-07 07:25:28 +03:00
|
|
|
!function(){var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,o="0123456789abcdef".split(""),i=[0,8,16,24],a=[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],s=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],l=function(e,r,t){return function(n){return new A(e,r,e).update(n)[t]()}},c=function(e,r,t){return function(n,o){return new A(e,r,o).update(n)[t]()}},f=function(e,r){var t=l(e,r,"hex");t.create=function(){return new A(e,r,e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<u.length;++n){var o=u[n];t[o]=l(e,r,o)}return t},h=[{name:"keccak",padding:[1,256,65536,16777216],bits:s,createMethod:f},{name:"sha3",padding:[6,1536,393216,100663296],bits:s,createMethod:f},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(e,r){var t=c(e,r,"hex");t.create=function(t){return new A(e,r,t)},t.update=function(e,r){return t.create(r).update(e)};for(var n=0;n<u.length;++n){var o=u[n];t[o]=c(e,r,o)}return t}}],d={},p=[],g=0;g<h.length;++g)for(var v=h[g],m=v.bits,y=0;y<m.length;++y){var b=v.name+"_"+m[y];p.push(b),d[b]=v.createMethod(m[y],v.padding)}function A(e,r,t){this.blocks=[],this.s=[],this.padding=r,this.outputBits=t,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=t>>5,this.extraBytes=(31&t)>>3;for(var n=0;n<50;++n)this.s[n]=0}A.prototype.update=function(e){var r="string"!=typeof e;r&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var t,n,o=e.length,a=this.blocks,s=this.byteCount,u=this.blockCount,l=0,c=this.s;l<o;){if(this.reset)for(this.reset=!1,a[0]=this.block,t=1;t<u+1;++t)a[t]=0;if(r)for(t=this.start;l<o&&t<s;++l)a[t>>2]|=e[l]<<i[3&t++];else for(t=this.start;l<o&&t<s;++l)(n=e.charCodeAt(l))<128?a[t>>2]|=n<<i[3&t++]:n<2048?(a[t>>2]|=(192|n>>6)<<i[3&t++],a[t>>2]|=(128|63&n)<<i[3&t++]):n<55296||n>=57344?(a[t>>2]|=(224|n>>12)<<i[3&t++],a[t>>2]|=(128|n>>6&63)<<i[3&t++],a[t>>2]|=(128|63&n)<<i[3&t++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++l)),a[t>>2]|=(240|n>>18)<<i[3&t++],a[t>>2]|=(128|n>>12&63)<<i[3&t++],a[t>>2]|=(128|n>>6&63)<<i[3&t++],a[t>>2]|=(128|63&n)<<i[3&t++]);if(this.lastByteIndex=t,t>=s){for(this.start=t-s,this.block=a[u],t=0;t<u;++t)c[t]^=a[t];S(c),this.reset=!0}else this.start=t}return this},A.prototype.finalize=function(){var e=this.blocks,r=this.lastByteIndex,t=this.blockCount,n=this.s;if(e[r>>2]|=this.padding[3&r],this.lastByteIndex===this.byteCount)for(e[0]=e[t],r=1;r<t+1;++r)e[r]=0;for(e[t-1]|=2147483648,r=0;r<t;++r)n[r]^=e[r];S(n)},A.prototype.toString=A.prototype.hex=function(){this.finalize();for(var e,r=this.blockCount,t=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,s=0,u="";s<n;){for(a=0;a<r&&s<n;++a,++s)e=t[a],u+=o[e>>4&15]+o[15&e]+o[e>>12&15]+o[e>>8&15]+o[e>>20&15]+o[e>>16&15]+o[e>>28&15]+o[e>>24&15];s%r==0&&(S(t),a=0)}return i&&(e=t[a],i>0&&(u+=o[e>>4&15]+o[15&e]),i>1&&(u+=o[e>>12&15]+o[e>>8&15]),i>2&&(u+=o[e>>20&15]+o[e>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var e,r=this.blockCount,t=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,s=this.outputBits>>3;e=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a<n;){for(i=0;i<r&&a<n;++i,++a)u[a]=t[i];a%r==0&&S(t)}return o&&(u[i]=t[i],e=e.slice(0,s)),e},A.prototype.buffer=A.prototype.arrayBuffer,A.prototype.digest=A.prototype.array=function(){this.finalize();for(var e,r,t=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,a=0,s=0,u=[];s<o;){for(a=0;a<t&&s<o;++a,++s)e=s<<2,r=n[a],u[e]=255&r,u[e+1]=r>>8&255,u[e+2]=r>>16&255,u[e+3]=r>>24&255;s%t==0&&S(n)}return i&&(e=s<<2,r=n[a],i>0&&(u[e]=255&r),i>1&&(u[e+1]=r>>8&255),i>2&&(u[e
|