This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 506
Plasma bridge update #483
Closed
Closed
Plasma bridge update #483
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f3af417
RFC220 matic migration
simonDos e041d76
new behaviour for POL integration
simonDos 116bed5
gas optimisation
simonDos d90805d
add DepositManager update script
simonDos a2b6042
fix token assignment
simonDos a7d9144
use POL mock
simonDos 0cd521b
add depositBulk test, mapToken
simonDos 8ec76f0
Merge pull request #493 from maticnetwork/fix/depositBulk
simonDos 4e32c3d
gas optimisation
simonDos e6a5e74
delete comment
simonDos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.5.2; | ||
|
||
import {IERC20} from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; | ||
import {SafeERC20} from "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; | ||
|
||
// this impl was shortened for testing purposes | ||
// full impl at https://github.com/0xPolygon/indicia/blob/main/src/PolygonMigration.sol | ||
contract PolygonMigrationTest { | ||
using SafeERC20 for IERC20; | ||
|
||
event Migrated(address indexed account, uint256 amount); | ||
|
||
IERC20 public polygon; | ||
IERC20 public matic; | ||
|
||
function setTokenAddresses(address matic_, address polygon_) external { | ||
if (matic_ == address(0)) revert(); | ||
matic = IERC20(matic_); | ||
|
||
if (polygon_ == address(0)) revert(); | ||
polygon = IERC20(polygon_); | ||
} | ||
|
||
/// @notice This function allows for migrating MATIC tokens to POL tokens | ||
/// @dev The function does not do any validation since the migration is a one-way process | ||
/// @param amount Amount of MATIC to migrate | ||
function migrate(uint256 amount) external { | ||
emit Migrated(msg.sender, amount); | ||
|
||
matic.safeTransferFrom(msg.sender, address(this), amount); | ||
polygon.safeTransfer(msg.sender, amount); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 ?There was a problem hiding this comment.
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