getCode method

  1. @override
Future<String> getCode(
  1. String address, {
  2. BlockTag? blockTag,
})
override

Gets the code of a contract at the specified address

This function allows specifying a custom block mined in the past to get historical data. By default, BlockTag.latest will be used.

Implementation

@override
Future<String> getCode(
  String address, {
  BlockTag? blockTag,
}) {
  final bt = blockTag?.toParam() ?? const BlockTag.latest().toParam();

  return _makeRPCCall<String>('eth_getCode', [address.toLowerCase(), bt]);
}