Comment on page
IDeBridgeGate
function isSubmissionUsed(
bytes32 submissionId
) external returns (bool)
Returns whether the transfer with the submissionId was claimed. submissionId is generated in getSubmissionIdFrom
function getNativeInfo(
address token
) external returns (uint256 nativeChainId, bytes nativeAddress)
Returns native token info by wrapped token address
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. It locks an asset in the smart contract in the native chain and enables minting of deAsset on the secondary chain.
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 |
function claim(
bytes32 _debridgeId,
uint256 _amount,
uint256 _chainIdFrom,
address _receiver,
uint256 _nonce,
bytes _signatures,
bytes _autoParams
) external
Is used for transfers into the native chain to unlock the designated amount of asset from collateral and transfer it to the receiver.
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 |
function flash(
address _tokenAddress,
address _receiver,
uint256 _amount,
bytes _data
) external
Get a flash loan, msg.sender must implement IFlashCallback
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 |
function getDefiAvaliableReserves(
address _tokenAddress
) external returns (uint256)
Get reserves of a token available to use in defi
Name | Type | Description |
---|---|---|
_tokenAddress | address | Token address |
function requestReserves(
address _tokenAddress,
uint256 _amount
) external
Request the assets to be used in DeFi protocol.
Name | Type | Description |
---|---|---|
_tokenAddress | address | Asset address. |
_amount | uint256 | Amount of tokens to request. |
function returnReserves(
address _tokenAddress,
uint256 _amount
) external
Return the assets that were used in DeFi protocol.
Name | Type | Description |
---|---|---|
_tokenAddress | address | Asset address. |
_amount | uint256 | Amount of tokens to claim. |
function withdrawFee(
bytes32 _debridgeId
) external
Withdraw collected fees to feeProxy
Name | Type | Description |
---|---|---|
_debridgeId | bytes32 | Asset identifier. |
function getDebridgeChainAssetFixedFee(
bytes32 _debridgeId,
uint256 _chainId
) external returns (uint256)
Returns asset fixed fee value for specified debridge and chainId.
Name | Type | Description |
---|---|---|
_debridgeId | bytes32 | Asset identifier. |
_chainId | uint256 | Chain id. |
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.
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
event PairAdded(
bytes32 debridgeId,
address tokenAddress,
bytes nativeAddress,
uint256 nativeChainId,
uint256 maxAmount,
uint16 minReservesBps
)
Emitted when new asset support is added.
event MonitoringSendEvent(
bytes32 submissionId,
uint256 nonce,
uint256 lockedOrMintedAmount,
uint256 totalSupply
)
event MonitoringClaimEvent(
bytes32 submissionId,
uint256 lockedOrMintedAmount,
uint256 totalSupply
)
event ChainSupportUpdated(
uint256 chainId,
bool isSupported,
bool isChainFrom
)
Emitted when the asset is allowed/disallowed to be transferred to the chain.
event ChainsSupportUpdated(
uint256 chainIds,
struct IDeBridgeGate.ChainSupportInfo chainSupportInfo,
bool isChainFrom
)
Emitted when the supported chains are updated.
event CallProxyUpdated(
address callProxy
)
Emitted when the new call proxy is set.
event AutoRequestExecuted(
bytes32 submissionId,
bool success,
address callProxy
)
Emitted when the transfer request is executed.
event Blocked(
bytes32 submissionId
)
Emitted when a submission is blocked.
event Unblocked(
bytes32 submissionId
)
Emitted when a submission is unblocked.
event Flash(
address sender,
address tokenAddress,
address receiver,
uint256 amount,
uint256 paid
)
Emitted when a flash loan is successfully returned.
event WithdrawnFee(
bytes32 debridgeId,
uint256 fee
)
Emitted when fee is withdrawn.
event FixedNativeFeeUpdated(
uint256 globalFixedNativeFee,
uint256 globalTransferFeeBps
)
Emitted when globalFixedNativeFee and globalTransferFeeBps are updated.
event FixedNativeFeeAutoUpdated(
uint256 globalFixedNativeFee
)
Emitted when globalFixedNativeFee is updated by feeContractUpdater
struct TokenInfo {
uint256 nativeChainId;
bytes nativeAddress;
}
struct DebridgeInfo {
uint256 chainId;
uint256 maxAmount;
uint256 balance;
uint256 lockedInStrategies;
address tokenAddress;
uint16 minReservesBps;
bool exist;
}
struct DebridgeFeeInfo {
uint256 collectedFees;
uint256 withdrawnFees;
mapping(uint256 => uint256) getChainFee;
}
struct ChainSupportInfo {
uint256 fixedNativeFee;
bool isSupported;
uint16 transferFeeBps;
}
struct DiscountInfo {
uint16 discountFixBps;
uint16 discountTransferBps;
}
struct SubmissionAutoParamsTo {
uint256 executionFee;
uint256 flags;
bytes fallbackAddress;
bytes data;
}
struct SubmissionAutoParamsFrom {
uint256 executionFee;
uint256 flags;
address fallbackAddress;
bytes data;
bytes nativeSender;
}
struct FeeParams {
uint256 receivedAmount;
uint256 fixFee;
uint256 transferFee;
bool useAssetFee;
bool isNativeToken;
}
Last modified 1yr ago