!function(e){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=e();elseif("function"==typeofdefine&&define.amd)define([],e);else{("undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:this).ethers=e()}}(function(){returnfunctiono(s,a,u){functionl(t,e){if(!a[t]){if(!s[t]){varr="function"==typeofrequire&&require;if(!e&&r)returnr(t,!0);if(f)returnf(t,!0);varn=newError("Cannot find module '"+t+"'");thrown.code="MODULE_NOT_FOUND",n}vari=a[t]={exports:{}};s[t][0].call(i.exports,function(e){returnl(s[t][1][e]||e)},i,i.exports,o,s,a,u)}returna[t].exports}for(varf="function"==typeofrequire&&require,e=0;e<u.length;e++)l(u[e]);returnl}({1:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.version="4.0.0-beta.14"},{}],2:[function(e,t,r){"use strict";varn,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,t){e.__proto__=t}||function(e,t){for(varrint)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){functionr(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,newr)}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(varrine)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);returnt.default=e,t};Object.defineProperty(r,"__esModule",{value:!0});vara=e("./interface"),u=e("../utils/abi-coder"),l=e("../utils/address"),f=e("../utils/bignumber"),h=e("../utils/bytes"),c=e("../utils/constants"),d=e("../utils/properties"),p=o(e("../utils/errors")),v=e("../providers/abstract-provider"),y=e("../wallet/abstract-signer"),m=function(n){functiont(e,t){varr=n.call(this)||this;returnd.defineReadOnly(r,"address",e),d.defineReadOnly(r,"provider",t),r}returni(t,n),t.prototype.getAddress=function(){returnPromise.resolve(this.address)},t.prototype._fail=function(e,t){returnPromise.resolve().then(function(){p.throwError(e,p.UNSUPPORTED_OPERATION,{operation:t})})},t.prototype.signMessage=function(e){returnthis._fail("VoidSigner cannot sign messages","signMessage")},t.prototype.sendTransaction=function(e){returnthis._fail("VoidSigner cannot sign transactions","sendTransaction")},t.prototype.connect=function(e){returnnewt(this.address,e)},t}(y.Signer);r.VoidSigner=m;varg={data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};functionb(o,e,s){vara=o.interface.functions[e];returnfunction(){for(vare=[],t=0;t<arguments.length;t++)e[t]=arguments[t];vari={};if(e.length===a.inputs.length+1&&"object"==typeofe[e.length-1])for(varrini=d.shallowCopy(e.pop()))if(!g[r])thrownewError("unknown transaction override "+r);if(e.length!=a.inputs.length)thrownewError("incorrect number of arguments");return["data","to"].forEach(function(e){null!=i[e]&&p.throwError("cannot override "+e,p.UNSUPPORTED_OPERATION,{operation:e})}),i.to=o.deployed().then(function(){returno.addressPromise}),functionn(i,o,e){if(Array.isArray(e)){vars=[];returne.forEach(function(e,t){varr=null;r=Array.isArray(o)?o[t]:o[e.name],s.push(n(i,r,e))}),Promise.all(s)}if("address"===e.type)returni.resolveName(o);if("tuple"===e.type)returnn(i,o,e.components);vart=e.type.match(/(.*)(\[[0-9]*\]$)/);if(t){if(!Array.isArray(o))thrownewError("invalid value for array");s=[];varr={components:e.components,type:t[1]};returno.forEach(function(e){s.push(n(i,e,r))}),Promise.all(s)}returnPromise.resolve(o)}(o.provider,e,a.inputs).then(function(n){if(i.data=a.encode(n),"call"===a.type)returns?Promise.resolve(c.Zero):(o.provider||p.throwError("call (constant functions) require a provider or a signer with a provider",p.UNSUPPORTED_OPERATION,{operation:"call"}),["gasLimit","gasPrice","value"].forEach(function(e){if(null!=i[e])thrownewError("call cannot override "+e)}),null==i.from&&o.signer&&(i.from=o.signer.getAddress()),o.provider.call(i).then(function(t){if(h.hexDataLength(t)%32==4&&"0x08c379a0"===h.hexDataSlice(t,0,4)){vare=u.defaultAbiCoder.decode(["string"],h.hexDataSlice(t,4));p.throwError("call revert exception",p.CALL_EXCEPTION,{address:o.