You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The xref:api:crosschain.adoc#ERC7786Aggregator[ERC7786Aggregator] is a special gateway that implements both xref:api:crosschain.adoc#IERC7786GatewaySource[IERC7786GatewaySource] and xref:api:crosschain.adoc#IERC7786Receiver[IERC7786Receiver] interfaces. It provides a way to send messages across multiple bridges simultaneously and ensures message delivery through a threshold-based confirmation system.
89
+
The xref:api:crosschain.adoc#ERC7786OpenBridge[ERC7786OpenBridge] is a special gateway that implements both xref:api:crosschain.adoc#IERC7786GatewaySource[IERC7786GatewaySource] and xref:api:crosschain.adoc#IERC7786Receiver[IERC7786Receiver] interfaces. It provides a way to send messages across multiple bridges simultaneously and ensures message delivery through a threshold-based confirmation system.
90
90
91
-
The aggregator maintains a list of known gateways and a confirmation threshold. When sending a message, it broadcasts to all registered gateways, and when receiving, it requires a minimum number of confirmations before executing the message. This approach increases reliability by ensuring messages are properly delivered and validated across multiple bridges.
91
+
The bridge maintains a list of known gateways and a confirmation threshold. When sending a message, it broadcasts to all registered gateways, and when receiving, it requires a minimum number of confirmations before executing the message. This approach increases reliability by ensuring messages are properly delivered and validated across multiple bridges.
92
92
93
-
When sending a message, the aggregator tracks the message IDs from each gateway to maintain a record of the message's journey across different bridges:
93
+
When sending a message, the bridge tracks the message IDs from each gateway to maintain a record of the message's journey across different bridges:
94
94
95
95
```solidity
96
96
function sendMessage(
@@ -110,7 +110,7 @@ function sendMessage(
110
110
// send message
111
111
bytes32 id = IERC7786GatewaySource(gateway).sendMessage(
112
112
destinationChain,
113
-
aggregator,
113
+
bridge,
114
114
wrappedPayload,
115
115
attributes
116
116
);
@@ -125,7 +125,7 @@ function sendMessage(
125
125
}
126
126
```
127
127
128
-
On the receiving end, the aggregator implements a threshold-based confirmation system. Messages are only executed after receiving enough confirmations from the gateways, ensuring message validity and preventing double execution. The xref:api:crosschain.adoc#ERC7786Aggregator-executeMessage-string-string-string-bytes-bytes---[`executeMessage`] function handles this process:
128
+
On the receiving end, the bridge implements a threshold-based confirmation system. Messages are only executed after receiving enough confirmations from the gateways, ensuring message validity and preventing double execution. The xref:api:crosschain.adoc#ERC7786OpenBridge-executeMessage-string-string-string-bytes-bytes---[`executeMessage`] function handles this process:
129
129
130
130
```solidity
131
131
function executeMessage(
@@ -148,7 +148,7 @@ function executeMessage(
148
148
// if already executed, leave gracefully
149
149
if (tracker.executed) return IERC7786Receiver.executeMessage.selector;
150
150
} else if (tracker.executed) {
151
-
revert ERC7786AggregatorAlreadyExecuted();
151
+
revert ERC7786OpenBridgeAlreadyExecuted();
152
152
}
153
153
154
154
// ... Validate sender and prepare payload for execution ...
@@ -173,4 +173,4 @@ function executeMessage(
173
173
}
174
174
```
175
175
176
-
The aggregator is designed to be configurable. As an `Ownable` contract, it allows the owner to manage the list of trusted gateways and adjust the confirmation threshold. The `_gateways` list and threshold are initially set during contract deployment using the xref:api:crosschain.adoc#ERC7786Aggregator-_addGateway-address-[`++_addGateway++`] and xref:api:crosschain.adoc#ERC7786Aggregator-_setThreshold-uint8-[`++_setThreshold++`] functions. The owner can update these settings as needed to adapt to changing requirements or add new gateways.
176
+
The bridge is designed to be configurable. As an `Ownable` contract, it allows the owner to manage the list of trusted gateways and adjust the confirmation threshold. The `_gateways` list and threshold are initially set during contract deployment using the xref:api:crosschain.adoc#ERC7786OpenBridge-_addGateway-address-[`++_addGateway++`] and xref:api:crosschain.adoc#ERC7786OpenBridge-_setThreshold-uint8-[`++_setThreshold++`] functions. The owner can update these settings as needed to adapt to changing requirements or add new gateways.
0 commit comments