Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Plasma bridge update #483

Closed
wants to merge 10 commits into from
Closed

Plasma bridge update #483

wants to merge 10 commits into from

Conversation

simonDos
Copy link
Member

Plasma Bridge Modifications

The plasma bridge will be modified to bridge POL for users trying to bridge MATIC after the upgrade.

The following changes will be made:

Changes Implementation
1. The entire MATIC balance held by the bridge will be converted to POL. This also has the added benefit that there is a sufficient amount of MATIC for unmigration for the StakeManager rewards. A publicly callable function to trigger the conversion has been written for this.
2. When depositing MATIC, automatically convert it to POL on L1 and bridge MATIC

A convenience functionality has been added in _createDepositBlock, which automatically converts MATIC to POL when a user tries to bridge MATIC.

3. When depositing POL, bridge MATIC as well Is caught in the _createDepositBlock as well, changing the token address to MATIC before syncState
4. When bridging MATIC back to L1 (withdrawing), always pay out POL Additional functionality in transferAssets to pay out POL instead of MATIC

Internally, the MATIC address will still be used for all POL bridging operations, as the behaviour of the native token on the PoS side will not be modified and thus can keep operating as usual.

Addresses for the root MATIC contract, the new POL address, as well as the PolygonMigration contract will be added to the registry using updateContractMap
using “matic”, “pol” and “polygonMigration” as keys.

@simonDos simonDos requested a review from gretzke October 17, 2023 15:46
}
// new: bridge POL as MATIC, child chain behaviour does not change
else if (_token == registry.contractMap(keccak256("pol"))) {
_token == registry.contractMap(keccak256("matic"));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this should be = instead of == @simonDos ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it in the commit below and expanded the test to catch it. @dev1644

@simonDos simonDos closed this Dec 13, 2023
@simonDos simonDos deleted the plasma-bridge-update branch December 15, 2023 15:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants