Skip to content

Instantly share code, notes, and snippets.

import smartpy as sp
class FA2_mini(sp.Contract):
def __init__(self, history, metadata):
self.init(
history = history,
metadata = metadata
)
(* In the tezos codebase: Use ["dune utop src/lib_base figure_out_kt1.ml"] *)
open Tezos_crypto
let enc =
(* src/proto_alpha/lib_protocol/contract_repr.ml *)
let open Data_encoding in
obj2 (req "operation" Operation_hash.encoding) (dft "index" int32 0l)
(* src/proto_alpha/lib_protocol/contract_hash.ml *)
## Let's setup a silent [sandbox](https://assets.tqtezos.com/docs/setup/2-sandbox/),
## and configure `tezos-client` for it:
docker run --rm --name my-sandbox --detach -p 20000:20000 \
tqtezos/flextesa:20201214 delphibox start
tezos-client --endpoint http://localhost:20000 config update
tezos-client import secret \
key alice unencrypted:edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq --force
tezos-client import secret key \
bob unencrypted:edsk3RFfvaFaxbHx8BMtEW1rKQcPtDML3LXjNqMNLCzC3wLC1bWbAt --force
## (don't forget to `docker kill my-sandbox` when you're done).
@smondet
smondet / example.ml
Last active June 23, 2020 15:24
Data for michokit blog post
(* Generated code for
pair (pair (nat %some_counter) (string %some_name))
(or %a_variant_thing (bytes %some_data) (key %the_key))
*)
module Big_int = struct
include Big_int
let equal_big_int = eq_big_int
let pp_big_int ppf bi = Format.pp_print_string ppf (string_of_big_int bi)
dune exe dune-deps/src/Main.exe . | tred > tezos.dot
dot -Tpng tezos.dot -o tezos.png
Genspio: Generating Shell Phrases In OCaml

[Genspio][] is a typed EDSL to generate shell scripts from OCaml. The idea is to build values of type 'a Genspio.EDSL.t with the combinators in the Genspio.EDSL module, and compile them to POSIX shell scripts (or one-liners) with functions from the Genspio.Compile module.

The project provides two compilers. The standard compiler generates strict but complex POSIX shell expressions, which can be even treated as one-liners. The second compiler, generates much slower but simpler scripts targeting a subset of

@smondet
smondet / wobi-local-deploy-debug.ml
Last active August 10, 2017 19:44
Deploy Debug for Wobi-seco-local
#use "/epidisco-shared/biokepi_machine.ml";;
let workflow =
let open Biokepi in
let open KEDSL in
let program =
let open Program in
let cmd c =
let shorten s =
match String.sub s ~index:0 ~length:50 with
@smondet
smondet / transfer_existentials.ml
Created October 19, 2016 18:28
Transfer existential types
type t =
| Text: 'a list -> t
type u =
| Uext: 'a list -> u
let f: t -> u =

Keybase proof

I hereby claim:

  • I am smondet on github.
  • I am smondet (https://keybase.io/smondet) on keybase.
  • I have a public key whose fingerprint is 48E8 876A 5F5B E376 19F2 AB8A ABDE 8FF0 8479 CA0C

To claim this, I am signing this object:

@smondet
smondet / 300.md
Created September 21, 2016 16:32

Long awaited major release, we have been using the master branch for about a year with Biokepi, Epidisco, and lately Coclobas:

  • The EDSL has been re-architectured around the notions of workflow_node and edges (the old EDSL.target API is still available but deprecated).
  • Ketrew can build & run with ssl, tls, or no TLS implementation.
  • Ketrew, thanks to Trakeva, can use Sqlite3 or PostgreSQL database backends.
  • Lots of (Web)UI, plugin, performance improvements.