IDeBridgeGate

Functions

isSubmissionUsed

1
function isSubmissionUsed(
2
bytes32 submissionId
3
) external returns (bool)
Copied!
Returns whether the transfer with the submissionId was claimed. submissionId is generated in getSubmissionIdFrom

getNativeInfo

1
function getNativeInfo(
2
address token
3
) external returns (uint256 nativeChainId, bytes nativeAddress)
Copied!
Returns native token info by wrapped token address

send

1
function send(
2
address _tokenAddress,
3
uint256 _amount,
4
uint256 _chainIdTo,
5
bytes _receiver,
6
bytes _permit,
7
bool _useAssetFee,
8
uint32 _referralCode,
9
bytes _autoParams
10
) external
Copied!
This method is used for the transfer of assets from the native 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 (work only for specials token)
_referralCode
uint32
Referral code
_autoParams
bytes
Auto params for external call in target network

claim

1
function claim(
2
bytes32 _debridgeId,
3
uint256 _amount,
4
uint256 _chainIdFrom,
5
address _receiver,
6
uint256 _nonce,
7
bytes _signatures,
8
bytes _autoParams
9
) external
Copied!
Is used for transfers into the native 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

1
function flash(
2
address _tokenAddress,
3
address _receiver,
4
uint256 _amount,
5
bytes _data
6
) external
Copied!
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 to pass to sender's flashCallback function

getDefiAvaliableReserves

1
function getDefiAvaliableReserves(
2
address _tokenAddress
3
) external returns (uint256)
Copied!
Get reserves of a token available to use in defi

Parameters:

Name
Type
Description
_tokenAddress
address
Token address

requestReserves

1
function requestReserves(
2
address _tokenAddress,
3
uint256 _amount
4
) external
Copied!
Request the assets to be used in DeFi protocol.

Parameters:

Name
Type
Description
_tokenAddress
address
Asset address.
_amount
uint256
Amount of tokens to request.

returnReserves

1
function returnReserves(
2
address _tokenAddress,
3
uint256 _amount
4
) external
Copied!
Return the assets that were used in DeFi protocol.

Parameters:

Name
Type
Description
_tokenAddress
address
Asset address.
_amount
uint256
Amount of tokens to claim.

withdrawFee

1
function withdrawFee(
2
bytes32 _debridgeId
3
) external
Copied!
Withdraw collected fees to feeProxy

Parameters:

Name
Type
Description
_debridgeId
bytes32
Asset identifier.

getDebridgeChainAssetFixedFee

1
function getDebridgeChainAssetFixedFee(
2
bytes32 _debridgeId,
3
uint256 _chainId
4
) external returns (uint256)
Copied!
Returns asset fixed fee value for specified debridge and chainId.

Parameters:

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

Events

Sent

1
event Sent(
2
bytes32 submissionId,
3
bytes32 debridgeId,
4
uint256 amount,
5
bytes receiver,
6
uint256 nonce,
7
uint256 chainIdTo,
8
uint32 referralCode,
9
struct IDeBridgeGate.FeeParams feeParams,
10
bytes autoParams,
11
address nativeSender
12
)
Copied!
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

1
event Claimed(
2
bytes32 submissionId,
3
bytes32 debridgeId,
4
uint256 amount,
5
address receiver,
6
uint256 nonce,
7
uint256 chainIdFrom,
8
bytes autoParams,
9
bool isNativeToken
10
)
Copied!
Emitted once the tokens are transferred and withdrawn on a target chain

PairAdded

1
event PairAdded(
2
bytes32 debridgeId,
3
address tokenAddress,
4
bytes nativeAddress,
5
uint256 nativeChainId,
6
uint256 maxAmount,
7
uint16 minReservesBps
8
)
Copied!
Emitted when new asset support is added.

MonitoringSendEvent

1
event MonitoringSendEvent(
2
bytes32 submissionId,
3
uint256 nonce,
4
uint256 lockedOrMintedAmount,
5
uint256 totalSupply
6
)
Copied!

