morley-upgradeable-0.3: Upgradeability infrastructure based on Morley.
Safe HaskellNone
LanguageHaskell2010

Lorentz.Contracts.UserUpgradeable.V2

Description

The second version of a minimal user-upgradeable ledger. This version is not designed to be upgraded further — it lacks InitiateMigration and MigrateMyTokens entrypoints. However, it has MigrateFrom (callable from V1), and mints new tokens when a user calls V1.MigrateMyTokens. Other functions (either upgradeability-related or standard Transfer/GetTotalSupply may be added if deemed desirable).

Note that the naming in this module is different from Lorentz.Contracts.Upgradeable: by "migration" here we mean the process of transferring the value from an old contract to the new one rather than applying a transformation to storage. Thus, MigrationScript here is a lambda that forges an operation to migrate user's funds rather than a function that upgrades storage in-place.

Documentation

data Parameter Source #

Constructors

MigrateFrom (Address, Natural)

When called by V1, mints new tokens to Address

GetBalance (View Address Natural)

Returns the balance of a holder.

Instances

Instances details
Generic Parameter Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

Associated Types

type Rep Parameter :: Type -> Type #

ParameterHasEntrypoints Parameter Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

IsoValue Parameter Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

Associated Types

type ToT Parameter :: T #

type Rep Parameter Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

type Rep Parameter = D1 ('MetaData "Parameter" "Lorentz.Contracts.UserUpgradeable.V2" "morley-upgradeable-0.3-inplace" 'False) (C1 ('MetaCons "MigrateFrom" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Address, Natural))) :+: C1 ('MetaCons "GetBalance" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (View Address Natural))))
type ParameterEntrypointsDerivation Parameter Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

type ToT Parameter Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

data Storage Source #

Constructors

Storage 

Fields

Instances

Instances details
Generic Storage Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

Associated Types

type Rep Storage :: Type -> Type #

Methods

from :: Storage -> Rep Storage x #

to :: Rep Storage x -> Storage #

HasAnnotation Storage Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

IsoValue Storage Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

Associated Types

type ToT Storage :: T #

type Rep Storage Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

type Rep Storage = D1 ('MetaData "Storage" "Lorentz.Contracts.UserUpgradeable.V2" "morley-upgradeable-0.3-inplace" 'False) (C1 ('MetaCons "Storage" 'PrefixI 'True) (S1 ('MetaSel ('Just "ledger") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map Address Natural)) :*: (S1 ('MetaSel ('Just "previousVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (TAddress Parameter))) :*: S1 ('MetaSel ('Just "migrationTarget") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe MigrationTarget)))))
type ToT Storage Source # 
Instance details

Defined in Lorentz.Contracts.UserUpgradeable.V2

Orphan instances