# SymmioPartyA

Each SymmioPartyA instance is a sub-account that forwards calls to the Symmio diamond on behalf of a user. It is created and managed by the MultiAccount contract, supports ERC-1271 signature validation, and can hold and transfer trade NFTs.

### Constructor

Initializes a new SymmioPartyA contract with the MultiAccount as admin and a reference to the Symmio diamond.

```solidity
constructor(address multiAccountAddress_, address symmioAddress_) {
    _grantRole(DEFAULT_ADMIN_ROLE, multiAccountAddress_);
    symmioAddress = symmioAddress_;
    multiAccountAddress = multiAccountAddress_;
}
```

**Parameters:**

* `multiAccountAddress_`: The MultiAccount contract that manages this sub-account. Granted `DEFAULT_ADMIN_ROLE`.
* `symmioAddress_`: The address of the Symmio diamond contract to which calls are forwarded.

***

### setSymmioAddress

Updates the Symmio diamond address. Only callable by `DEFAULT_ADMIN_ROLE` (the MultiAccount contract).

```solidity
function setSymmioAddress(address symmioAddress_) external onlyRole(DEFAULT_ADMIN_ROLE);
```

**Parameters:**

* `symmioAddress_`: The new Symmio diamond address.

**Event:** `SetSymmioAddress(oldAddress, newAddress)`

***

### call()

Forwards a call from this sub-account to the Symmio diamond. Only callable by the MultiAccount contract (`onlyMultiAccount`).

```solidity
function call(bytes memory callData) external onlyMultiAccount returns (bool success, bytes memory resultData);
```

**Parameters:**

* `callData`: ABI-encoded function call to forward to the Symmio diamond.

**Returns:**

* `success`: Whether the call succeeded.
* `resultData`: The return data (or revert reason on failure).

***

### isValidSignature()

ERC-1271 signature verification. Delegates to the MultiAccount contract to check whether the signature is valid for this sub-account.

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

Returns `0x1626ba7e` (the ERC-1271 magic value) if valid, `0xffffffff` otherwise.

***

### transferTradeNFT()

Transfers a trade NFT held by this sub-account to another address. Only callable by the MultiAccount contract.

```solidity
function transferTradeNFT(address nftContract, address to, uint256 tokenId) external onlyMultiAccount;
```

**Parameters:**

* `nftContract`: The TradeNFT contract address.
* `to`: The recipient address.
* `tokenId`: The NFT token ID to transfer.

Uses `safeTransferFrom`. Reverts with `NFTTransferFailed` if the transfer fails.

**Event:** `NFTTransferred(to, tokenId)`

***

### onERC721Received()

Implements `IERC721Receiver` so this contract can receive trade NFTs via `safeTransferFrom`.

```solidity
function onERC721Received(address, address, uint256, bytes calldata) external pure returns (bytes4);
```

Returns the selector `IERC721Receiver.onERC721Received.selector`.

***
