Splice.GovernanceLock
FA and SV locks and the operations on them.
Templates
template GovernanceLock
Signatory: dso, owner
Field
Type
Description
dso
owner
Lock owner
amount
The amount that is locked.
lockedAmulet
specification
originalLockCid
Optional AnyContractId
requestedAt
Time of the request to create this lock.
Choice Archive
Controller: dso, owner
Returns: ()
(no fields)
Choice GovernanceLock_DsoConvertProvisionalFeaturedAppLock
Controller: dso
Returns: GovernanceLock_DsoConvertProvisionalFeaturedAppLockResult
Field
Type
Description
featuredAppRightCid
Choice GovernanceLock_DsoExpire
Garbage-collect a fully vested lock, so that SV nodes are not left storing locks that nobody has bothered to withdraw.
There is nothing to do with
lockedAmulet. Unlocking aGovernanceLockrelocks it withexpiresAt = endTime, so at the instant the vesting period completes its time-lock has expired and wallets already treat it as a liquid holding.Controller: dso
Returns: GovernanceLock_DsoExpireResult
(no fields)
Data Types
Field
Type
Description
lockCid
lock
changeHolding
instance GetField "changeHolding" FetchAndMergeLocksResult (Optional (ContractId Amulet))
instance GetField "lock" FetchAndMergeLocksResult GovernanceLock
instance GetField "lockCid" FetchAndMergeLocksResult (ContractId GovernanceLock)
instance SetField "changeHolding" FetchAndMergeLocksResult (Optional (ContractId Amulet))
instance SetField "lock" FetchAndMergeLocksResult GovernanceLock
instance SetField "lockCid" FetchAndMergeLocksResult (ContractId GovernanceLock)
Field
Type
Description
kind
instance Serializable FullLockSpecification
instance Eq FullLockSpecification
instance Show FullLockSpecification
instance GetField "fullSpecification" GovernanceLockRequest FullLockSpecification
instance GetField "kind" FullLockSpecification GovernanceLockKind
instance SetField "fullSpecification" GovernanceLockRequest FullLockSpecification
instance SetField "kind" FullLockSpecification GovernanceLockKind
data GovernanceLockKey
Field
Type
Description
dso
owner
specification
instance Serializable GovernanceLockKey
instance Eq GovernanceLockKey
instance Show GovernanceLockKey
instance GetField "dso" GovernanceLockKey Party
instance GetField "owner" GovernanceLockKey Party
instance GetField "source" GovernanceLockTransfer GovernanceLockKey
instance GetField "source" LockTransferArgs GovernanceLockKey
instance GetField "specification" GovernanceLockKey GovernanceLockSpecification
instance GetField "target" GovernanceLockRequest GovernanceLockKey
instance GetField "target" CreateSubstitutionArgs GovernanceLockKey
instance GetField "target" GovernanceLockSubstitution GovernanceLockKey
instance SetField "dso" GovernanceLockKey Party
instance SetField "owner" GovernanceLockKey Party
instance SetField "source" GovernanceLockTransfer GovernanceLockKey
instance SetField "source" LockTransferArgs GovernanceLockKey
instance SetField "specification" GovernanceLockKey GovernanceLockSpecification
instance SetField "target" GovernanceLockRequest GovernanceLockKey
instance SetField "target" CreateSubstitutionArgs GovernanceLockKey
instance SetField "target" GovernanceLockSubstitution GovernanceLockKey
instance HasExerciseByKey GovernanceLock GovernanceLockKey GovernanceLock_DsoConvertProvisionalFeaturedAppLock GovernanceLock_DsoConvertProvisionalFeaturedAppLockResult
instance HasExerciseByKey GovernanceLock GovernanceLockKey GovernanceLock_DsoExpire GovernanceLock_DsoExpireResult
instance HasExerciseByKey GovernanceLock GovernanceLockKey Archive ()
instance HasFetchByKey GovernanceLock GovernanceLockKey
instance HasKey GovernanceLock GovernanceLockKey
instance HasLookupByKey GovernanceLock GovernanceLockKey
instance HasLookupNByKey GovernanceLock GovernanceLockKey
instance HasMaintainer GovernanceLock GovernanceLockKey
data GovernanceLockKind
Field
Type
Description
provider
Featured app provider party.
Field
Type
Description
provider
Provisional featured app provider party.
Field
Type
Description
svName
Name of the SV rights owner for whom the funds are locked.
instance Serializable GovernanceLockKind
instance Eq GovernanceLockKind
instance Show GovernanceLockKind
instance GetField "kind" FullLockSpecification GovernanceLockKind
instance GetField "kind" VestingLockSpecification GovernanceLockKind
instance GetField "provider" GovernanceLockKind Party
instance GetField "svName" GovernanceLockKind Text
instance SetField "kind" FullLockSpecification GovernanceLockKind
instance SetField "kind" VestingLockSpecification GovernanceLockKind
instance SetField "provider" GovernanceLockKind Party
instance SetField "svName" GovernanceLockKind Text
data GovernanceLockSpecification
GLS_FullLock FullLockSpecification
GLS_VestingLock VestingLockSpecification
instance Serializable GovernanceLockSpecification
instance Eq GovernanceLockSpecification
instance Show GovernanceLockSpecification
instance GetField "specification" GovernanceLock GovernanceLockSpecification
instance GetField "specification" GovernanceLockKey GovernanceLockSpecification
instance GetField "specification" GovernanceLockRequest GovernanceLockSpecification
instance SetField "specification" GovernanceLock GovernanceLockSpecification
instance SetField "specification" GovernanceLockKey GovernanceLockSpecification
instance SetField "specification" GovernanceLockRequest GovernanceLockSpecification
data GovernanceLockTag
data GovernanceLock_DsoConvertProvisionalFeaturedAppLockResult
GovernanceLock_DsoConvertProvisionalFeaturedAppLockResult
(no fields)
instance Serializable GovernanceLock_DsoConvertProvisionalFeaturedAppLockResult
instance HasExercise GovernanceLock GovernanceLock_DsoConvertProvisionalFeaturedAppLock GovernanceLock_DsoConvertProvisionalFeaturedAppLockResult
instance HasExerciseByKey GovernanceLock GovernanceLockKey GovernanceLock_DsoConvertProvisionalFeaturedAppLock GovernanceLock_DsoConvertProvisionalFeaturedAppLockResult
instance HasFromAnyChoice GovernanceLock GovernanceLock_DsoConvertProvisionalFeaturedAppLock GovernanceLock_DsoConvertProvisionalFeaturedAppLockResult
instance HasToAnyChoice GovernanceLock GovernanceLock_DsoConvertProvisionalFeaturedAppLock GovernanceLock_DsoConvertProvisionalFeaturedAppLockResult
data GovernanceLock_DsoExpireResult
GovernanceLock_DsoExpireResult
The
GovernanceLock_DsoExpirechoice doesn’t return anything because an SV trigger that cleans up expired vesting locks doesn’t care to do anything with the now unlockedlockedAmulet.(no fields)
instance Serializable GovernanceLock_DsoExpireResult
instance HasExercise GovernanceLock GovernanceLock_DsoExpire GovernanceLock_DsoExpireResult
instance HasExerciseByKey GovernanceLock GovernanceLockKey GovernanceLock_DsoExpire GovernanceLock_DsoExpireResult
instance HasFromAnyChoice GovernanceLock GovernanceLock_DsoExpire GovernanceLock_DsoExpireResult
instance HasToAnyChoice GovernanceLock GovernanceLock_DsoExpire GovernanceLock_DsoExpireResult
data GovernanceLock_DsoSplitForSubstitutionResult
GovernanceLock_DsoSplitForSubstitutionResult
Field
Type
Description
remainingLockCid
The lock that keeps the funds that were not split off, if any.
splitAmulet
The funds that were split off, locked for the new lock.
instance GetField "remainingLockCid" GovernanceLock_DsoSplitForSubstitutionResult (Optional (ContractId GovernanceLock))
instance GetField "splitAmulet" GovernanceLock_DsoSplitForSubstitutionResult (ContractId LockedAmulet)
instance SetField "remainingLockCid" GovernanceLock_DsoSplitForSubstitutionResult (Optional (ContractId GovernanceLock))
instance SetField "splitAmulet" GovernanceLock_DsoSplitForSubstitutionResult (ContractId LockedAmulet)
data GovernanceLock_DsoSubstituteResult
GovernanceLock_DsoSubstituteResult
Field
Type
Description
remainingLockCid
The lock that keeps the funds that were not substituted, if any.
unlockedAmulet
The substituted funds, returned to the owner.
instance GetField "remainingLockCid" GovernanceLock_DsoSubstituteResult (Optional (ContractId GovernanceLock))
instance GetField "unlockedAmulet" GovernanceLock_DsoSubstituteResult (ContractId Amulet)
instance SetField "remainingLockCid" GovernanceLock_DsoSubstituteResult (Optional (ContractId GovernanceLock))
instance SetField "unlockedAmulet" GovernanceLock_DsoSubstituteResult (ContractId Amulet)
data GovernanceLock_DsoTransferResult
GovernanceLock_DsoTransferResult
Field
Type
Description
remainingLockCid
The lock that keeps the funds that were not transferred, if any.
unlockedAmulet
The transferred funds, returned to the owner of the source lock.
instance GetField "remainingLockCid" GovernanceLock_DsoTransferResult (Optional (ContractId GovernanceLock))
instance GetField "unlockedAmulet" GovernanceLock_DsoTransferResult (ContractId Amulet)
instance SetField "remainingLockCid" GovernanceLock_DsoTransferResult (Optional (ContractId GovernanceLock))
instance SetField "unlockedAmulet" GovernanceLock_DsoTransferResult (ContractId Amulet)
data LockState
Field
Type
Description
kind
vestingPeriod
Duration over which the amount vests in a linear fashion.
endTime
Time at which vesting completes.
instance Serializable VestingLockSpecification
instance Eq VestingLockSpecification
instance Show VestingLockSpecification
instance GetField "endTime" VestingLockSpecification Time
instance GetField "kind" VestingLockSpecification GovernanceLockKind
instance GetField "vestingPeriod" VestingLockSpecification RelTime
instance GetField "vestingSpecification" GovernanceLockRequest VestingLockSpecification
instance SetField "endTime" VestingLockSpecification Time
instance SetField "kind" VestingLockSpecification GovernanceLockKind
instance SetField "vestingPeriod" VestingLockSpecification RelTime
instance SetField "vestingSpecification" GovernanceLockRequest VestingLockSpecification
Functions
- fetchAndMergeGovernanceLocks
: GovernanceLockKey -> ExternalPartyTransferContext -> ExternalPartyConfigState -> Text -> Update FetchAndMergeLocksResult
- governanceLock_unlockImpl
: ContractId GovernanceLock -> GovernanceLock -> Decimal -> Optional Time -> [Party] -> ExternalPartyTransferContext -> ExternalPartyConfigState -> Text -> Update GovernanceLock_UnlockResult
Unlocks
unlockAmountof a governance lock.optVestingStartTimemay only beNonefor locks which have no vesting period.
- vestingLock_withdrawImpl
: ContractId GovernanceLock -> GovernanceLock -> Time -> [Party] -> ExternalPartyTransferContext -> Text -> Update VestingLock_WithdrawResult
- calculateUnvestedAmount
: Time -> Decimal -> VestingLockSpecification -> Optional Decimal
Uses
Noneto represent that no amount remains.
- governanceLock_lockForGovernance_impl
: Party -> Decimal -> [ContractId Holding] -> FullLockSpecification -> ExtraArgs -> Party -> Time -> Text -> Update (GovernanceLock, ContractId GovernanceLock, Optional (ContractId Amulet))
Create a
GovernanceLock, used by the core implementation of token standard interfaces.
- governanceLock_dsoSubstituteImpl
: ForOwner -> ContractId GovernanceLock -> Decimal -> Text -> ExtraArgs -> Update GovernanceLock_DsoSubstituteResult
Release
substitutedAmountof the locked funds to the owner as part of an approved substitution. Only the accept step of aGovernanceLockSubstitutioncalls this.
- governanceLock_dsoSplitForSubstitutionImpl
: ForOwner -> ContractId GovernanceLock -> Decimal -> GovernanceLockSpecification -> Text -> ExtraArgs -> Update GovernanceLock_DsoSplitForSubstitutionResult
Split
splitAmountof the locked funds off into aLockedAmuletfor a new lock withnewSpecification, as part of an approved substitution proposed by the owner of this lock. Only the accept step of aGovernanceLockSubstitutioncalls this.
- unfeaturedPaymentContextAndConfigFromChoiceContext
: Party -> ChoiceContext -> Update (ExternalPartyTransferContext, ExternalPartyConfigState)
- governanceLock_dsoTransferImpl
: ForOwner -> ContractId GovernanceLock -> Decimal -> Text -> ExtraArgs -> Update GovernanceLock_DsoTransferResult
Release
transferredAmountof the locked funds as part of an approved transfer. The accept step of aGovernanceLockTransfercalls this, and locks the unlocked funds again for the receiver, as only that step has the receiver’s authority.
- unlockAmulet
: ForOwner -> ContractId LockedAmulet -> Update (ContractId Amulet, LockSpecification)
- lockAmulet
: ForOwner -> [LockSpecification] -> [ContractId Holding] -> ExternalPartyTransferContext -> Text -> Update ([ContractId LockedAmulet], Optional (ContractId Amulet))
- lockAmuletFor
: ForOwner -> Party -> [LockSpecification] -> [ContractId Holding] -> ExternalPartyTransferContext -> Text -> Update ([ContractId LockedAmulet], Optional (ContractId Amulet))
Locks
specsforreceiver, funded by theholdingInputsof the owner.reasonis the memo of the request being handled, which the transfer legs report as their reason.
- cipMetaPrefix
: Text
Prefix of the metadata keys used to pass extra choice parameters.
- cipMemoPrefix
: Text
Prefix of the memo tag used to specify lock attributes.
- requestMetaKey
: Text
Metadata key that specifies the requested lock operation.
- unlockAmountMetaKey
: Text
Metadata key of a
GovernanceLockunlock that specifies how much to unlock.
- transferAmountMetaKey
: Text
Metadata key specifies how much of a lock to transfer.
- lockKindMetaKey
: Text
Metadata key of a
GovernanceLockkind.
- lockSubjectMetaKey
: Text
Metadata key of a
GovernanceLocksubject.
- lockStatusMetaKey
: Text
Metadata key that specifies the status of a lock.
- vestingStartTimeMetaKey
: Text
Metadata key that specifies the time at which vesting should start.
- vestedUntilTimeMetaKey
: Text
Metadata key that specifies the time as of which vested funds should be computed and withdrawn.
- lockVestingDurationMetaKey
: Text
Metadata key that specifies the duration of a vesting
GovernanceLock.
- lockVestingEndTimeMetaKey
: Text
Metadata key that specifies the end time of a vesting
GovernanceLock.
- newLockOwnerMetaKey
: Text
Metadata key that specifies the new owner of a transferred lock.
- targetLockOwnerMetaKey
: Text
Metadata key that specifies the owner of a target lock.
- encodeCommonLockMetadataEntries
: GovernanceLockKind -> LockState -> [(Text, Text)]
The metadata entries of the kind, subject and status of a lock, in the order of the CIP.
- encodeGovernanceLockMetadataWithRequest
: Text -> GovernanceLockSpecification -> Metadata
- encodeLockCompatMemo
-
The memo of the given metadata entries. It keeps the order of the entries, so that wallets show the memos as the CIP writes them.
- lockManagerParty
: Party
Special party used to identify lock transfers.
Comments