# InstantLayer Contract

`InstantLayer` is Symmio’s **meta-transaction router**, built to allow **Party A and Party B** participants to submit pre-signed operations for **gas-free execution**. It securely bridges off-chain intent signing with on-chain execution through EIP-712 signatures and structured batching.

The contract also supports **workflow templates**, where predefined sequences of operations can be reused with dynamic inputs.

**Key Features**

* **EIP-712 meta-tx support** with salt-based replay protection
* **Nonce ordering** for increased signature safety
* **Result chaining** between template steps
* **Standalone batch execution** for unrelated ops
* **Operator & admin roles** for access control
* **Instant-mode toggling** for Party A automation

## **Core Functions**

### 🔹 **Registration**

```solidity
function registerPartyB(address partyB) external;
function unregisterPartyB(address partyB) external;
```

Manages execution privileges for Party B actors. Assigns or revokes `OPERATOR_ROLE`.

```solidity
function registerMultiAccount(address multi) external;
function unregisterMultiAccount(address multi) external;
```

Whitelists or removes a `MultiAccount` contract.

### 🔹 **Template Management**

```solidity
function addTemplate(string calldata name, Operation[] calldata ops) external;
```

Creates a reusable operation sequence (workflow template). Assigns a sequential `templateId`.

```solidity
function setTemplateActive(uint256 templateId, bool active) external;
```

Enables or disables existing templates without removing them.

### 🔹 **Execution**

```solidity
function executeTemplate(
    uint256 templateId,
    SignedOperation[] calldata signedOps
) external;
```

Executes a template-based workflow. Verifies all signatures and steps. Allows result chaining between operations. Fully reverts on failure.

```solidity
function executeBatch(SignedOperation[] calldata signedOps) external;
```

Executes unrelated, independently signed operations in a batch. All must succeed.

### 🔹 **Signature Utilities**

```solidity
function getOperationHash(SignedOperation calldata op) public view returns (bytes32);
```

Returns the EIP-712 domain-separated hash that off-chain signers must sign.

```solidity
function domainSeparator() public view returns (bytes32);
```

Exposes the domain separator used in signature generation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.symm.io/options-protocol-architecture/technical-architecture/helper-contracts/instantlayer-contract.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
