IDeBridgeGate

Functions

isSubmissionUsed

  function isSubmissionUsed(
            bytes32 submissionId
  ) external returns (bool)

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

getNativeInfo

  function getNativeInfo(
            address token
  ) external returns (uint256 nativeChainId, bytes nativeAddress)

Returns native token info by wrapped token address

send

  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.

Parameters:

NameTypeDescription

_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

  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.

Parameters:

NameTypeDescription

_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

  function flash(
            address _tokenAddress,
            address _receiver,
            uint256 _amount,
            bytes _data
  ) external

Get a flash loan, msg.sender must implement IFlashCallback

Parameters:

NameTypeDescription

_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

  function getDefiAvaliableReserves(
            address _tokenAddress
  ) external returns (uint256)

Get reserves of a token available to use in defi

Parameters:

NameTypeDescription

_tokenAddress

address

Token address

requestReserves

  function requestReserves(
            address _tokenAddress,
            uint256 _amount
  ) external

Request the assets to be used in DeFi protocol.

Parameters:

NameTypeDescription

_tokenAddress

address

Asset address.

_amount

uint256

Amount of tokens to request.

returnReserves

  function returnReserves(
            address _tokenAddress,
            uint256 _amount
  ) external

Return the assets that were used in DeFi protocol.

Parameters:

NameTypeDescription

_tokenAddress

address

Asset address.

_amount

uint256

Amount of tokens to claim.

withdrawFee

  function withdrawFee(
            bytes32 _debridgeId
  ) external

Withdraw collected fees to feeProxy

Parameters:

NameTypeDescription

_debridgeId

bytes32

Asset identifier.

getDebridgeChainAssetFixedFee

  function getDebridgeChainAssetFixedFee(
            bytes32 _debridgeId,
            uint256 _chainId
  ) external returns (uint256)

Returns asset fixed fee value for specified debridge and chainId.

Parameters:

NameTypeDescription

_debridgeId

bytes32

Asset identifier.

_chainId

uint256

Chain id.

Events

Sent

  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

  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

  event PairAdded(
        bytes32 debridgeId,
        address tokenAddress,
        bytes nativeAddress,
        uint256 nativeChainId,
        uint256 maxAmount,
        uint16 minReservesBps
  )

Emitted when new asset support is added.

MonitoringSendEvent

  event MonitoringSendEvent(
        bytes32 submissionId,
        uint256 nonce,
        uint256 lockedOrMintedAmount,
        uint256 totalSupply
  )

MonitoringClaimEvent

  event MonitoringClaimEvent(
        bytes32 submissionId,
        uint256 lockedOrMintedAmount,
        uint256 totalSupply
  )

ChainSupportUpdated

  event ChainSupportUpdated(
        uint256 chainId,
        bool isSupported,
        bool isChainFrom
  )

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

ChainsSupportUpdated

  event ChainsSupportUpdated(
        uint256 chainIds,
        struct IDeBridgeGate.ChainSupportInfo chainSupportInfo,
        bool isChainFrom
  )

Emitted when the supported chains are updated.

CallProxyUpdated

  event CallProxyUpdated(
        address callProxy
  )

Emitted when the new call proxy is set.

AutoRequestExecuted

  event AutoRequestExecuted(
        bytes32 submissionId,
        bool success,
        address callProxy
  )

Emitted when the transfer request is executed.

Blocked

  event Blocked(
        bytes32 submissionId
  )

Emitted when a submission is blocked.

Unblocked

  event Unblocked(
        bytes32 submissionId
  )

Emitted when a submission is unblocked.

Flash

  event Flash(
        address sender,
        address tokenAddress,
        address receiver,
        uint256 amount,
        uint256 paid
  )

Emitted when a flash loan is successfully returned.

WithdrawnFee

  event WithdrawnFee(
        bytes32 debridgeId,
        uint256 fee
  )

Emitted when fee is withdrawn.

FixedNativeFeeUpdated

  event FixedNativeFeeUpdated(
        uint256 globalFixedNativeFee,
        uint256 globalTransferFeeBps
  )

Emitted when globalFixedNativeFee and globalTransferFeeBps are updated.

FixedNativeFeeAutoUpdated

  event FixedNativeFeeAutoUpdated(
        uint256 globalFixedNativeFee
  )

Emitted when globalFixedNativeFee is updated by feeContractUpdater

Structs

TokenInfo

struct TokenInfo {
    uint256 nativeChainId;
    bytes nativeAddress;
}

DebridgeInfo

struct DebridgeInfo {
    uint256 chainId;
    uint256 maxAmount;
    uint256 balance;
    uint256 lockedInStrategies;
    address tokenAddress;
    uint16 minReservesBps;
    bool exist;
}

DebridgeFeeInfo

struct DebridgeFeeInfo {
    uint256 collectedFees;
    uint256 withdrawnFees;
    mapping(uint256 => uint256) getChainFee;
}

ChainSupportInfo

struct ChainSupportInfo {
    uint256 fixedNativeFee;
    bool isSupported;
    uint16 transferFeeBps;
}

DiscountInfo

struct DiscountInfo {
    uint16 discountFixBps;
    uint16 discountTransferBps;
}

SubmissionAutoParamsTo

struct SubmissionAutoParamsTo {
    uint256 executionFee;
    uint256 flags;
    bytes fallbackAddress;
    bytes data;
}

SubmissionAutoParamsFrom

struct SubmissionAutoParamsFrom {
    uint256 executionFee;
    uint256 flags;
    address fallbackAddress;
    bytes data;
    bytes nativeSender;
}

FeeParams

struct FeeParams {
    uint256 receivedAmount;
    uint256 fixFee;
    uint256 transferFee;
    bool useAssetFee;
    bool isNativeToken;
}

Last updated