deBridge
Search…
DeBridgeGate

Constants

BPS_DENOMINATOR

1
uint256 public constant BPS_DENOMINATOR = 10000;
Copied!
Returns Basis Points (BPS). Set to 10000.

Variables

chainId

1
uint256 public chainId;
Copied!
Returns current chain id.

signatureVerifier

1
address public signatureVerifier;
Copied!
Returns current signature verifier address to verify signatures.

confirmationAggregator

1
address public confirmationAggregator;
Copied!
Returns current aggregator address to verify by oracles confirmations.

callProxy

1
address public callProxy;
Copied!
Returns address of the proxy to execute user's calls.

supportedChainIds

1
uint256[] public supportedChainIds;
Copied!
Returns the supported chain at the specific index.

defiController

1
IDefiController public defiController;
Copied!
Return DefiController that can supply liquidity to staking strategies (AAVE, Compound, etc.)

feeProxy

1
IFeeProxy public feeProxy;
Copied!
Returns proxy to convert the collected fees and transfer to Ethereum network to treasury

weth

1
IWETH public weth;
Copied!
Returns contract for wrapped native token.

Read-Only Functions

getDebridge

1
function getDebridge(bytes32 _debridgeId)
2
external view returns (DebridgeInfo memory);
Copied!
Returns bridge-specific information.
Parameter
Type
Description
_debridgeId
bytes32
Bridge identifier

isSubmissionUsed

1
function isSubmissionUsed(bytes32 _submissionId)
2
external view returns (bool);
Copied!
Returns whether the transfer with the identifier was executed.
Parameter
Type
Description
_submissionId
bytes32
Transfer identifier

getUserNonce

1
function getUserNonce(address _owner) external view returns (uint256);
Copied!
Returns user's transactions count.
Parameter
Type
Description
_owner
address
User's address

getBalance

1
function getBalance(address _tokenAddress) external view returns (uint256);
Copied!
Returns the contract's balance of the specific ERC20 token.
Parameter
Type
Description
_tokenAddress
address
Address of the ERC20 token

getDebridgeId

1
function getDebridgeId(uint256 _chainId, address _tokenAddress)
2
public
3
pure
4
returns (bytes32)
5
{
6
return keccak256(abi.encodePacked(_chainId, _tokenAddress));
7
}
Copied!
Returns asset identifier.
Parameter
Type
Description
_chainId
uint256
Original chain id
_tokenAddress
address
Address of the asset on the other chain

getSubmisionId

1
function getSubmisionId(
2
bytes32 _debridgeId,
3
uint256 _chainIdFrom,
4
uint256 _chainIdTo,
5
uint256 _amount,
6
address _receiver,
7
uint256 _nonce
8
) public pure returns (bytes32) {
9
return
10
keccak256(
11
abi.encodePacked(
12
_debridgeId,
13
_chainIdFrom,
14
_chainIdTo,
15
_amount,
16
_receiver,
17
_nonce
18
)
19
);
20
}
Copied!
Returns transfer identifier.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdFrom
uint256
Chain identifier of the chain where tokens are sent from
_chainIdTo
uint256
Chain identifier of the chain where tokens are sent to
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address
_nonce
uint256
Count of the user's transfers to other chains

getAutoSubmisionId

1
function getAutoSubmisionId(
2
bytes32 _debridgeId,
3
uint256 _chainIdFrom,
4
uint256 _chainIdTo,
5
uint256 _amount,
6
address _receiver,
7
uint256 _nonce,
8
address _fallbackAddress,
9
uint256 _executionFee,
10
bytes memory _data)
11
external pure returns (bytes32);
Copied!
Returns transfer identifier for transfers that should be executed by workers.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdFrom
uint256
Chain identifier of the chain where tokens are sent from
_chainIdTo
uint256
Chain identifier of the chain where tokens are sent to
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address
_nonce
uint256
Count of the user's transfers to other chains
_fallbackAddress
address
Receiver of the tokens if the call fails
_executionFee
uint256
Fees paid to the transaction executor
_data
bytes
Data for the call

getChainSupport

1
function getChainSupport(uint256 _chainId)
2
external pure returns (ChainSupportInfo memory);
Copied!
Returns information for transfer to the chain.
Parameter
Type
Description
isSupported
bool
Is supported transfer to chain
fixedNativeFee
uint256
transfer fixed fee
transferFeeBps
uint256
transfer fee rate nominated in basis points of transferred amount

State-Changing Functions

send

1
function send(
2
bytes32 _debridgeId,
3
address _receiver,
4
uint256 _amount,
5
uint256 _chainIdTo
6
) external payable;
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.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdTo
uint256
Chain identifier of the chain where tokens are sent to
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address

mint

1
function mint(
2
bytes32 _debridgeId,
3
uint256 _chainIdFrom,
4
address _receiver,
5
uint256 _amount,
6
uint256 _nonce,
7
bytes[] calldata _signatures
8
) external;
Copied!
Mints wrapped asset in the current (secondary) chain and transfers the asset to the receiver. Can be called by any arbitrary wallet or by the receiver itself.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdFrom
uint256
Chain identifier of the chain where tokens are sent from
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address
_nonce
uint256
User's transfer count
_signatures
bytes[] calldata
Array of oracles signatures

burn

1
function burn(
2
bytes32 _debridgeId,
3
address _receiver,
4
uint256 _amount,
5
uint256 _chainIdTo,
6
uint256 _deadline,
7
bytes memory _signature
8
) external;
Copied!
This method is used for the transfer of deAssets from the secondary chain. It burns the wrapped asset in the secondary chain and allows to claim/mint asset in another native/secondary chain.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdTo
uint256
Chain identifier of the chain where tokens are sent to
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address
_deadline
uint256
Permit valid until
_signature
bytes memory
Permit signature

claim

1
function claim(
2
bytes32 _debridgeId,
3
uint256 _chainIdFrom,
4
address _receiver,
5
uint256 _amount,
6
uint256 _nonce,
7
bytes[] calldata _signatures
8
) 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.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdFrom
uint256
Chain identifier of the chain where tokens are sent from
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address
_nonce
uint256
User's transfer count
_signatures
bytes[] calldata
Array of oracles signatures

autoSend

1
function autoSend(
2
bytes32 _debridgeId,
3
address _receiver,
4
uint256 _amount,
5
uint256 _chainIdTo,
6
address _fallbackAddress,
7
uint256 _executionFee,
8
bytes memory _data
9
) external;
Copied!
This method is used for transfers from the native chain when in addition to the bridging of liquidity, deBridge cross-chain interoperability feature is used. User or smart contract can specify an arbitrary _data of the transaction to be executed in the target blockchain. With this type of transfer, autoMint transaction supposed to be executed by the Keeper in the target blockchain for small _executionFeereward
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdTo
uint256
Chain identifier of the chain where tokens are sent to
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address
_fallbackAddress
address
Receiver of the tokens if the call fails
_executionFee
uint256
Fees paid to the transaction executor
_data
bytes
Data for the call

autoMint

1
function autoMint(
2
bytes32 _debridgeId,
3
uint256 _chainIdFrom,
4
address _receiver,
5
uint256 _amount,
6
uint256 _nonce,
7
bytes[] calldata _signatures,
8
address _fallbackAddress,
9
uint256 _executionFee,
10
bytes memory _data
11
) external;
Copied!
Mints wrapped asset on the secondary chain; is expected to be called by the Keeper who earns the execution fee for the claim and execution of the transaction _data for the user.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdFrom
uint256
Chain identifier of the chain where tokens are sent from
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address
_nonce
uint256
User's transfer count
_signatures
bytes[] calldata
Array of oracles signatures
_fallbackAddress
address
Receiver of the tokens if the call fails
_executionFee
uint256
Fees paid to the transaction executor
_data
bytes
Data for the call

autoBurn

