function buildContract(web3, contractABI, address) {
  const contract = new web3.eth.Contract(contractABI)
  if (address) {
    contract.options.address = address
  }
  contract.options.from = web3.eth.defaultAccount || undefined
  // @ts-ignore A newer version of Web3 is needed to include handleRevert.
  contract.options.handleRevert = true

  return contract
}
/**
 * Builds a web3.eth.Contract instance with the given ABI, pointed to the given
 * address, with a default `from` and revert handling set.
 *
 * @param {Web3} web3 The Web3 instance to instantiate the contract on.
 * @param {AbiItem[]} contractABI The ABI of the contract to instantiate.
 * @param {string} [address] The address of the deployed contract; if left
 *        unspecified, the contract won't be pointed to any address.
 *
 * @return {Contract} A contract for the specified ABI at the specified address,
 *         with default `from` and revert handling set.
 */
Builds a web3.eth.Contract instance with the given ABI, pointed to the given
address, with a default `from` and revert handling set.

@param {Web3} web3 The Web3 instance to instantiate the contract on.
@param {AbiItem[]} contractABI The ABI of the contract to instantiate.
@param {string} [address] The address of the deployed contract; if left
unspecified, the contract won't be pointed to any address.

@return {Contract} A contract for the specified ABI at the specified address,
with default `from` and revert handling set.
Builds a web3 . eth . Contract instance with the given ABI pointed to the given address with a default ` from ` and revert handling set . @param { Web3 } web3 The Web3 instance to instantiate the contract on . @param { AbiItem [] } contractABI The ABI of the contract to instantiate . @param { string } [ address ] The address of the deployed contract ; if left unspecified the contract won ' t be pointed to any address . @return { Contract } A contract for the specified ABI at the specified address with default ` from ` and revert handling set .
function buildContract(web3, contractABI, address) {
  const contract = new web3.eth.Contract(contractABI)
  if (address) {
    contract.options.address = address
  }
  contract.options.from = web3.eth.defaultAccount || undefined
  contract.options.handleRevert = true
  return contract
}
function buildContract ( web3 , contractABI , address ) { const contract = new web3 . eth . Contract ( contractABI ) if ( address ) { contract . options . address = address } contract . options . from = web3 . eth . defaultAccount || undefined contract . options . handleRevert = true return contract }
Builds a web3.eth.Contract instance with the given ABI, pointed to the given
 address, with a default `from` and revert handling set.
Builds a web3 . eth . Contract instance with the given ABI pointed to the given address with a default ` from ` and revert handling set .
// @ts-ignore A newer version of Web3 is needed to include handleRevert.