Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement constraint as class #470

Open
waalge opened this issue May 22, 2022 · 0 comments
Open

Reimplement constraint as class #470

waalge opened this issue May 22, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@waalge
Copy link

waalge commented May 22, 2022

Describe the feature you'd like

I like the idea of using constraints. I really want to use statemachines. But I don't understand numerous bits of the code.

FR : Implement Constraint as a class and allow me to write my own instances.

Describe alternatives you've considered

For example https://github.com/input-output-hk/plutus-apps/blob/37c54aac5e2c6f765a6fff2503447b8ad0c0d259/plutus-ledger-constraints/src/Ledger/Constraints/OnChain.hs#L117
Its pretty suggestive that the mustPayToScriptAddress constraint does actually check the staking address. It doesn't seem to.
4 lines later choice of variable name svh is suggestive that its stake validator hash but its actually the datum hash.
There's convoluted logic around minAda which is likely well motivated but given that minAda is hard coded to 2 Ada ... this is gonna be pretty hit or miss on-chain with multiple native assets.

Can i fix this without maintaining my own fork? At the moment I don't think so.

Would fixing this be the end of this issue? Likely not.
As with the introduction of TxConstraintFun (I assume), there will be logic expressible as constraints, generally, but not expressible by an existing fixed list.

@waalge waalge added the enhancement New feature or request label May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant