stdlib
stdlib copied to clipboard
Plutus v3
Beginning of the v2 to v3 transition. This branch is pure Plutus V3. It contains breaking changes.
Each new type needs a review and double check but it at least lays down the groundwork for this transition.
New types are generated from: v1.22.1.0 Context
I tried to group types where they should be going so some movement might be needed.
test validator for sancho net:
validator {
fn params(_datum: Void, _redeemer: Void, context: ScriptContext) -> Bool {
when context.purpose is {
Spend(_) -> {
let d = #"97f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb"
let g1 = builtin.bls12_381_g1_uncompress(d)
let x = g1 |> builtin.bls12_381_g1_compress
x == d
}
_ -> False
}
}
}
Should be able to compile the script, create a reference script utxo, and spend into and out of that contract.
aiken --version
aiken v1.0.24-alpha+d698f76
With Aiken 1.0.26, the use of the Dict type was discouraged.
https://github.com/logicalmechanism/stdlib/blob/plutus-v3/lib/aiken/transaction.ak#L67-L87
Does this mean all of these Dicts should be turned into lists of tuples too? like List<(x,y)> @KtorZ
With Aiken 1.0.26, the use of the Dict type was discouraged.
Not really. It wasn't discourage, but simply made safer. We will still use Dict in the standard library in places that make sense. But We'll also use type Map<k, v> = List<Pair<k, v>> in other places as soon as the new Pair type lands in.
With Aiken 1.0.26, the use of the Dict type was discouraged.
Not really. It wasn't discourage, but simply made safer. We will still use
Dictin the standard library in places that make sense. But We'll also usetype Map<k, v> = List<Pair<k, v>>in other places as soon as the newPairtype lands in.
Well when the Pair type comes out in 1.0.27 I think I will revisit this and see what to change or update. I am attempting to use this branch on SanchoNet with some interesting errors so I was assuming something may be went wrong because of the Dict type.
New types are generated from: v1.30.0.0 Context.
Key changes:
ScriptContext using ScriptInfo now and has the redeemer field.
There are naming conflicts introduced here so to avoid any issues, the ScriptPurpose uses the verb form of the action and the ScriptInfo will use the present tense verb form.
The new types need an additional review due to the introduction of Pair/Pairs type. I want to make sure everything still agrees with the current branch of both the stdlib and plutus.