isContract function

Future<bool> isContract(
  1. String address
)

Implementation

Future<bool> isContract(
  String address,
) async {
  try {
    final code = await ethereum!.request("eth_getCode", [address, "latest"]);
    return code != "0x";
  } catch (e) {
    print(e);
    throw Exception("Could not get code");
  }
}