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
Copy file name to clipboardExpand all lines: docs/pos/how-to/bridging/ethereum-polygon/ethereum-to-matic.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,15 @@ The Sender and Receiver contract are required to be mapped on Ethereum — [Stat
12
12
13
13
---
14
14
15
-
In the following walkthrough, we'll be deploying a Sender contract on Goerli (Ethereum testnet) and a Receiver contract on Mumbai (Polygon's testnet) and then we'll be sending data from Sender and reading data on Receiver via web3 calls in a node script.
15
+
In the following walkthrough, we'll be deploying a Sender contract on Sepolia (Ethereum testnet) and a Receiver contract on Amoy (Polygon testnet). Then, we'll be sending data from Sender and reading data on Receiver via web3 calls in a node script.
16
16
17
17
### 1. Deploy Sender contract
18
18
19
19
The sole purpose of Sender contract is to be able to call [syncState](https://github.com/maticnetwork/contracts/blob/e999579e9dc898ab6e66ddcb49ee84c2543a9658/contracts/root/stateSyncer/StateSender.sol#L33) function on the StateSender contract — which is Matic's state syncer contract - the StateSynced event of which Heimdall is listening to.
20
20
21
21
Deployed at:
22
22
23
-
`0xEAa852323826C71cd7920C3b4c007184234c3945` on Goerli
23
+
`0x49E307Fa5a58ff1834E0F8a60eB2a9609E6A5F50` on Sepolia
24
24
25
25
`0x28e4F3a7f651294B9564800b2D01f35189A5bFbE` on Ethereum Mainnet
26
26
@@ -48,7 +48,7 @@ function sendState(bytes calldata data) external {
48
48
}
49
49
```
50
50
51
-
In the above function, `stateSenderContract` is the address of the StateSender on the network you'll be deploying `Sender` on. (eg., we'll be using `0xEAa852323826C71cd7920C3b4c007184234c3945` for Goerli), and `receiver` is the contract that will receive the data we send from here.
51
+
In the above function, `stateSenderContract` is the address of the StateSender on the network you'll be deploying `Sender` on. (eg., we'll be using `0x49E307Fa5a58ff1834E0F8a60eB2a9609E6A5F50` for Sepolia), and `receiver` is the contract that will receive the data we send from here.
52
52
53
53
It is recommended to use constructors to pass in variables, but for the purpose of this demo, we'll simply hardcode these two addresses:
54
54
@@ -113,7 +113,7 @@ contract receiver {
113
113
114
114
The function simply assigns the last received State Id and data to variables. [StateId](https://github.com/maticnetwork/contracts/blob/239a91045622ddcf9ebec2cec81fdc6daa3a33e3/contracts/root/stateSyncer/StateSender.sol#L36) is a simple unique reference to the transferred state (a simple counter).
115
115
116
-
Deploy your Receiver.sol on Polygon's testnet and keep a note of the address and ABI
116
+
Deploy your `Receiver.sol` to Amoy testnet and keep a note of the address and ABI
117
117
118
118
### 3. Getting your Sender and Receiver mapped
119
119
@@ -133,7 +133,7 @@ We'll first initialise our web3 objects, wallet to make the transactions and con
Copy file name to clipboardExpand all lines: docs/pos/how-to/bridging/ethereum-polygon/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
Polygon brings you a trustless two-way transaction channel between Polygon PoS and Ethereum by introducing the cross-chain bridge. The official bridge allows you to transfer tokens between Ethereum and Polygon PoS without incurring third-party risks and market liquidity limitations.
2
2
3
-
The official bridge is available on both Mumbai Testnet as well as Polygon PoS Mainnet, and provides a near-instant, low-cost, and flexible bridging option for both users and dApp developers. You can access it and bridge assets from Ethereum over to Polygon PoS using [Polygon Portal](https://portal.polygon.technology).
3
+
The official bridge is available on both PoS Amoy testnet as well as mainnet, and provides a near-instant, low-cost, and flexible bridging option for both users and dApp developers. You can access it and bridge assets from Ethereum over to Polygon PoS using [Polygon Portal](https://portal.polygon.technology).
Copy file name to clipboardExpand all lines: docs/pos/how-to/bridging/ethereum-polygon/matic-to-ethereum.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ comments: true
4
4
5
5
Mechanism for transferring data from Polygon to Ethereum is a little different from doing the same for Ethereum to Polygon. The **checkpoint** transactions created by the Validators on the Ethereum chain are used for achieving this. Basically a transaction is initially created on Polygon. While creating this transaction it has to be ensured that an **event is emitted** and the **event logs includes the data we wish to transfer** from Polygon to Ethereum.
6
6
7
-
In a period of time (about 10-30 mins), this transaction is check-pointed on the Ethereum chain by the validators. Once checkpointing is done, the hash of the transaction created on the Polygon chain can be submitted as a proof on the **RootChainManager** contract on the Ethereum chain. This contract, validates the transaction, verifies that this transaction is included in the checkpoint and finally decodes the event logs from this transaction.
7
+
In a period of time (about 10-30 mins), this transaction is check-pointed on the Ethereum chain by the validators. Once checkpointing is done, the hash of the transaction created on the Polygon chain can be submitted as a proof on the **RootChainManager** contract on the Ethereum chain. This contract, validates the transaction, verifies that this transaction is included in the checkpoint and finally decodes the event logs from this transaction.
8
8
9
9
Once this phase is over, we can use the **decoded event log data to perform any change** on the root contract deployed on the Ethereum chain. For this we also need to ensure that, the change of state on Ethereum is only done in a secure way. Hence, we make use of a **Predicate** contract which is a special type of contract that can be only triggered by the **RootChainManager** contract. This architecture ensures that the state changes on Ethereum happens only when the transaction on Polygon is check pointed and verified on the Ethereum chain by the **RootChainManager** contract.
0 commit comments