unlock-js/src/unlockService.js
/**
   * @param {string} address contract address
   * @param {string} versionRetrievalMethodName the method to call to retrieve the contract version
   */
@param {string} address contract address
@param {string} versionRetrievalMethodName the method to call to retrieve the contract version
@param { string } address contract address @param { string } versionRetrievalMethodName the method to call to retrieve the contract version
async contractAbiVersion(address, versionRetrievalMethodName) {
    if (!this.provider) {
      throw new Error(Errors.MISSING_WEB3)
    }
    const contractAddress = address.toLowerCase()
    let version = this.versionForAddress[contractAddress]
    if (version === undefined) {
      version = await this[versionRetrievalMethodName](contractAddress)
      this.versionForAddress[contractAddress] = version
    }
    if (version === 4) {
      return v4
    }
    if (version === 6) {
      return v6
    }
    if (version === 7) {
      return v7
    }
    if (version === 8) {
      return v8
    }
  }
async contractAbiVersion ( address , versionRetrievalMethodName ) { if ( ! this . provider ) { throw new Error ( Errors . MISSING_WEB3 ) } const contractAddress = address . toLowerCase ( ) let version = this . versionForAddress [ contractAddress ] if ( version === undefined ) { version = await this [ versionRetrievalMethodName ] ( contractAddress ) this . versionForAddress [ contractAddress ] = version } if ( version === 4 ) { return v4 } if ( version === 6 ) { return v6 } if ( version === 7 ) { return v7 } if ( version === 8 ) { return v8 } }
@param {string} address contract address
 @param {string} versionRetrievalMethodName the method to call to retrieve the contract version
@param { string } address contract address @param { string } versionRetrievalMethodName the method to call to retrieve the contract version
// ethereum has 2 kinds of addresses, this ensures we don't // accidentally store the same contract twice // see https://docs.ethers.io/ethers.js/html/notes.html#checksum-address // This was not memo-ized