Skip to content

Commit 9f6d871

Browse files
committed
update docs
1 parent 3795653 commit 9f6d871

File tree

1 file changed

+38
-11
lines changed

1 file changed

+38
-11
lines changed

docs/EcoFacet.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,57 @@
1-
# Eco Facet
1+
# EcoFacet
22

33
## How it works
44

5-
The Eco Facet works by ...
5+
The EcoFacet enables cross-chain bridging through the Eco protocol. It allows users to bridge tokens across chains with optional destination chain calls, supporting both immediate execution and deferred proving mechanisms.
66

77
```mermaid
88
graph LR;
99
D{LiFiDiamond}-- DELEGATECALL -->EcoFacet;
10-
EcoFacet -- CALL --> C(Eco)
10+
EcoFacet -- CALL --> C(Eco Portal)
1111
```
1212

1313
## Public Methods
1414

1515
- `function startBridgeTokensViaEco(BridgeData calldata _bridgeData, EcoData calldata _ecoData)`
16-
- Simply bridges tokens using eco
17-
- `swapAndStartBridgeTokensViaEco(BridgeData memory _bridgeData, LibSwap.SwapData[] calldata _swapData, ecoData memory _ecoData)`
18-
- Performs swap(s) before bridging tokens using eco
16+
- Simply bridges tokens using Eco
17+
- `function swapAndStartBridgeTokensViaEco(BridgeData memory _bridgeData, LibSwap.SwapData[] calldata _swapData, EcoData calldata _ecoData)`
18+
- Performs swap(s) before bridging tokens using Eco
1919

20-
## eco Specific Parameters
20+
## Eco Specific Parameters
2121

22-
The methods listed above take a variable labeled `_ecoData`. This data is specific to eco and is represented as the following struct type:
22+
The methods listed above take a variable labeled `_ecoData`. This data is specific to Eco and is represented as the following struct type:
2323

2424
```solidity
25-
/// @param example Example parameter.
26-
struct ecoData {
27-
string example;
25+
/// @param portal The address of the portal contract on the source chain
26+
/// @param destinationPortal The address of the portal contract on the destination chain
27+
/// @param prover The address authorized to prove the route execution
28+
/// @param routeDeadline The deadline for route execution (timestamp)
29+
/// @param rewardDeadline The deadline for claiming rewards (timestamp)
30+
/// @param salt Unique identifier for the route
31+
/// @param calls Array of calls to be executed on the destination chain
32+
/// @param allowPartial Whether partial execution is allowed
33+
struct EcoData {
34+
address portal;
35+
address destinationPortal;
36+
address prover;
37+
uint64 routeDeadline;
38+
uint64 rewardDeadline;
39+
bytes32 salt;
40+
IEco.Call[] calls;
41+
bool allowPartial;
42+
}
43+
```
44+
45+
The `IEco.Call` struct is defined as:
46+
47+
```solidity
48+
/// @param target The contract address to call on destination chain
49+
/// @param data The calldata to send to the target contract
50+
/// @param value The amount of native token to send with the call
51+
struct Call {
52+
address target;
53+
bytes data;
54+
uint256 value;
2855
}
2956
```
3057

0 commit comments

Comments
 (0)