Open iTanChi opened 11 months ago
@iTanChi Parameterized contracts are already supported through aiken-java-binding library (0.0.8).
You can check these tests https://github.com/bloxbean/cardano-client-lib/blob/76496f51f458e0caa8f57758af738ec5bc740f6a/quicktx/src/it/java/com/bloxbean/cardano/client/quicktx/ParameterizedScriptIT.java#L116
Could this be done without aiken? I really want to use only this client lib instead of aiken lib
@iTanChi Currently, there is no UPLC evaluator in pure Java. However, we are not using the Aiken programming language here. Instead, 'aiken-java-binding' utilizes a required library (through JNI) from Aiken to apply parameters to compiled code, so you don't need to add any additional dependencies.
I believe you don't need to write your contract in Aiken. You can simply use the compiled code from your contract (written in other languages like PlutusTx or Helios) and apply the parameters. I need to test this, but you can give it a try.
Fyi, Lucid JS also follows the same approach. It's using Aiken's rust library through wasm to support this feature.
In some cases, we need to pass the param to script at run time instead of build time to get the final script
Lucid lib supports this with rust lib: https://github.com/spacebudz/lucid/blob/457c156e74ef49ce35823aa2bca91b3bbc585221/src/core/libs/cardano_multiplatform_lib/src/tx_builder_utils.rs#L79C15-L79C15