execTransaction method

  1. @override
Future<SafeContractEncodedCall> execTransaction({
  1. required ETHAddress to,
  2. BigInt? value,
  3. List<int>? data,
  4. SafeContractExecutionOpration operation = SafeContractExecutionOpration.call,
  5. BigInt? safeTxGas,
  6. BigInt? baseGas,
  7. BigInt? gasPrice,
  8. ETHAddress? gasToken,
  9. ETHAddress? refundReceiver,
  10. required List<int> signatures,
})
override

"stateMutability": "payable", Parameters:

  • to: Destination address of the Safe transaction.
  • value: Native token value of the Safe transaction.
  • data: Data payload of the Safe transaction.
  • operation: Operation type of the Safe transaction.
  • safeTxGas: Gas that should be used for the Safe transaction.
  • baseGas: Base gas costs that are independent of the transaction execution.
  • gasPrice: Gas price that should be used for the payment calculation.
  • gasToken: Token address (or 0 for the native token) that is used for the payment.
  • refundReceiver: Address of the receiver of the gas payment (or 0 for tx.origin).
  • signatures: Signature data for the executed transaction.

Implementation

@override
Future<SafeContractEncodedCall> execTransaction({
  required ETHAddress to,
  BigInt? value,
  List<int>? data,
  SafeContractExecutionOpration operation =
      SafeContractExecutionOpration.call,
  BigInt? safeTxGas,
  BigInt? baseGas,
  BigInt? gasPrice,
  ETHAddress? gasToken,
  ETHAddress? refundReceiver,
  required List<int> signatures,
}) async {
  final List<Object> params = [
    to,
    value ?? BigInt.zero,
    data ?? <int>[],
    operation.value,
    safeTxGas ?? BigInt.zero,
    baseGas ?? BigInt.zero,
    gasPrice ?? BigInt.zero,
    gasToken ?? ETHAddress.zero,
    refundReceiver ?? ETHAddress.zero,
    signatures,
  ];
  return encodeTransactionCall(
    functionName: SafeContractFunction.execTransaction,
    params: params,
  );
}