MonitoringClaimEvent

1
event MonitoringClaimEvent(
2
bytes32 submissionId,
3
uint256 lockedOrMintedAmount,
4
uint256 totalSupply
5
)
Copied!

ChainSupportUpdated

1
event ChainSupportUpdated(
2
uint256 chainId,
3
bool isSupported,
4
bool isChainFrom
5
)
Copied!
Emitted when the asset is allowed/disallowed to be transferred to the chain.

ChainsSupportUpdated

1
event ChainsSupportUpdated(
2
uint256 chainIds,
3
struct IDeBridgeGate.ChainSupportInfo chainSupportInfo,
4
bool isChainFrom
5
)
Copied!
Emitted when the supported chains are updated.

CallProxyUpdated

1
event CallProxyUpdated(
2
address callProxy
3
)
Copied!
Emitted when the new call proxy is set.

AutoRequestExecuted

1
event AutoRequestExecuted(
2
bytes32 submissionId,
3
bool success,
4
address callProxy
5
)
Copied!
Emitted when the transfer request is executed.

Blocked

1
event Blocked(
2
bytes32 submissionId
3
)
Copied!
Emitted when a submission is blocked.

Unblocked

1
event Unblocked(
2
bytes32 submissionId
3
)
Copied!
Emitted when a submission is unblocked.

Flash

1
event Flash(
2
address sender,
3
address tokenAddress,
4
address receiver,
5
uint256 amount,
6
uint256 paid
7
)
Copied!
Emitted when a flash loan is successfully returned.

WithdrawnFee

1
event WithdrawnFee(
2
bytes32 debridgeId,
3
uint256 fee
4
)
Copied!
Emitted when fee is withdrawn.

FixedNativeFeeUpdated

1
event FixedNativeFeeUpdated(
2
uint256 globalFixedNativeFee,
3
uint256 globalTransferFeeBps
4
)
Copied!
Emitted when globalFixedNativeFee and globalTransferFeeBps are updated.

FixedNativeFeeAutoUpdated

1
event FixedNativeFeeAutoUpdated(
2
uint256 globalFixedNativeFee
3
)
Copied!
Emitted when globalFixedNativeFee is updated by feeContractUpdater

Structs

TokenInfo

1
struct TokenInfo {
2
uint256 nativeChainId;
3
bytes nativeAddress;
4
}
Copied!

DebridgeInfo

1
struct DebridgeInfo {
2
uint256 chainId;
3
uint256 maxAmount;
4
uint256 balance;
5
uint256 lockedInStrategies;
6
address tokenAddress;
7
uint16 minReservesBps;
8
bool exist;
9
}
Copied!

DebridgeFeeInfo

1
struct DebridgeFeeInfo {
2
uint256 collectedFees;
3
uint256 withdrawnFees;
4
mapping(uint256 => uint256) getChainFee;
5
}
Copied!

ChainSupportInfo

1
struct ChainSupportInfo {
2
uint256 fixedNativeFee;
3
bool isSupported;
4
uint16 transferFeeBps;
5
}
Copied!

DiscountInfo

1
struct DiscountInfo {
2
uint16 discountFixBps;
3
uint16 discountTransferBps;
4
}
Copied!

SubmissionAutoParamsTo

1
struct SubmissionAutoParamsTo {
2
uint256 executionFee;
3
uint256 flags;
4
bytes fallbackAddress;
5
bytes data;
6
}
Copied!

SubmissionAutoParamsFrom

1
struct SubmissionAutoParamsFrom {
2
uint256 executionFee;
3
uint256 flags;
4
address fallbackAddress;
5
bytes data;
6
bytes nativeSender;
7
}
Copied!

FeeParams

1
struct FeeParams {
2
uint256 receivedAmount;
3
uint256 fixFee;
4
uint256 transferFee;
5
bool useAssetFee;
6
bool isNativeToken;
7
}
Copied!