deploy method

Future<Contract> deploy({
  1. int? gasLimit,
  2. BigInt? gasPrice,
  3. Account? account,
  4. String? passphrase,
  5. int maxAttempts = 20,
  6. int interval = 1000,
  7. bool toDS = false,
})

Implementation

Future<Contract> deploy(
    {int? gasLimit,
    BigInt? gasPrice,
    Account? account,
    String? passphrase,
    int maxAttempts = 20,
    int interval = 1000,
    bool toDS = false}) async {
  var defaultGasLimit = 2500000000;
  var defaultGasPrice = BigInt.from(100000000);

  if (this.init == null) {
    throw 'Cannot deploy without code or ABI.';
  }

  try {
    this.setDeployPayload(
        gasLimit: gasLimit ?? defaultGasLimit,
        gasPrice: gasPrice ?? defaultGasPrice,
        toDS: toDS);
    await this.sendContract(
        account: account ?? this.signer, passphrase: passphrase);
    await this.confirmTx(maxAttempts: maxAttempts, interval: interval);
    return this;
  } catch (err) {
    rethrow;
  }
}