Commands

A command is the core building block of The Simulacra. A command is similar to a traditional blockchain transaction. A command is structured with some consistent fields.

A command is structured:

struct Command {
    bytes32 id; // Identifier from the source
    uint256 chainId; // chainId, if blank can be executed on any chain
    uint256 nonce; // nonce to enable cancellation of commands
    uint256 value; // amount of NATIVE

    // wallet info
    bytes32 ownerId; // command owner's identifier
    bytes32 namespace; // namespace of the wallet (used for source)
    uint16 walletIndex; // defaults to 0
    
    // command definition
    bytes32 metaprotocol;
    bytes32[] modifiers; // additional command indicators
    Reference[] references; // additional information about a referenced entity
    string[] args;
    Field[] kwargs;
    
    // additional data
    uint64 timestamp; // timestamp with ms
    uint256 gas;
    uint256 bribe; // bribe for priority in mempool
    bytes32 hash; // maybe we don't need this
    
    // validate the execution
    CommandStatus status;
    uint256 gasUsed;
}

enum CommandStatus {
    PENDING,
    SUCCESS,
    FAILURE,
    CANCELLED
}

struct Field {
    bytes32 key;
    string value;
}

struct Reference {
    bytes32 source; // This simplifies handling of the reference
    bytes32 identifier; // globally unique identifier
}

Last updated