Developers

Reference

The types and interfaces a module compiles against, generated from the published Solidity.

Tax

@standard/TaxTypes.sol
uint256 constant MAX_CREATOR_PAYEES = 6;
uint256 constant MAX_MODULE_PAYEES = 7;
uint256 constant MAX_PAYEES = 13;
uint16 constant MAX_TOTAL_TAX_BPS = 1_000;

struct TaxPayee {
    address to;
    uint16 buyBps;
    uint16 sellBps;
    bool inToken;
    bool hasReceiveHook;
    uint32 receiveGas;
}
@standard/IPooReceiveGas.sol
interface IPooReceiveGas {
    function receiveGas() external view returns (uint32);
}

Launch

@launch-module/LaunchTypes.sol
enum LaunchStatus {
    Upcoming,
    Live,
    Ended,
    Launched,
    Failed,
    Cancelled
}

struct LaunchBinding {
    address module;
    uint32 entryId;
}

struct LaunchContext {
    address token;
    address quote;
    address pair;
    address dexFactory;
    address initialAuthority;
    uint256 launchSupply;
    bool nativeIngress;
    uint32 pushGas;
}
@launch-module/IPooLaunchReport.sol
interface IPooLaunchReport is IERC165 {
    function token() external view returns (address);

    function status() external view returns (LaunchStatus);
}

Token modules

@token-module/TokenModuleTypes.sol
uint16 constant HOOK_GATE = 1;
uint16 constant HOOK_TRACK = 2;
uint16 constant HOOK_RECEIVE = 4;
uint16 constant HOOK_OPERATE_ON_SELL = 8;
uint16 constant HOOK_OPERATE_ON_BUY = 16;
uint16 constant HOOK_ALL = 31;
uint8 constant RUN_ARMED_BY_ROUND = 1;
uint8 constant RUN_ARMED_BY_REQUEST = 2;
uint8 constant RUN_IN_PROCESS = 4;
uint8 constant RUN_ON_BUY = 8;
uint32 constant GATE_GAS_CEILING = 30_000;
uint32 constant TRACK_GAS_CEILING = 550_000;
uint32 constant RECEIVE_GAS_CEILING = 265_000;
uint32 constant OPERATE_GAS_CEILING = 1_000_000;

struct TokenModuleContext {
    address token;
    address quote;
    address pair;
    address router;
}

struct TokenModuleBinding {
    address module;
    uint32 entryId;
    uint16 hooks;
}
@token-module/IPooTokenModule.sol
interface IPooTokenModule is IERC165 {
    function token() external view returns (address);
}

Hooks

@token-module/hooks/
interface IPooGateHook {
    function gate(address buyer, uint256 amount) external view;
}

interface IPooTrackHook {
    function track(address from, address to, uint256 fromBalance, uint256 toBalance) external;
}

interface IPooReceiveHook {
    function onReceive(address asset, uint256 buyAmount, uint256 sellAmount) external;
}

interface IPooOperateOnBuyHook {
    function operateOnBuy(uint8 context, address buyer, uint256 amount) external;
}

interface IPooOperateOnSellHook {
    function operateOnSell(uint8 context, address seller, uint256 amount) external;
}

Factories and installers

@token-module/IPooTokenModuleFactory.sol
interface IPooTokenModuleFactory is IERC165 {
    function manifest() external view returns (Manifest memory);

    function probe() external view returns (address);

    function create(TokenModuleContext calldata ctx, bytes calldata config) external returns (address tokenModule);
}
@token-module/IPooTokenModuleInstaller.sol
interface IPooTokenModuleInstaller {
    function onInstalled(address creator) external payable;
}
@launch-module/IPooLaunchFactory.sol
interface IPooLaunchFactory is IERC165 {
    function manifest() external view returns (Manifest memory);

    function probe() external view returns (address);

    function create(LaunchContext calldata ctx, bytes calldata config) external returns (address module);
}
@launch-module/IPooLaunchInstaller.sol
interface IPooLaunchInstaller {
    function onInstalled(address creator) external payable;
}
@standard/IPooFactoryDeveloper.sol
interface IPooFactoryDeveloper {
    function developer() external view returns (address);
}
@standard/IPooProbeHost.sol
interface IPooProbeHost {
    function probeStandIn() external view returns (address);
}

Requirements

@standard/ManifestTypes.sol
enum QuoteKind {
    Any,
    Native,
    Stable,
    Rwa,
    Other
}

enum TaxAsset {
    None,
    Quote,
    Token
}

struct Requires {
    QuoteKind quote;
    uint16 minTotalBps;
    bool unique;
    uint16 minSupplyBps;
    TaxAsset taxAsset;
    bool acceptsSupply;
}

The manifest

