Skip to content

Conversation

tferariu
Copy link
Collaborator

@tferariu tferariu commented Oct 17, 2025

Description

Reimplements the changes in Alasdair's PR #885 modernized for the most recent commit of the master branch.

Additionally adds three more example contracts and their respective traces to the Conway specification tests including:

  • Different implementation of the MultiSig contract
    • Validator
    • OffChain code
    • Ledger Rule Traces
  • Account Simulation contract
    • Validator
    • OffChain code
    • Ledger Rule Traces
  • Order Book Distributed Exchange contract
    • Validator
    • OffChain code
    • Ledger Rule Traces

Development notes:

All examples currently only use coinTokenAlgebra, because the more complex Token Algebras cause the computational traces to hang endlessly. Attempted to use the proposed fixed-length vector implementation as well as a simplified version with just Ada and one singular token with no success. This makes the Distributed Exchange a bit weird since it does not have different currencies to exchange, but should be easily adaptable once Token Algebras are fully implemented.

As part of the previous changes, we removed toData, which will need to be reflected in the spec of Djikstra going forward.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Any semantic changes to the specifications are documented in CHANGELOG.md
  • Code is formatted according to CONTRIBUTING.md
  • Self-reviewed the diff

@carlostome carlostome mentioned this pull request Oct 20, 2025
5 tasks
Copy link
Collaborator

@carlostome carlostome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments here and there.

@williamdemeo and I had discussed with @Ali-Hill that probably it will be better to move all the examples to its own hierarchy outside of src. Maybe in a folder called src-ext-test.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is a symlink to the result of nix-build. It should not be added to git

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the contents of this file relate to scripts I suggest to move it to the Script folder.
I see two options:

  1. Merge it with Script.Base
  2. Replace Script.Base by this module and move the current Script.Base to Script.Structure (or something along those lines)

⦃ Dec-validPlutusScript ⦄ : ∀ {x} → (validPlutusScript x ⁇³)
language : PlutusScript → Language
toData : ∀ {A : Type} → A → Data
-- toData : ∀ {A : Type} → A → Data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out?

Comment on lines +78 to +79
-- valContext : TxInfo → ScriptPurpose → Data
-- valContext txinfo sp = toData (txinfo , sp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these lines commented out?

Comment on lines +132 to +133
--valContext : TxInfo → ScriptPurpose → Data
--valContext txinfo sp = toData (txinfo , sp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these lines commented out?

@WhatisRT
Copy link
Collaborator

I agree, it could even be factored into a separate library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants