SmartContract constructor

SmartContract({
  1. required TronAddress originAddress,
  2. TronAddress? contractAddress,
  3. required SmartContractABI? abi,
  4. required List<int> bytecode,
  5. BigInt? callValue,
  6. BigInt? consumeUserResourcePercent,
  7. String? name,
  8. BigInt? originEnergyLimit,
  9. List<int>? codeHash,
  10. List<int>? trxHash,
  11. int? version,
})

Create a new SmartContract instance with specified parameters.

Implementation

SmartContract(
    {required this.originAddress,
    this.contractAddress,
    required this.abi,
    required List<int> bytecode,
    this.callValue,
    this.consumeUserResourcePercent,
    this.name,
    this.originEnergyLimit,
    List<int>? codeHash,
    List<int>? trxHash,
    this.version})
    : bytecode = BytesUtils.toBytes(bytecode, unmodifiable: true),
      trxHash = BytesUtils.tryToBytes(trxHash, unmodifiable: true),
      codeHash = BytesUtils.tryToBytes(codeHash, unmodifiable: true);