1
function autoBurn(
2
bytes32 _debridgeId,
3
address _receiver,
4
uint256 _amount,
5
uint256 _chainIdTo,
6
address _fallbackAddress,
7
uint256 _executionFee,
8
bytes memory _data,
9
uint256 _deadline,
10
bytes memory _signature
11
) external;
Copied!
Used for auto transfers of assets from the secondary chain. Burns the wrapped asset and allows to claim it on the other chain by the Keeper.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdTo
uint256
Chain identifier of the chain where tokens are sent to
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address
_fallbackAddress
address
Receiver of the tokens if the call fails
_executionFee
uint256
Fees paid to the transaction executor
_data
bytes
Data for the call
_deadline
uint256
Permit valid until
_signature
bytes memory
Permit signature

autoClaim

1
function autoClaim(
2
bytes32 _debridgeId,
3
uint256 _chainIdFrom,
4
address _receiver,
5
uint256 _amount,
6
uint256 _nonce,
7
bytes[] calldata _signatures,
8
address _fallbackAddress,
9
uint256 _executionFee,
10
bytes memory _data
11
) external;
Copied!
Unlock the asset in the native chain and transfer the asset to the receiver; is expected to be called by the worker/keeper that earns execution fee.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_chainIdFrom
uint256
Chain identifier of the chain where tokens are sent from
_amount
uint256
Amount of the transferred asset
_receiver
address
Receiver address
_nonce
uint256
User's transfer count
_signatures
bytes[] calldata
Array of oracles signatures
_fallbackAddress
address
Receiver of the tokens if the call fails
_executionFee
uint256
Fees paid to the transaction executor
_data
bytes
Data for the call

setFeeProxy

1
function setFeeProxy(IFeeProxy _feeProxy) external onlyAdmin;
Copied!
Set fee converter proxy.
Parameter
Type
Description
_feeProxy
IFeeProxy
Fee proxy

setWeth

1
function setWeth(IWETH _weth) external onlyAdmin;
Copied!
‌Set wrapped native asset address.
Parameter
Type
Description
_weth
IWETH
Wrapped native token address

setChainIdSupport

1
function setChainSupport(
2
uint256 _chainId,
3
bool _isSupported
4
) external onlyAdmin;
Copied!
Add/remove support for the chain where an arbitrary asset can be transferred.
Parameter
Type
Description
_chainId
uint256
Chain identifier of the chain where tokens can be sent to
_isSupported
bool
Whether the chain id is supported

setCallProxy

1
function setCallProxy(address _callProxy) external onlyAdmin;
Copied!
Set address of the call proxy.
Parameter
Type
Description
_callProxy
address
Address of the proxy that executes external calls

updateAsset

1
function updateAsset(
2
bytes32 _debridgeId,
3
uint256 _maxAmount,
4
uint256 _minReservesBps,
5
uint256 _amountThreshold
6
) external onlyAdmin;
Copied!
Update specific asset's bridge parameters.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_maxAmount
uint256
The maximum amount of current chain token to be transferred in one transaction
_minReservesBps
uint256
Minimal reserve ratio in BPS - limits the maximal amount of the asset that can be supplied into DefiController strategies
_amountThreshold
uint256
Transfer of amount greater than this param will require extra confirmations from oracles

updateAssetFixedFees

1
function updateAssetFixedFees(
2
bytes32 _debridgeId,
3
uint256[] memory _supportedChainIds,
4
uint256[] memory _fixedFee
5
) external onlyAdmin;
Copied!
Update asset's transfer parameters in order to allow the protocol to charge a fixed fee in the transferred asset itself instead of the native blockchain asset
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier
_supportedChainIds
uint256[] memory
Chain ids to which the fixed fee will be overrided
_fixedFee
uint256[] memory
Fixed amount of fee to be charged by the protocol for each transfer

setAggregator

1
function setAggregator(address _aggregator) external onlyAdmin;
Copied!
Set aggregator address
Parameter
Type
Description
_aggregator
address
Confirmation aggregator address

setSignatureVerifier

1
function setSignatureVerifier(address _verifier) external onlyAdmin;
Copied!
Parameter
Type
Description
_verifier
address
Verifier address

setDefiController

1
function setDefiController(IDefiController _defiController) external onlyAdmin;
Copied!
Set DeFi controller.
Parameter
Type
Description
_defiController
IDefiController
Defi controller address address

pause

