This commit is contained in:
Peter Harpending
2026-09-21 17:12:53 -07:00
parent c23eed3a4d
commit fcd61c122e
11 changed files with 234 additions and 90 deletions
+24
View File
@@ -0,0 +1,24 @@
contract Rubicon =
// record rbx =
// {ip : string,
// port : int,
// protocol : string, // "tcp", "udp", "sctp", etc
// noise : string, // Noise_Foo_Bar_Baz_Quux
// pubkey : address, // responder static pubkey (noise: rs field)
// prologue : bytes} // noise prologue (empty = no prologue)
// (ip, port, protocol, noise, pubkey, prologue)
type rbx_tuple = string * int * string * string * address * bytes
type state = list(rbx_tuple)
entrypoint init(tuples: list(rbx_tuple)): state =
tuples
stateful entrypoint set(tuples: list(rbx_tuple)): unit =
// this would be nice
// but unfortunately nobody knows how to do this
// require(Call.caller == Contract.creator, "Not allowed")
put(tuples)
entrypoint lookup(): list(rbx_tuple) =
state