> For the complete documentation index, see [llms.txt](https://docs.symm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.symm.io/options-protocol-architecture/technical-architecture/helper-contracts/symmiopartyb-contract.md).

# SymmioPartyB Contract

The `SymmioPartyB` contract is the core **execution proxy** for Party B actors. It provides **secure routing**, **multi-call support**, and **fine-grained permissioning** for interactions with the Symmio core contracts.

This contract allows Party B to batch trade operations, authorize token flows, and interface with both internal and whitelisted external contracts.

## **Core Functions**

### 🔹 **Symmio Call Dispatcher**

```solidity
function _call(bytes[] calldata callDatas) external;
```

Forwards multiple encoded calls to the Symmio core (e.g., opening or closing trades). Enforces selector-level permissions:

* `restrictedSelectors[sel] == true`: requires `MANAGER_ROLE`
* otherwise: `TRUSTED_ROLE` or `InstantLayer` delegate is sufficient

Reverts if any call fails.

### 🔹 **Multicast Executor**

```solidity
function _multicastCall(
    address[] calldata dests,
    bytes[] calldata datas
) external;
```

Sends parallel external calls to approved targets. All destination contracts must be whitelisted. Requires `TRUSTED_ROLE`.

### 🔹 **Token Management**

```solidity
function _approve(address token, uint256 amount) external;
```

Sets Symmio token allowances. Callable by `TRUSTED_ROLE`.

```solidity
function withdrawERC20(address token, uint256 amount) external;
```

Withdraws tokens to the caller. Restricted to `MANAGER_ROLE`.

### 🔹 **Configuration Functions**

```solidity
function setRestrictedSelector(bytes4 sel, bool state) external;
```

Marks a core selector as restricted to `MANAGER_ROLE`.

```solidity
function setMulticastWhitelist(address addr, bool state) external;
```

Controls which external contracts can be called via `_multicastCall`.

```solidity
function setSigner(address newSigner) external;
```

Updates the ERC-1271 signer address used for off-chain validation.

### 🔹 **Signature Verification**

```solidity
function isValidSignature(
    bytes32 hash,
    bytes calldata sig
) external view returns (bytes4);
```

Returns `0x1626ba7e` if signature is valid; otherwise `0xffffffff`.

### 🔹 **Emergency Controls**

```solidity
function pause() external;
function unpause() external;
```

Enables or disables contract functions under emergency conditions. Controlled via `PAUSER_ROLE` / `UNPAUSER_ROLE`.

Once the cooldown period has elapsed, the withdrawal can be finalized:

```solidity
function completeWithdraw(uint256 id)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
