Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

Vesting use case succeeds even if validator is set to True #942

@locallycompact

Description

@locallycompact

Summary

applying this diff

@@ -131,21 +131,7 @@ remainingFrom t@VestingTranche{vestingTrancheAmount} range =
 {-# INLINABLE validate #-}
 validate :: VestingParams -> () -> () -> V2.ScriptContext -> Bool
 validate VestingParams{vestingTranche1, vestingTranche2, vestingOwner} () () ctx@V2.ScriptContext{scriptContextTxInfo=txInfo@TxInfo{txInfoValidRange}} =
-    let
-        remainingActual  = V2.valueLockedBy txInfo (V2.ownHash ctx)
-
-        remainingExpected =
-            remainingFrom vestingTranche1 txInfoValidRange
-            + remainingFrom vestingTranche2 txInfoValidRange
-
-    in remainingActual `Value.geq` remainingExpected
-            -- The policy encoded in this contract
-            -- is "vestingOwner can do with the funds what they want" (as opposed
-            -- to "the funds must be paid to vestingOwner"). This is enforcey by
-            -- the following condition:
-            && V2.txSignedBy txInfo (unPaymentPubKeyHash vestingOwner)
-            -- That way the recipient of the funds can pay them to whatever address they
-            -- please, potentially saving one transaction.
+       True

 vestingScript :: VestingParams -> Validator
 vestingScript = Scripts.validatorScript . typedValidator

still makes all the tests for this use case pass

Steps to reproduce the behavior

apply the diff

Actual Result

doesn't work

Expected Result

should work

Describe the approach you would take to fix this

No response

System info

nixos

Metadata

Metadata

Assignees

No one assigned

    Labels

    TrackedIssue is tracked in our internal backlogenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions