Python implementation of untyped plutus language core
Project description
Untyped Plutus Language Core
This is a basic library to support creating and manipulating programs written in UPLC.
Installation
Install anything between python 3.8 and 3.11. Then run
pip install uplc
Secp256k1
If you want to use the builtin functions for verification of ECDSA and Schnorr signatures,
follow the instructions to install libsecp256k1
with schnorr support enabled:
This makes sure that the exact same version is used that is used in the cardano-node
.
Usage
This tool may be used to parse, reformat (/dump), evaluate or build contract artifacts from UPLC code.
# Check validity of a source file
uplc parse examples/fibonacci.uplc
# Dump a source file in either the official plutus or legacy aiken dialect
uplc dump examples/fibonacci.uplc --dialect plutus --unique-varnames
uplc dump examples/fibonacci.uplc --dialect legacy-aiken
# Evaluate a UPLC program on UPLC input
uplc eval examples/fibonacci.uplc "(con integer 5)"
# Build smart contract artifacts from the UPLC program
uplc build examples/fibonacci.uplc
# This package can also be used to analyze built contracts (output from any Smart Contract Language)
uplc dump build/fibonacci/script.cbor --from-cbor
# You can also apply additional parameters to a script using the build command
uplc build script.cbor --from-cbor "(con integer 5)"
# Show all options
uplc --help
Running tests
To run the testsuite of UPLC, use pytest
.
pytest
Scope and Contributions
This is a side product of the development of a pythonic smart contract language for the Cardano blockchain and hence much tailored to the needs of that development.
Most likely it can do what you would like to do but its not properly documented. Please do reach out via Discord or GitHub issue if you think this tool could be of use to you.
Contributions are very welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uplc-1.0.10.tar.gz
.
File metadata
- Download URL: uplc-1.0.10.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.10.13 Linux/6.11.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b51563940bab8cd428b9045bcc21720a87781c7a19cb4acad890ee3fc1663ac |
|
MD5 | e41d9bbe7cdbd74a813b015d97f8bd19 |
|
BLAKE2b-256 | 91b87acf91b2414e01d8fbd9febbff2df98ab37d327cdc43b0199bbf604f9ea8 |
File details
Details for the file uplc-1.0.10-py3-none-any.whl
.
File metadata
- Download URL: uplc-1.0.10-py3-none-any.whl
- Upload date:
- Size: 40.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.10.13 Linux/6.11.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50fb0a0793750e1b184c25754c47bf1f7fba0b52171798074d03e44c4a8e67e8 |
|
MD5 | 81ac8d25a4985cabfb296a6d72ee30f3 |
|
BLAKE2b-256 | 617f5b0a6953ab43d2bcb76064b37bda71d442ebd1684230c611c5a5d8d6d61b |