This is a proof-of-concept for a regulated stablecoin. It is NOT a finished product.
The POC is based on CIP-0143, instantiated with a programmable logic that checks whether the target address is blacklisted before allowing a transfer of the programmable token from one owner to another.
This repository contains
- Prototype implementation of CIP-0143 in Plutarch
- Prototype implementation of Access Control Policy in Plutarch
- Transaction building code for initial deployment, minting programmable tokens, transferring programmable tokens, adding addresses to the blacklist (ie. freezing), and seizing funds from blacklisted addresses. Based on sc-tools and cardano-api.
- Emulator tests for the nominal cases (happy path) based on the actual ledger implementation and mainnet protocol parameters.
- A user interface that implements the use cases using browser-based wallets. Based on next.js and lucid.
- An OCI container image with the on-chain code, the off-chain code and the UI
With the container image it is possible to run the complete system locally with just a single command. There is no need to install the build toolchain or to operate a cardano node or related infrastructure. The image can even be used to interact with existing deployments of the POC.
The easiest way to get started is by running the wst image locally:
docker run --rm -p 8080:8080 --env WST_BLOCKFROST_TOKEN=previewXYZ ghcr.io/input-output-hk/wst:pr-67 manage 08a8d0bb8717839931b0a594f7c28b0a3b7c78f6e9172e977e250eab7637d879.0 start
Then open localhost:8080/mint-authority.html in the browser.
Some notes
podman
or others can be used instead ofdocker
previewXYZ
must be replaced by a valid blockfrost token for the preview network- The tag
pr-67
corresponds to PR 67 08a8d0bb8717839931b0a594f7c28b0a3b7c78f6e9172e977e250eab7637d879.0
is the transaction input that was used to initialise the deployment on the preview network.
- Run the tests with
cabal test all
- Enter the nix shell with
nix develop
cd frontend
npm install
npm run dev
[!IMPORTANT]
Please make sure that the UI can be exported to a set of static assets.
This is necessary for the OCI image.
In particular, the command npm run export
should succeed.
Check out the issue tracker
Bug reports and contributions are welcome!