safe-global / safe-smart-account

Safe allows secure management of blockchain assets.
https://safe.global
GNU Lesser General Public License v3.0
1.84k stars 907 forks source link

Feature: 1.5.0 Migration #652

Closed mmv08 closed 11 months ago

mmv08 commented 1 year ago

This PR focuses on adding a new migration contract for Safe Upgrade to version 1.5.0. The notable changes include:

The functions available in Safe150Migration.sol are:

  1. constructor(): Initializes the migrationSingleton with the contract's own address.
  2. migrateSingleton(): Migrates to Safe 1.5.0 Singleton (L1) at SAFE_150_SINGLETON.
  3. migrateWithFallbackHandler(): Migrates and sets the fallback handler to Safe 1.5.0 Compatibility Fallback Handler.
  4. migrateWithSetGuard(address guard): Migrates and sets the guard to the specified address.
  5. migrateWithSetGuardAndFallbackHandler(address guard): Migrates, sets the guard to the specified address, and sets the fallback handler to Safe 1.5.0 Compatibility Fallback Handler.
  6. migrateL2Singleton(): Migrates to Safe 1.5.0 Singleton (L2) at SAFE_150_SINGLETON_L2.
  7. migrateL2WithFallbackHandler(): Migrates to Safe 1.5.0 Singleton (L2) and sets the fallback handler to Safe 1.5.0 Compatibility Fallback Handler.
  8. migrateL2WithSetGuard(address guard): Migrates to Safe 1.5.0 Singleton (L2) and sets the guard to the specified address.
  9. migrateL2WithSetGuardAndFallbackHandler(address guard): Migrates to Safe 1.5.0 Singleton (L2), sets the guard to the specified address, and sets the fallback handler to Safe 1.5.0 Compatibility Fallback Handler.
  10. getGuard(): Gets the address of the current guard.
  11. isContract(address account): Checks whether an Ethereum address corresponds to a contract or an externally owned account (EOA).
mmv08 commented 1 year ago

As the 1.5.0 is not finalized I created a follow-up issue: https://github.com/safe-global/safe-contracts/issues/653

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 6274960393


Totals Coverage Status
Change from base Build 6233603447: 1.3%
Covered Lines: 371
Relevant Lines: 391

💛 - Coveralls
mmv08 commented 1 year ago

Question: Should we revisit the 1.4.1 migration contract and add the same checks as here that the address stored in the slot 0 is a contract?