LibAggregator
Last updated
Last updated
The purpose of this library is to provide the core functionality for aggregating swap transactions and managing related operations within the Aggregator contract. The library has three structs.
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
The purpose of this function is to allow the contract owner to update the address of the WETH token used in the aggregator contract.
Input
This function is responsible for updating the magpieRouterAddress
variable within the contract's storage, allowing changes to be made to the address associated with the Magpie Router. Only contract owner can call this function.
Input
The purpose of this function is to allow the contract owner to update the network ID used in the aggregator contract. Only contract owner can call this function.
Input
The purpose of this function is to allow the contract owner to add Magpie aggregator addresses for multiple network IDs in the aggregator contract.
Input
This function allows for swapping assets into the contract using a bridge-in transaction. It facilitates interoperability between different networks and allows users to transfer assets from one network to another through the contract.
Input
Output
This function allows for swapping out assets from the contract using a bridge-out transaction. It facilitates interoperability between different networks and allows users to transfer assets from the contract to another network through the bridge-out mechanism.
Input
Output
The purpose of this function is to allow external callers to retrieve the deposit amount for a specific asset in the aggregator contract.
Input
Output
This function provides a way for users to withdraw their deposited assets from the contract, ensuring that only the rightful owner can withdraw their funds.
Input
The purpose of this function is to allow external callers to retrieve the deposit amount for a specific asset deposited by a specific user in the aggregator contract.
Input
Output
The purpose of this function is to allow external callers to check if a specific transfer key has been used in the aggregator contract.
Input
Output
This function is responsible for executing a delegatecall to a specific facet in the Diamond contract, passing the bridgeInArgs
data as the input. The specific functionality and behavior of the called facet would depend on the implementation details defined in the facet contract associated with the given selector.
Input:
his function is responsible for executing a delegatecall to a specific facet in the Diamond contract, passing the bridgeOutArgs
data as the input. The specific functionality and behavior of the called facet would depend on the implementation details defined in the facet contract associated with the given selector. The function expects the delegatecall to return a single uint256
value, which is then returned by the function itself.
Input:
This function is responsible for executing a delegatecall to a specific facet in the Diamond contract, passing the dataTransferInArgs
data as the input. The specific functionality and behavior of the called facet would depend on the implementation details defined in the facet contract associated with the given selector.
Input:
Input:
Output:
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
Field | Type | Description |
---|---|---|
bytes memory
The address of the asset being swapped out.
The address of the asset to which the swap is being performed.
The address to which the swapped asset will be transferred.
The address to which any transaction fee associated with the swap will be sent.
The amount of the asset being swapped out.
The amount of the asset being swapped out.
Address of the Wrapped Ether (WETH) contract.
The address of the magpie router.
The network ID associated with the application.
The network ID associated with the application.
The Magpie Diamond contract addresses for each of the networkIDs
The amount received after swapping
The amount received after swapping
Address of the asset that will be deposited
The deposited amount
The asset that will be withdrawn
Address of the asset that will be deposited
Address of the user who has deposited the asset
Deposited amount
networkId of the current chain in Magpie protocol, it is different from the actual networkId ethereum: 1 polygon: 2 bsc: 3 avalanche: 4 arbitrum: 5 optimism: 6
The address who initiated the transfer.
The magpie sequence for the current swap.
Flag used to identify if the transfer key has been used for swapping or not.
transferKey
payload
A string of bytes that contains transactional data.