readLifecycle method

Future<Cip151Lifecycle> readLifecycle()

Reads CIP-151 lifecycle values that exist on this contract.

Implementation

Future<Cip151Lifecycle> readLifecycle() async {
  final metadata = <String, String>{};
  for (final key in const [cip151TokenExpirationKey, cip151TradingStopKey]) {
    if (await hasKey(key)) metadata[key] = await getValue(key);
  }
  return Cip151Lifecycle.fromMetadata(metadata);
}