⚙️ MICHELSON RUNE DIFFICULTY: Adept Creational

The Abstract Factory Pattern in Michelson

A cyberpunk Michelson invocation for the Abstract Factory pattern.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Abstract Factory
ARCANUM SCHOOL: Conjuration // Stackmancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// MICHELSON PATTERN //
parameter (or (unit %create_cyber_asset) (unit %create_neon_asset));
storage (list string);
code {
  UNPAIR;
  IF_LEFT {
    DROP;
    PUSH string "Cyber_Asset_X9";
  } {
    DROP;
    PUSH string "Neon_Asset_V2";
  };
  CONS;
  NIL operation;
  PAIR
}
Runic Tags: #creational #abstract-factory #stack-based smart contracts #michelson #tezos