@standard/ManifestTypes.sol
enum QuoteKind { Any, Native, Stable, Rwa, Other }
enum SeedAsset { None, Quote, Token }
enum TaxAsset { None, Quote, Token }
enum Unit { Raw, TokenAmount, QuoteAmount, Bps, Timestamp, Duration, Address, Bool, Text, Hash, AssetAmount, Price }
enum ActionFlow { None, WalletPays, WalletReceives }
enum Widget { Figure, Progress, Countdown, State, Address, Text, Rows, Series }
enum ItemKind { View, Action, List, Gap }
enum EventRole { WalletInflow, ListAdd, ListRemove, Custom }
enum Tone { Neutral, Positive, Negative, Warning }
enum ListRole { None, ShareTable }
enum SectionRole { Body, Progress, Terms, Trade }
enum ListShape { WalletTotals, Membership, Log, Snapshot }

uint8   constant NO_SEED_FIELD = type(uint8).max;         // no index: a fixed seed
uint8   constant NO_EVENT_ARG = type(uint8).max;          // this event carries no such argument
uint16  constant NO_LIST_EVENT = type(uint16).max;        // this list names no remove event
uint8   constant MAX_COLUMNS = 4;                         // the most columns a section declares and an item spans
uint256 constant MAX_CONDITION_LABEL_BYTES = 80;          // a Condition's label, when its selector is set
uint256 constant MAX_MANIFEST_SUMMARY_BYTES = 120;        // Manifest.summary is 1 to this many bytes
uint256 constant MAX_MANIFEST_DESCRIPTION_BYTES = 1_000;  // Manifest.description is at most this many bytes

struct Seed {               // what the factory collects for your instance
    SeedAsset asset;        // None or Quote; a Token seed is refused
    uint8     amountField;  // an index into this manifest's own `config`, or NO_SEED_FIELD
    uint256   amount;       // a fixed amount, when `amountField` is NO_SEED_FIELD
}

struct Requires {             // pinned on your entry
    QuoteKind quote;          // Any, or the one quote kind you accept
    uint16    minTotalBps;    // minimum buyBps + sellBps of your tax row, 0..1000
    bool      unique;         // one seat per token for this handle
    uint16    minSupplyBps;   // minimum share of the total supply, in bps, 0..10000
    TaxAsset  taxAsset;       // the asset your tax row is paid in; None takes no row, and a minTotalBps needs Quote or Token
    bool      acceptsSupply;  // your module takes a supply share; required by minSupplyBps
}

struct Field {              // one config value or one action input
    string   name;          // the parameter's name; unique within its list
    string   abiType;       // the parameter's ABI type, as Solidity writes it
    string   label;         // what the form calls it
    Unit     unit;          // how the value is written, parsed and drawn
    string   help;          // one sentence under the control
    bool     optional;      // a blank control encodes the type's zero value
    bytes    min;           // ABI-encoded value of this field's own type, or empty
    bytes    max;           // the same shape
    bytes    defaultValue;  // the same shape: the control's starting value
    string[] options;       // a uintN's choices by index; a bool's two words
    uint8    dependsOn;     // index of the field this one is conditional on
    bytes    dependsValue;  // that field's value which reveals this one; empty = none
    bytes4   maxOf;         // Raw, TokenAmount or QuoteAmount only: selector(address
                            //   viewer) -> uint256, the most this wallet may enter now
    bytes4   assetOf;       // Raw, TokenAmount or QuoteAmount only: selector() ->
                            //   address, the ERC-20 the amount is in; 0 = the unit's asset
    uint16[] presetBps;     // amount and Bps fields: quick picks as bps of the
                            //   ceiling, strictly increasing in 1..10000
    bytes4   valueOf;       // action inputs only: 0, or selector() -> this field's own
                            //   static type, read live and drawn as a fact, never typed
    bool     multiline;     // draw this text field as a box, not a line. `string` only
}

struct PlatformReads {        // launch only: the platform's own fixed reads
    bytes4 hardCap;           // selector() -> uint256, or bytes4(0) for a figure you do not have
    bytes4 startsAt;          // the same shape
    bytes4 endsAt;            // the same shape
    bytes4 totalRaised;       // the same shape: how much your launch raised, where it raises
    bytes4 openingLiquidity;  // 0, or selector(bytes config, uint256 launchSupply) ->
                              //   (uint256 tokensToPool, uint256 quoteToPool)
}

struct Condition {      // one visibility mechanism, two shapes
    bytes4 selector;    // 0 = no condition. Nonzero shows, zero hides
    bool   withViewer;  // false: selector() -> word. true: selector(address viewer) -> word
    string label;       // when it is shown, 1..80 bytes; empty when selector is 0
}

struct View {               // one typed read
    Widget    widget;       // the shape of the read; it decides `selectors`
    string    label;
    bytes4[]  selectors;    // the read's selectors, in the order its widget takes them
    bool      withViewer;   // call selector(address viewer) instead of selector()
    Unit      unit;         // how the answer is formatted
    string[]  labels;       // a State's words; a Progress marker's caption
    Tone[]    tones;        // one per label; empty means Neutral throughout
    Condition visibleWhen;  // when this view is drawn
    bool      headline;     // this figure may be lifted into the token's band
}

struct Action {                // a call when `inputs` is empty, a form otherwise
    string     name;           // the called function's exact name
    string     description;    // one sentence, in the reader's own terms
    bytes4     selector;       // the function this calls; the registry rebuilds it from the signature
    bytes4     preview;        // 0, or a view over exactly `inputs` -> uint256
    Unit       previewUnit;    // what preview answers in; Raw when there is none
    uint8      minOutInput;    // index + 1 of the input the reader's slippage
                               //   tolerance writes; 0 for none
    uint8      deadlineInput;  // index + 1 of the input the interface fills with
                               //   a deadline; 0 for none
    ActionFlow flow;           // which way value moves for the presser; never authorization
    bool       isExit;         // this is how a wallet leaves
    Field[]    inputs;         // the function's parameters, in order
    bool       isPayable;      // the quote amount travels as the call's value
    Condition  visibleWhen;    // when the call or form is drawn
    bytes4     amount;         // 0, or selector(address viewer) -> uint256, a figure to display
    Unit       amountUnit;     // Raw when amount is 0
    bytes4     formValues;     // 0, or selector(address viewer) -> bytes[], one per input
    bytes4     target;         // 0 = this module; or selector() -> address the transaction is
                               //   sent to, name + inputs being the target's signature
}

struct Item {        // one entry of a section's order
    ItemKind kind;   // View, Action, List or Gap
    uint8    span;   // columns it takes; 0 = its kind's default
    uint16   index;  // into `views`, `actions` or `lists`; 0 for a Gap
}

struct EventDecl {         // an event your runtime emits, so the indexer can listen
    bytes32   topic0;      // the event's selector — `MyModule.Bought.selector`
    string    signature;   // "Bought(address indexed buyer, uint256 amount)"
    EventRole role;        // what the event means to the platform
    uint8     walletArg;   // ABI-ordered parameter index, or NO_EVENT_ARG
    uint8     amountArg;   // the same shape
    uint8     keyArg;      // the same shape
    uint8     flagArg;     // a boolean-shaped argument: a Snapshot list's Yes/No column
    uint8     textArg;     // a NON-indexed string argument to draw as this row's
                           //   own words; an indexed one reaches an indexer as
                           //   the topic hash, and is refused
    Unit      amountUnit;  // the amount's unit; Raw when there is no amount
    Tone      tone;        // how a row from this event reads
    string    label;       // the row's own word
}

struct ListDecl {                // a list the indexer builds from your events
    string    label;             // the list's heading
    uint16    eventIndex;        // into `Manifest.events`
    uint16    removeEventIndex;  // Membership only; NO_LIST_EVENT otherwise
    ListShape shape;             // how rows are built and ordered
    ListRole  role;              // ShareTable: payees each taking a
                                 //   declared share of some whole
}

struct ErrorText {    // a reader sentence for one of your own errors
    bytes4 selector;  // your custom error's selector; nonzero, not repeated
    string text;      // 1..200 bytes
}

struct Section {
    string      title;        // the section's heading
    SectionRole role;         // where you offer it; the platform places, never hoists
    Condition   visibleWhen;  // when the whole section is drawn
    uint8       columns;      // 0..4; 0 = the platform's own grid
    View[]      views;
    Action[]    actions;
    ListDecl[]  lists;
    Item[]      items;        // the order the platform draws; names every element once
}

struct Manifest {
    string        name;         // nonempty; the catalogue's word for you
    string        summary;      // one line, 1..120 bytes
    string        description;  // your disclosure, at most 1,000 bytes
    string        handle;       // your module family's handle across versions
    Requires      requires;     // what your module accepts and needs
    Seed[]        seeds;        // what the factory hands your instance at creation
    uint32        receiveGas;   // the exact cap of each hook; 0 without it
    uint32        trackGas;
    uint32        gateGas;
    uint32        operateGas;
    uint8         lifecycle;    // launch only: which of the five pre-opening statuses you can report; never Launched
    PlatformReads reads;        // launch only: the platform's fixed reads
    bytes         probeConfig;  // the config your factory built its probe from, as one tuple
    Field[]       config;       // the ABI tuple of `create`'s `config` bytes
    Section[]     sections;     // your whole panel, in your order
    EventDecl[]   events;       // the events your runtime emits
    ErrorText[]   errors;       // a sentence for each of your own errors
}