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

Allow Datums and Redeemers for multiple validator scripts in a contract #17

Open
MitchTurner opened this issue Aug 14, 2022 · 0 comments

Comments

@MitchTurner
Copy link
Collaborator

MitchTurner commented Aug 14, 2022

Right now, my contracts are generic for just 1 type of datum and 1 type of redeemer. Granted, these can be enums, but, importantly, this still only allows 1 Validator per contract.

That's a bad constraint.

I want, at the very least, to provide a pattern to allow a contract writer to include multiple validator scripts in their contract. It might be as simple as doing nested datums and having one off-chain datum type that will hold the necessary on-chain datums, but we should make sure that this can be type checked before submission.

enum MyDatums {
    ValidatorA(ValidatorADatum),
    ValidatorB(ValidatorBDatum),
}

enum MyValidators {
    ValidatorA(ValidatorACode),
    ValidatorB(ValidatorBCode),
}

Something like this might work and just make the contract generic for MyDatums and your implementation will enable the matching to happen. But this is far from a pit-of-success solution for consumers. Might be a good stop-gap, since it's a less common pattern probably.

@MitchTurner MitchTurner changed the title Allow multiple validator scripts in a contract Allow Datums and Redeemers for multiple validator scripts in a contract Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant