Skip to content

Instantly share code, notes, and snippets.

View jhbertra's full-sized avatar

Jamie Bertram jhbertra

View GitHub Profile
@jhbertra
jhbertra / check-byron-address.md
Created June 12, 2024 13:15
Byron Address Structure

Let's create a Byron address:

$ cardano-cli byron key keygen --secret test.skey
$ cardano-cli byron key signing-key-public --secret test.skey
    public key hash: 7e5078fa6e2a8308
public key (base64): RNbpyp7dquTkVJJ5hXxs4hLjtVCynfQvuVTi5gicU55McTshDzVSGQdNfJHN995WVWsPYpaAyIQ8omBBR8uagA==
   public key (hex): 44d6e9ca9eddaae4e4549279857c6ce212e3b550b29df42fb954e2e6089c539e4c713b210f355219074d7c91cdf7de56556b0f629680c8843ca2604147cb9a80
$ cardano-cli byron key signing-key-address --mainnet --secret test.skey
Ae2tdPwUPEZHvh7P2QsxENNDeHZ9K4vw4Pfk3LY9gxkrAVVLSTmXaCvxxFf
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe.Extended.V1
main :: IO ()
main = printJSON example
{- Define a contract, Close is the simplest contract which just ends the contract straight away
@jhbertra
jhbertra / Main.hs
Last active May 19, 2023 16:39
Test project
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe.Extended.V1
main :: IO ()
main = printJSON example
{- Define a contract, Close is the simplest contract which just ends the contract straight away
@jhbertra
jhbertra / Main.hs
Last active May 19, 2023 16:34
New Project
{-# LANGUAGE OverloadedStrings #-}
module Escrow where
import Language.Marlowe.Extended.V1
main :: IO ()
main = printJSON escrow
-- We can set explicitRefunds True to run Close refund analysis
-- but we get a shorter contract if we set it to False
@jhbertra
jhbertra / 09c2691c3b3bd949c811b111f99389925e3fe474abaca283bad617341f1e6e42.json
Last active September 27, 2022 15:53
Management of Merkelized Marlowe Contracts
{
"contract": {
"timeout": 1655663503000,
"timeout_continuation": "close",
"when": [
{
"case": {
"deposits": 12000000,
"into_account": {
"address": "addr_test1vq9prvx8ufwutkwxx9cmmuuajaqmjqwujqlp9d8pvg6gupczgtm9j"
@jhbertra
jhbertra / day1.hs
Last active December 6, 2017 06:10
Advent of Code 2017
valIfEqual :: Int -> Int -> Int
valIfEqual x x' =
if x == x' then x
else 0
invCaptcha1 :: Int -> [Int] -> Int
invCaptcha1 fst (x:[]) = valIfEqual fst x
invCaptcha1 fst (x:x':xs) = (valIfEqual x x') + invCaptcha1 fst (x':xs)