Skip to content

Distributor API to add major version migration  #14

@peersky

Description

@peersky

Add new interface & abstract implementation to Distributor contract to configure #16 . It:

  • Takes arguments:
    • distributionId
    • old version requirements
    • new version requirements
    • migrationContract address
    • Migration strategy when upgrade requested, Enum:
      • CALL:
      • DELEGATECALL:
        • let migration contract handle and execute migration on behalf of distributor.
        • Check ERC165 compatibility with interface defined in Migration contract API #15
        • If migrationContract is zero call implementation instead
        • use signature from Major release migration data #11 specified calldata appended with user arguments.
      • REPOSITORY_MANGED:
        • use delegatecall using calldata specified in Major release migration data #11.
        • callmigrationContract, if address is zero call implementation instead
        • if version increment is more than one, iterate trough
        • Revert if if version is downgraded
  • Stores migration info: (migrationContract, both requirements) as hashmap where key is hash(distributionId,strategy,migrationContract)
  • Emits events:
    • MigrationContractAddedFromVersions(uint256 indexed oldRequirementBase, uint8 indexed oldRequirement, address migrationContract, uint8 strategy)
    • MigrationContractAddedToVersions(uint256 indexed newVersionsBase, uint8 indexed newRequirement, address migrationContract, uint8 strategy)

Add interface implementation to ownable distributor contract. It:

  • Can add migration contract only by owner

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions