Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrateTo #67

Closed
wants to merge 2 commits into from
Closed

feat: migrateTo #67

wants to merge 2 commits into from

Conversation

simonDos
Copy link
Member

Add migrateTo function to PolygonMigration contract.

@simonDos simonDos marked this pull request as ready for review October 31, 2024 10:50
@simonDos simonDos requested a review from a team as a code owner October 31, 2024 10:50
Copy link

@web3security web3security left a comment

Choose a reason for hiding this comment

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

My

@@ -51,6 +51,14 @@ contract PolygonMigration is Ownable2StepUpgradeable, IPolygonMigration {
polygon.safeTransfer(msg.sender, amount);
}

/// @inheritdoc IPolygonMigration
function migrateTo(address recipient, uint256 amount) external {
emit Migrated(msg.sender, amount);
Copy link

@web3security web3security Nov 6, 2024

Choose a reason for hiding this comment

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

Just wondering whether or not we should follow the same standard used by Unmigrated where we do have both the origin account and recipient as part of the event

event Unmigrated(address indexed account, address indexed recipient, uint256 amount);

We should probably create a new event following the same pattern for MigrationTo in order to capture "msg.sender vs. recipient information" to differentiate from a normal migrate function.

wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

agreed and added.

src/PolygonMigration.sol Show resolved Hide resolved
Copy link

sonarcloud bot commented Nov 10, 2024

/// @param amount the amount of MATIC that was migrated
event Migrated(address indexed account, uint256 amount);
event Migrated(address indexed account, address recipient, uint256 amount);
Copy link

@web3security web3security Nov 11, 2024

Choose a reason for hiding this comment

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

Hi, thanks. I'd suggest we confirm if this event signature "change" is breaking any known relevant event listeners to agree on the best way to mitigate its impact (i.e. sometimes we do recommend to create new events instead).

Copy link

@web3security web3security left a comment

Choose a reason for hiding this comment

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

Let's just check the event signature change likely breaking any relevant listener to decide whether or not it is better to add a new event for this "migrateTo". The rest LGTM. Thanks!

@simonDos simonDos changed the base branch from dev to staging December 6, 2024 16:19
@simonDos simonDos changed the base branch from staging to dev December 6, 2024 16:19
@simonDos simonDos closed this Dec 6, 2024
@simonDos simonDos mentioned this pull request Dec 6, 2024
@simonDos simonDos deleted the feature/migrateTo branch December 6, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants