> ## Documentation Index
> Fetch the complete documentation index at: https://docs.debridge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IDeBridgeGate

> IDeBridgeGate interface details - functions, events, and structs.

## Functions

### isSubmissionUsed

```solidity theme={null}
function isSubmissionUsed(
    bytes32 submissionId
) external returns (bool)
```

Returns whether the transfer with the submissionId was claimed. submissionId is generated in `getSubmissionIdFrom`.

### getNativeInfo

```solidity theme={null}
function getNativeInfo(
    address token
) external returns (uint256 nativeChainId, bytes nativeAddress)
```

Returns native token info by wrapped token address.

### send

```solidity theme={null}
function send(
    address _tokenAddress,
    uint256 _amount,
    uint256 _chainIdTo,
    bytes _receiver,
    bytes _permit,
    bool _useAssetFee,
    uint32 _referralCode,
    bytes _autoParams
) external
```

This method is used for the transfer of assets
[from the native chain](/dmp-details/dePort/transfer-flow#transfers-from-native-source-chain). It locks an asset in the smart
contract in the native chain and enables minting of deAsset on the secondary chain.

**Parameters:**

| Name            | Type      | Description                                                   |
| --------------- | --------- | ------------------------------------------------------------- |
| `_tokenAddress` | `address` | Asset identifier.                                             |
| `_amount`       | `uint256` | Amount to be transferred (note: the fee can be applied).      |
| `_chainIdTo`    | `uint256` | Chain id of the target chain.                                 |
| `_receiver`     | `bytes`   | Receiver address.                                             |
| `_permit`       | `bytes`   | deadline + signature for approving the spender by signature.  |
| `_useAssetFee`  | `bool`    | use assets fee for pay protocol fix (only for special tokens) |
| `_referralCode` | `uint32`  | Referral code                                                 |
| `_autoParams`   | `bytes`   | Auto params for external call in target network               |

### claim

```solidity theme={null}
function claim(
    bytes32 _debridgeId,
    uint256 _amount,
    uint256 _chainIdFrom,
    address _receiver,
    uint256 _nonce,
    bytes _signatures,
    bytes _autoParams
) external
```

Used for transfers [into the native chain](/dmp-details/dePort/transfer-flow#transfers-from-native-source-chain) to unlock the
designated amount of asset from collateral and transfer it to the receiver.

**Parameters:**

| Name           | Type      | Description                                                     |
| -------------- | --------- | --------------------------------------------------------------- |
| `_debridgeId`  | `bytes32` | Asset identifier.                                               |
| `_amount`      | `uint256` | Amount of the transferred asset (note: the fee can be applied). |
| `_chainIdFrom` | `uint256` | Chain where submission was sent                                 |
| `_receiver`    | `address` | Receiver address.                                               |
| `_nonce`       | `uint256` | Submission id.                                                  |
| `_signatures`  | `bytes`   | Validators signatures to confirm                                |
| `_autoParams`  | `bytes`   | Auto params for external call                                   |

### flash

```solidity theme={null}
function flash(
    address _tokenAddress,
    address _receiver,
    uint256 _amount,
    bytes _data
) external
```

Get a flash loan, msg.sender must implement IFlashCallback.

**Parameters:**

| Name            | Type      | Description                     |
| --------------- | --------- | ------------------------------- |
| `_tokenAddress` | `address` | An asset to loan                |
| `_receiver`     | `address` | Where funds should be sent      |
| `_amount`       | `uint256` | Amount to loan                  |
| `_data`         | `bytes`   | Data for sender's flashCallback |

### getDefiAvaliableReserves

```solidity theme={null}
function getDefiAvaliableReserves(
    address _tokenAddress
) external returns (uint256)
```

Get reserves of a token available to use in DeFi.

**Parameters:**

| Name            | Type      | Description    |
| --------------- | --------- | -------------- |
| `_tokenAddress` | `address` | Token address. |

### requestReserves

```solidity theme={null}
function requestReserves(
    address _tokenAddress,
    uint256 _amount
) external
```

Request the assets to be used in DeFi protocol.

**Parameters:**

| Name            | Type      | Description        |
| --------------- | --------- | ------------------ |
| `_tokenAddress` | `address` | Asset address.     |
| `_amount`       | `uint256` | Amount to request. |

### returnReserves

```solidity theme={null}
function returnReserves(
    address _tokenAddress,
    uint256 _amount
) external
```

Return the assets that were used in DeFi protocol.

**Parameters:**

| Name            | Type      | Description       |
| --------------- | --------- | ----------------- |
| `_tokenAddress` | `address` | Asset address.    |
| `_amount`       | `uint256` | Amount to return. |

### withdrawFee

```solidity theme={null}
function withdrawFee(
    bytes32 _debridgeId
) external
```

Withdraw collected fees to feeProxy.

**Parameters:**

| Name          | Type      | Description       |
| ------------- | --------- | ----------------- |
| `_debridgeId` | `bytes32` | Asset identifier. |

### getDebridgeChainAssetFixedFee

```solidity theme={null}
function getDebridgeChainAssetFixedFee(
    bytes32 _debridgeId,
    uint256 _chainId
) external returns (uint256)
```

Returns asset fixed fee value for specified debridge and chainId.

**Parameters:**

| Name          | Type      | Description       |
| ------------- | --------- | ----------------- |
| `_debridgeId` | `bytes32` | Asset identifier. |
| `_chainId`    | `uint256` | Chain id.         |

## Events

### Sent

```solidity theme={null}
event Sent(
    bytes32 submissionId,
    bytes32 debridgeId,
    uint256 amount,
    bytes receiver,
    uint256 nonce,
    uint256 chainIdTo,
    uint32 referralCode,
    struct IDeBridgeGate.FeeParams feeParams,
    bytes autoParams,
    address nativeSender
)
```

Emitted once the tokens are sent from the original(native) chain to the other chain; the transfer tokens are expected to be
claimed by the users.

### Claimed

```solidity theme={null}
event Claimed(
    bytes32 submissionId,
    bytes32 debridgeId,
    uint256 amount,
    address receiver,
    uint256 nonce,
    uint256 chainIdFrom,
    bytes autoParams,
    bool isNativeToken
)
```

Emitted once the tokens are transferred and withdrawn on a target chain.

### PairAdded

```solidity theme={null}
event PairAdded(
    bytes32 debridgeId,
    address tokenAddress,
    bytes nativeAddress,
    uint256 nativeChainId,
    uint256 maxAmount,
    uint16 minReservesBps
)
```

Emitted when new asset support is added.

### MonitoringSendEvent

```solidity theme={null}
event MonitoringSendEvent(
    bytes32 submissionId,
    uint256 nonce,
    uint256 lockedOrMintedAmount,
    uint256 totalSupply
)
```

### MonitoringClaimEvent

```solidity theme={null}
event MonitoringClaimEvent(
    bytes32 submissionId,
    uint256 lockedOrMintedAmount,
    uint256 totalSupply
)
```

### ChainSupportUpdated

```solidity theme={null}
event ChainSupportUpdated(
    uint256 chainId,
    bool isSupported,
    bool isChainFrom
)
```

Emitted when the asset is allowed/disallowed to be transferred to the chain.

### ChainsSupportUpdated

```solidity theme={null}
event ChainsSupportUpdated(
    uint256 chainIds,
    struct IDeBridgeGate.ChainSupportInfo chainSupportInfo,
    bool isChainFrom
)
```

Emitted when the supported chains are updated.

### CallProxyUpdated

```solidity theme={null}
event CallProxyUpdated(
    address callProxy
)
```

Emitted when the new call proxy is set.

### AutoRequestExecuted

```solidity theme={null}
event AutoRequestExecuted(
    bytes32 submissionId,
    bool success,
    address callProxy
)
```

Emitted when the transfer request is executed.

### Blocked

```solidity theme={null}
event Blocked(
    bytes32 submissionId
)
```

Emitted when a submission is blocked.

### Unblocked

```solidity theme={null}
event Unblocked(
    bytes32 submissionId
)
```

Emitted when a submission is unblocked.

### Flash

```solidity theme={null}
event Flash(
    address sender,
    address tokenAddress,
    address receiver,
    uint256 amount,
    uint256 paid
)
```

Emitted when a flash loan is successfully returned.

### WithdrawnFee

```solidity theme={null}
event WithdrawnFee(
    bytes32 debridgeId,
    uint256 fee
)
```

Emitted when fee is withdrawn.

### FixedNativeFeeUpdated

```solidity theme={null}
event FixedNativeFeeUpdated(
    uint256 globalFixedNativeFee,
    uint256 globalTransferFeeBps
)
```

Emitted when `globalFixedNativeFee` and `globalTransferFeeBps` are updated.

### FixedNativeFeeAutoUpdated

```solidity theme={null}
event FixedNativeFeeAutoUpdated(
    uint256 globalFixedNativeFee
)
```

Emitted when `globalFixedNativeFee` is updated by `feeContractUpdater`.

## Structs

### TokenInfo

```solidity theme={null}
struct TokenInfo {
    uint256 nativeChainId;
    bytes nativeAddress;
}
```

### DebridgeInfo

```solidity theme={null}
struct DebridgeInfo {
    uint256 chainId;
    uint256 maxAmount;
    uint256 balance;
    uint256 lockedInStrategies;
    address tokenAddress;
    uint16 minReservesBps;
    bool exist;
}
```

### DebridgeFeeInfo

```solidity theme={null}
struct DebridgeFeeInfo {
    uint256 collectedFees;
    uint256 withdrawnFees;
    mapping(uint256 => uint256) getChainFee;
}
```

### ChainSupportInfo

```solidity theme={null}
struct ChainSupportInfo {
    uint256 fixedNativeFee;
    bool isSupported;
    uint16 transferFeeBps;
}
```

### DiscountInfo

```solidity theme={null}
struct DiscountInfo {
    uint16 discountFixBps;
    uint16 discountTransferBps;
}
```

### SubmissionAutoParamsTo

```solidity theme={null}
struct SubmissionAutoParamsTo {
    uint256 executionFee;
    uint256 flags;
    bytes fallbackAddress;
    bytes data;
}
```

### SubmissionAutoParamsFrom

```solidity theme={null}
struct SubmissionAutoParamsFrom {
    uint256 executionFee;
    uint256 flags;
    address fallbackAddress;
    bytes data;
    bytes nativeSender;
}
```

### FeeParams

```solidity theme={null}
struct FeeParams {
    uint256 receivedAmount;
    uint256 fixFee;
    uint256 transferFee;
    bool useAssetFee;
    bool isNativeToken;
}
```
