MEM
WebsiteLabsGuides
  • โš—๏ธMolecular Execution Machine
  • ๐Ÿ‘‹Introduction
    • What is MEM?
    • MEM features
    • MEM vs alternatives
    • Technical architecture
    • Use-case examples
  • โšกQuickstart
    • Quickstart guide
  • ๐Ÿ“–MEM Specifications
    • Function syntax
    • Function specs
    • Transaction specs
    • Supported languages
    • About MIPs
  • โš›๏ธMolecules
    • Overview
    • Multichain authentication
    • Using APIs
    • API reference
  • ๐ŸงชMEM IDE
    • Overview
    • Function ABI
  • โš’๏ธMEM Carbon Testnet
    • Overview
    • Deploy to testnet
    • Interact with testnet functions
  • โš™๏ธMEM SDK
    • SDK Usage
  • ๐Ÿ–ฅ๏ธMEM CLI
    • Function deployment
    • Function interaction
  • ๐Ÿ—๏ธMEM API
    • Overview
    • Write operations
    • Read operations
  • โš›๏ธ3EM-MEM
    • Overview
    • EXM API
    • Key-Value Storage (KVS)
  • ๐ŸงฉExamples
    • Pastebin clone
    • Query onchain data
Powered by GitBook

mem.tech ยฉ 2023

On this page
  1. MEM IDE

Function ABI

Defining functions and arguments in a function's state

PreviousOverviewNextOverview

Last updated 1 year ago

A MEM function state can optionally include a publicFunctions object as an ABI which helps to document the function and make it interactive in the IDE.

The ABI simplifies capturing public callable functions and their input object arguments in MEM functions. It provides a clear and standardized structure that helps developers avoid manual errors and maintain consistency across functions during writing and testing.

How to write a MEM ABI

The publicFunctions object is structured such that each key represents a function name, and the associated value is an array of strings detailing the input object arguments for that function.

Example: state.json

{
  "publicFunctions": {
    "addUser": ["username", "bio", "id"],
    "deleteUser": ["id"]
  }
}

In the IDE, this will populate the interaction pane with function names and fields that can be used to test the function.

๐Ÿงช