-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add update_to_l2 command #292
Conversation
Uxio0
commented
Nov 3, 2023
•
edited
Loading
edited
- Updates a v1.1.1/v1.3.0/v1.4.1 non L2 Safe to a L2 Safe supported by Safe Wallet UI. The migration contract address needs to be provided. It can be found here.
- Nonce for the Safe must be 0 and supported versions are v1.1.1, v1.3.0 and v1.4.1.
- Related to Support L2 Safes upgraded from non L2 Safes safe-transaction-service#1703
- Closes Add migration upgrade from non L2 Safes to L2 Safes #285
Updates a v1.1.1/v1.3.0/v1.4.1 non L2 Safe to a L2 Safe supported by Safe Wallet UI. The migration contract address needs to be provided. It can be found [here](https://github.com/safe-global/safe-contracts/blob/main/contracts/libraries/SafeToL2Migration.sol). Nonce for the Safe must be 0 and supported versions are v1.1.1, v1.3.0 and v1.4.1.
if self.safe.retrieve_nonce() > 0: | ||
raise InvalidNonceException("Nonce must be 0 for non L2 to L2 migration") | ||
|
||
if safe_version == "1.1.1": |
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.
In case of 1.1.1 the idea is to update to 1.3.0 L2?
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.
Yes, there's no 1.1.1 L2
@@ -0,0 +1,165 @@ | |||
safe_to_l2_migration = { | |||
"_format": "hh-sol-artifact-1", | |||
"contractName": "SafeToL2Migration", |
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.
Maybe can be better move this file to a contracts folder, utils is very generic.
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.
Yes, I'm thinking that this might belong to safe-eth-py
|
||
if not self.ethereum_client.is_contract(migration_contract_address): | ||
raise InvalidMigrationContractException( | ||
f"Non L2 to L2 migration contract {migration_contract_address} is not deployed" |
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.
I think that is not necessary specify the origin contract, for me is more clear
f"Non L2 to L2 migration contract {migration_contract_address} is not deployed" | |
f"L2 migration contract {migration_contract_address} is not deployed" |
}, | ||
} | ||
}, | ||
): |
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.
Very nice :)