1
function pause() external onlyAdmin;
Copied!
Disable transfers

unpause

1
function unpause() external onlyAdmin;
Copied!
Allow transfers.

withdrawFee

1
function withdrawFee(
2
bytes32 _debridgeId
3
) external onlyWorker;
Copied!
Withdraw collected fees.
Parameter
Type
Description
_debridgeId
bytes32
Asset identifier

requestReserves

1
function requestReserves(address _tokenAddress, uint256 _amount)
2
external onlyDefiController;
Copied!
Request the assets to be used in DeFi protocol.
Parameter
Type
Description
_tokenAddress
bytes32
Asset address
_amount
uint256
Amount of tokens requested by DefiController

returnReserves

1
function returnReserves(address _tokenAddress, uint256 _amount)
2
external onlyDefiController;
Copied!
Called to return the assets that were used in DeFi protocol.
Parameter
Type
Description
_tokenAddress
bytes32
Asset address
_amount
uint256
Amount of tokens to return from DefiController

Events

Sent

1
event Sent(
2
bytes32 submissionId,
3
bytes32 debridgeId,
4
uint256 amount,
5
address receiver,
6
uint256 nonce,
7
uint256 chainIdTo
8
);
Copied!
Emits once the tokens are sent from the original chain to the other chain; the transfer tokens are expected to be claimed by the users.

AutoSent

1
event AutoSent(
2
bytes32 submissionId,
3
bytes32 debridgeId,
4
uint256 amount,
5
address receiver,
6
uint256 nonce,
7
uint256 chainIdTo,
8
uint256 claimFee,
9
bytes data
10
);
Copied!
Emits once the tokens are sent from the original chain to the other chain; the transfered tokens are expected to be claimed by the worker.

Minted

1
event Minted(
2
bytes32 submissionId,
3
uint256 amount,
4
address receiver,
5
bytes32 debridgeId
6
);
Copied!
Emits once the wrapped tokens are claimed and minted on the chain.

Burnt

1
event Burnt(
2
bytes32 submissionId,
3
bytes32 debridgeId,
4
uint256 amount,
5
address receiver,
6
uint256 nonce,
7
uint256 chainIdTo
8
);
Copied!
Emits once the wrapped tokens are sent to the other chain; the asset is expected to be claimed by the user on the other chain.

AutoBurnt

1
event AutoBurnt(
2
bytes32 submissionId,
3
bytes32 debridgeId,
4
uint256 amount,
5
address receiver,
6
uint256 nonce,
7
uint256 chainIdTo,
8
uint256 claimFee,
9
bytes data
10
);
Copied!
Emits once the wrapped tokens are sent to the other chain; the asset is expected to be claimed by the worker on the other chain.

Claimed

1
event Claimed(
2
bytes32 submissionId,
3
uint256 amount,
4
address receiver,
5
bytes32 debridgeId
6
);
Copied!
Emits once the tokens are transferred and withdrawn on the original chain.

PairAdded

1
event PairAdded(
2
bytes32 indexed debridgeId,
3
address indexed tokenAddress,
4
uint256 indexed chainId,
5
uint256 minAmount,
6
uint256 minReserves
7
);
Copied!
Emits when new asset support is added.

ChainSupportUpdated

1
event ChainSupportUpdated(
2
uint256 chainId,
3
bool isEnabled
4
);
Copied!
Emits when the asset is allowed/disallowed to be transferred to the chain.

ChainsSupportUpdated

1
event ChainsSupportUpdated(uint256[] chainIds);
Copied!
Emits when the supported chains are updated.

CallProxyUpdated

1
event CallProxyUpdated(address callProxy);
Copied!
Emits when the new call proxy is set.

AutoRequestExecuted

1
event AutoRequestExecuted(bytes32 submissionId, bool success);
Copied!
Emits when the transfer request is executed by the worker.

Modifiers

onlyDefiController

1
modifier onlyDefiController();
Copied!
Throws if called by any account other than the defi controller contract.

onlyAdmin

1
modifier onlyAdmin();
Copied!
Throws if called by any account other than the admin.
Last modified 2mo ago