Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aiken-lang/stdlib
The Aiken Standard Library
https://github.com/aiken-lang/stdlib
aiken cardano plutus smart-contract
Last synced: about 2 months ago
JSON representation
The Aiken Standard Library
- Host: GitHub
- URL: https://github.com/aiken-lang/stdlib
- Owner: aiken-lang
- License: apache-2.0
- Created: 2022-12-07T03:06:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-04T18:06:09.000Z (about 2 months ago)
- Last Synced: 2024-05-05T18:40:43.620Z (about 2 months ago)
- Topics: aiken, cardano, plutus, smart-contract
- Language: Gleam
- Homepage: https://aiken-lang.github.io/stdlib
- Size: 671 KB
- Stars: 37
- Watchers: 5
- Forks: 20
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Lists
- awesome-aiken - aiken-lang/stdlib - The official standard library (Libraries)
- awesome-stars - aiken-lang/stdlib - The Aiken Standard Library (Gleam)
README
Aiken Standard Library
[![Licence](https://img.shields.io/github/license/aiken-lang/stdlib)](https://github.com/aiken-lang/stdlib/blob/main/LICENSE)
[![Continuous Integration](https://github.com/aiken-lang/stdlib/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/aiken-lang/stdlib/actions/workflows/continuous-integration.yml)
The official standard library for the [Aiken](https://aiken-lang.org) Cardano
smart-contract language.It extends the language builtins with useful data-types, functions, constants
and aliases that make using Aiken a bliss.```aiken
use aiken/hash.{Blake2b_224, Hash}
use aiken/list
use aiken/transaction.{ScriptContext}
use aiken/transaction/credential.{VerificationKey}pub type Datum {
owner: Hash,
}pub type Redeemer {
msg: ByteArray,
}/// A simple validator which replicates a basic public/private signature lock.
///
/// - The key (hash) is set as datum when the funds are sent to the script address.
/// - The spender is expected to provide a signature, and the string 'Hello, World!' as message
/// - The signature is implicitly verified by the ledger, and included as 'extra_signatories'
///
validator {
fn spend(datum: Datum, redeemer: Redeemer, context: ScriptContext) -> Bool {
let must_say_hello =
redeemer.msg == "Hello, World!"let must_be_signed =
context.transaction.extra_signatories
|> list.any(fn(vkh: ByteArray) { vkh == datum.owner })must_say_hello && must_be_signed
}
}
```## Stats
![Alt](https://repobeats.axiom.co/api/embed/f0a17e7f6133630e165b9e56ec5447bef32fe831.svg "Repobeats analytics image")