> For the complete documentation index, see [llms.txt](https://docs.rigoblock.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rigoblock.com/api/protocol/extensions/adapters/interfaces/iecrosschain.md).

# IECrosschain

## Overview

#### License: Apache-2.0-or-later

```solidity
interface IECrosschain
```

Author: Gabriele Rigo - <gab@rigoblock.com>

## Events info

### TokensReceived

```solidity
event TokensReceived(address indexed from, address indexed token, uint256 amount, uint8 indexed opType)
```

Emitted when cross-chain tokens are received

Parameters:

| Name   | Type    | Description                                                 |
| ------ | ------- | ----------------------------------------------------------- |
| from   | address | Address that initiated the cross-chain transfer (SpokePool) |
| token  | address | Token received                                              |
| amount | uint256 | Amount received (actual balance delta)                      |
| opType | uint8   | Operation type (0=Transfer, 1=Sync)                         |

### VirtualSupplyUpdated

```solidity
event VirtualSupplyUpdated(int256 adjustment, int256 newSupply)
```

Emitted when virtual supply is modified

Parameters:

| Name       | Type   | Description                         |
| ---------- | ------ | ----------------------------------- |
| adjustment | int256 | Signed adjustment (+/-)             |
| newSupply  | int256 | New virtual supply after adjustment |

## Errors info

### InvalidOpType

```solidity
error InvalidOpType()
```

### DonationLock

```solidity
error DonationLock(bool locked)
```

### BalanceUnderflow

```solidity
error BalanceUnderflow()
```

### NavManipulationDetected

```solidity
error NavManipulationDetected(uint256 expectedNav, uint256 actualNav)
```

### TokenNotInitialized

```solidity
error TokenNotInitialized()
```

### NavDecreased

```solidity
error NavDecreased(uint256 storedNav, uint256 currentNav)
```

## Functions info

### donate (0x6da7df96)

```solidity
function donate(
    address token,
    uint256 amount,
    DestinationMessageParams calldata params
) external
```

Handles receiving tokens from a cross-chain message or an escrow refund.

Called via delegatecall from pool. Callable by anyone.

Parameters:

| Name   | Type                            | Description                                                                    |
| ------ | ------------------------------- | ------------------------------------------------------------------------------ |
| token  | address                         | The token received on this chain.                                              |
| amount | uint256                         | The amount received.                                                           |
| params | struct DestinationMessageParams | The message params from the source calls sent to the across multicall handler. |
