ConnextBridge
Inherits: BaseBridge, IBridge
State Variables
connext
IConnext public immutable connext;
domainIds
mapping(uint32 => uint32) public domainIds;
whitelistedDelegates
mapping(uint32 => mapping(address => bool)) public whitelistedDelegates;
Functions
constructor
constructor(address _roles, address _connext) BaseBridge(_roles);
setDomainId
Set domain id
function setDomainId(uint32 _dstId, uint32 _domainId) external onlyBridgeConfigurator;
setWhitelistedDelegate
Whitelists a delegate address
function setWhitelistedDelegate(uint32 _dstId, address _delegate, bool status) external onlyBridgeConfigurator;
getFee
computes fee for bridge operation
function getFee(uint32, bytes memory, bytes memory) external pure returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
<none> | uint32 | |
<none> | bytes | |
<none> | bytes |
isDelegateWhitelisted
returns if an address represents a whitelisted delegates
function isDelegateWhitelisted(uint32 dstChain, address delegate) external view returns (bool);
sendMsg
rebalance through bridge
function sendMsg(
uint256 _extractedAmount,
address _market,
uint32 _dstChainId,
address _token,
bytes memory _message,
bytes memory
) external payable onlyRebalancer;
Parameters
Name | Type | Description |
---|---|---|
_extractedAmount | uint256 | extracted amount for rebalancing |
_market | address | destination address |
_dstChainId | uint32 | destination chain id |
_token | address | the token to rebalance |
_message | bytes | operation message data |
<none> | bytes |
_decodeMessage
function _decodeMessage(bytes memory _message) private pure returns (DecodedMessage memory);
Events
MsgSent
event MsgSent(uint256 indexed dstChainId, address indexed market, uint256 amountLD, uint256 slippage, bytes32 id);
DomainIdSet
event DomainIdSet(uint32 indexed dstId, uint32 indexed domainId);
WhitelistedDelegateStatusUpdated
event WhitelistedDelegateStatusUpdated(
address indexed sender, uint32 indexed dstId, address indexed delegate, bool status
);
Errors
Connext_NotEnoughFees
error Connext_NotEnoughFees();
Connext_NotImplemented
error Connext_NotImplemented();
Connext_DomainIdNotSet
error Connext_DomainIdNotSet();
Connext_DelegateNotValid
error Connext_DelegateNotValid();
Structs
DecodedMessage
struct DecodedMessage {
address delegate;
uint256 amount;
uint256 slippage;
uint256 relayerFee;
}