<p>This happens because 1 slot is not enough to meet the interval when using <code>Constraints.mustValidateIn</code>.</p>
<p>Check this post for more information on why that happens: <a href="https://cardano.stackexchange.com/questions/3672/constraints-mustvalidatein-in-a-statemachine">Constraints.mustValidateIn in a StateMachine</a></p>

CC BY-SA 4.0
2022-11-06T02:31:29.757Z
2022-11-06T02:31:29.757Z
Falcon Stakepool
<p>This is about Week3/Homework1 of the third Plutus-Pioneer-Program.</p>
<p>Why does the grab endpoint need two slots to resolve and release the funds back to the wallet1?</p>
<ol>
<li><p>This will not create a transaction
<a href="https://i.sstatic.net/LWiDq.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LWiDq.png" alt="Wait for 1 slot after the grab endpoint was called" /></a></p>
</li>
<li><p>This will create the transaction</p>
</li>
</ol>
<p><a href="https://i.sstatic.net/Cg0D4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Cg0D4.png" alt="Wait for 2 slots after the grab endpoint was called" /></a></p>
<p><a href="https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week03/src/Week03/Homework1.hs" rel="nofollow noreferrer">Code to the contract</a></p>

CC BY-SA 4.0
2022-01-31T12:49:55.067Z
A hunch: maybe because of Constraints.mustValidateIn? Try changing/removing that and see what happens.
Sjoerd Visscher
<plutus-pioneer-program>
Why does the grab function in the vesting contract need two slots to complete?
# Why does the grab function in the vesting contract need two slots to complete?

(Asked by: username_0 on 2022-01-30)

This is about Week3/Homework1 of the third Plutus-Pioneer-Program.

Why does the grab endpoint need two slots to resolve and release the funds back to the wallet1?

1. This will not create a transaction
   [![Wait for 1 slot after the grab endpoint was called](https://i.sstatic.net/LWiDq.png)](https://i.sstatic.net/LWiDq.png)
2. This will create the transaction

[![Wait for 2 slots after the grab endpoint was called](https://i.sstatic.net/Cg0D4.png)](https://i.sstatic.net/Cg0D4.png)

[Code to the contract](https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week03/src/Week03/Homework1.hs)

**Tags:** plutus-pioneer-program
> **Comments:**
> **username_1**: A hunch: maybe because of Constraints.mustValidateIn? Try changing/removing that and see what happens.  

---

## 1 answers

### Answer by username_2 on 2022-11-06. Score: 1

This happens because 1 slot is not enough to meet the interval when using `Constraints.mustValidateIn`.

Check this post for more information on why that happens: [Constraints.mustValidateIn in a StateMachine](https://cardano.stackexchange.com/questions/3672/constraints-mustvalidatein-in-a-statemachine)


---

