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

Add "Oracles" #50

Merged
merged 15 commits into from
Mar 31, 2024
Merged

Add "Oracles" #50

merged 15 commits into from
Mar 31, 2024

Conversation

Quantumplation
Copy link
Member

A new order type that creates an authenticated UTXO containing the price of the order.

Note: we might want to change the datum structure to match something like an Orcfax or Charli3 datum, or add a "pass through" data field.

validators/oracle.ak Outdated Show resolved Hide resolved
// access to the final state of the order
let remainder = input.value
|> value.add(ada_policy_id, ada_asset_name, -actual_protocol_fee)
|> value.add(policy.1st, policy.2nd, 1)
Copy link
Member Author

Choose a reason for hiding this comment

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

maybe rename policy, since it's more than just a policy ID?

Also, should we check that this is minted, rather than coming from somewhere else for some reason?

fn(output) {
(0, True),
fn(output, state) {
let (oracle_minted_index, no_duplicates) = state
let qty = value.quantity_of(output.value, own_policy_id, oracle_name)
Copy link
Member Author

Choose a reason for hiding this comment

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

what happens if someone mints a token of a different name? do we care? maybe something like

expect [(name, amt)] = value.tokens(output.value, own_policy_id)
expect name == oracle_name
when amt is {
  ...
}

@Quantumplation Quantumplation merged commit 7181c12 into main Mar 31, 2024
1 check failed
@Quantumplation Quantumplation deleted the pi/oracles branch March 31, 2024 07:09
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.

2 participants