Skip to content

Use input asset to determine option covenent type #2

@roconnor-blockstream

Description

@roconnor-blockstream

Describe the feature

Notice that the current input asset type to the funding covenant must be either a Grantor Token Generator or a Option Token Generator. The current input asset type to the settlement covenant must be a Target Asset type. For the other Collateral Covenant operations (expire, cancel, and exercise) the current input asset must be a Collateral Asset type. (If the current input asset type is none of these, then the contract is being used in error, and may as well make it anyone can spend, i.e. nothing enforced.)

Therefore much of the witness path can be eliminated in favour of checking the input asset type. That leaves only a choice between expire, cancel, and exercise in case the current asset input type is of Collateral type.

If you wish to get a bit more fancy, you may notice that the expire and cancel operations are nearly identical. You could merge them into a single cancel operation that requires a Grantor Tokens to be burned, and also requires the same number of Option Tokens be burned or not, depending on if the timelock has been set to past the expiry time or not.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions