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

Redeploy contracts from the same deployer #59

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Conversation

fedgiac
Copy link
Contributor

@fedgiac fedgiac commented Jan 21, 2025

There have been instances of a user sending ETH to the ETH-flow address in the wrong network, which has a high chance of making the funds completely unrecoverable.

To reduce concerns of this kind, the ETH-flow contract has been redeployed to the same address on all supported chains. There is still a risk when sending a transaction for a network to another one, but in many cases the order should just expire and the refunder should eventually reimburse the user. Note that the deployed contract doesn't use CREATE2, meaning that there's no guarantee that the contract at the target address is indeed the ETH-flow contract code.

I also added the standard json representation of the solc input (and successfully tested it). If Etherscan verification through the verification script fails (unfortunately, a common occurrence) it should be possible to give verification another shot through the Etherscan web interface.

How to test

Confirm that the barn deployment (0x04501b9b1d52e67f6862d157e00d13419d2d6e95) and the prod one (0xba3cb449bd2b4adddbc894d8697f5170800eadec) exist on all networks, that their contract code is verified matches the ETH flow, and that the deployment parameters are the expected ones.

@fedgiac fedgiac requested review from anxolin and sunce86 January 21, 2025 16:57
@fedgiac fedgiac requested a review from a team as a code owner January 21, 2025 16:57
Copy link

@bh2smith bh2smith left a comment

Choose a reason for hiding this comment

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

Looks legit.

Copy link

@anxolin anxolin left a comment

Choose a reason for hiding this comment

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

Nice job. Thanks a lot! In principle looks good.

I tried to validate. I was kind of expecting the same bytecode, but they differ by a few bytes.
I saw in Etherscan they both use the same compiler version and they both have optimizations enabled, the only difference is some flags (london EvmVersion, GNU GPLv3 license vs default evmVersion, so maybe there's a slight different).

Probably not a big deal, just let me know if I should test any further.

...
0667358221220dd6ac68dca08d6be1c4da0e828b663868839c2a8d206f54f6cae8f64c576247564736f6c63430008100033

vs

0667358221220ef8802913dc7f390c98427b120eee077bb04d92ea672807f56839d2e432db81764736f6c63430008100033

I checked the contract in the networks, and the settlement and wrapped native token look correct to me, so I give a soft approve, but let me know if we are aiming for the same bytecode or how should I easily test is the same thing.

@fedgiac
Copy link
Contributor Author

fedgiac commented Jan 24, 2025

I tried to validate. I was kind of expecting the same bytecode, but they differ by a few bytes.
I saw in Etherscan they both use the same compiler version and they both have optimizations enabled, the only difference is some flags (london EvmVersion, GNU GPLv3 license vs default evmVersion, so maybe there's a slight different).

I'd have generally expected the same bytecode. I compared the contract bytecode with the existing deployment and and they only differ in the Solidity metadata.

I debugged it a bit by checking the rawMetadata field of the compiled output with the metadata of the v1.0.0 artifacts and they only differ for one of the imported libraries:

image

Doing the same for that library, you can see that the only thing that changes is the hash of that file. What I think at this point is that the different metadata come from the comment change from commit dc93358.

This is confirmed by the fact that the comment change happened before the Base deployment, and indeed comparing the Base deployment bytecode (old, new) shows that the two are indeed the same.

I believe it's ok to keep the new deployment as they are without a perfect bytecode match.

@anxolin
Copy link

anxolin commented Jan 28, 2025

@fedgiac amazing explanation! thanks for this. It looks all good to me

@fedgiac fedgiac merged commit e1817b3 into main Feb 6, 2025
5 checks passed
@fedgiac fedgiac deleted the redeploy-contracts branch February 6, 2025 16:12
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2025
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.

3 participants