BridgeFacet

This is a Solidity contract that implements the IBridge interface. The contract has three functions:

updateStargateSettings():

updates the settings of the Stargate bridge.

Input

FieldTypeDescription

updateWormholeBridgeSettings():

updates the settings of the Wormhole bridge.

Input

FieldTypeDescription

The updateStargateSettings and updateWormholeBridgeSettings functions enforce that only the contract owner can call them, using the enforceIsContractOwner function from the LibDiamond library.

updateCelerBridgeSettings():

It's a way to update and manage the settings associated with the Celer Bridge, and its execution is permissioned for the contract owner.

Input

FieldTypeDescription

addCelerChainIds():

The function is responsible for updating the contract's settings related to chain IDs. It utilizes a modular approach where logic for handling chain IDs is encapsulated in the LibCeler library. The ownership check at the beginning guarantees that only the contract owner can execute this function.

Input

FieldTypeDescription

An array containing identifiers for networks.

An array containing chain identifiers corresponding to the networks in networkIds.

addMagpieCelerBridgeAddress():

This function is responsible for adding Magpie Celer bridge addresses to the contract's settings, associating them with specific network IDs.

Input

FieldTypeDescription

An array containing identifiers for networks.

An array of bytes32 values representing Magpie Celer Bridge addresses.

addMagpieStargateBridgeAddresses():

This function is responsible for adding the given bridge addresses to the corresponding network IDs.

Input

FieldTypeDescription

An array of identifier defined by the magpie team for each network

An array of magpieStargateBridge addresses for each network in the form of bytes32

addMagpieStargateBridgeV2Address():

This function is responsible for adding the given bridge addresses to the corresponding network IDs.

Input

FieldTypeDescription

An array of identifier defined by the magpie team for each network

An array of magpieStargateBridge addresses for each network in the form of bytes32

getWormholeTokenSequence():

This function takes a uint64 parameter tokenSequence and returns a uint64. It calls the getTokenSequence function from the LibWormhole library, passing the tokenSequence as an argument. The purpose of this function is to retrieve and return a transformed version of the tokenSequence using the LibWormhole library.

Input:

FieldTypeDescription

The token sequence defined by magpie

Output:

FieldTypeDescription

The token sequence receiver from wormhole.

bridgeIn():

This function takes a BridgeInArgs struct as a calldata parameter and does not return a value. It overrides a function declared in an interface or parent contract. It calls the bridgeIn function from the LibBridge library, passing the bridgeInArgs as an argument.

Input:

FieldTypeDescription

bridgeOut():

This function takes a BridgeOutArgs struct as a calldata parameter and returns a uint256 value. It overrides a function declared in an interface or parent contract. It calls the bridgeOut function from the LibBridge library, passing the bridgeOutArgs as an argument.

Input:

FieldTypeDescription

Last updated