abiEncode method

  1. @override
EncoderResult abiEncode(
  1. AbiParameter params,
  2. bool input
)
override

Encodes a boolean value to ABI-encoded bytes.

Implementation

@override
EncoderResult abiEncode(AbiParameter params, bool input) {
  final bytes = List<int>.filled(ABIConst.uintBytesLength, 0);
  if (input) {
    bytes[bytes.length - 1] = 1;
  }
  return EncoderResult(isDynamic: false, encoded: bytes);
}