committing to cleanup

This commit is contained in:
Peter Harpending
2026-09-04 19:40:44 -07:00
parent edf2030b34
commit c23eed3a4d
6 changed files with 126 additions and 15 deletions
+31
View File
@@ -0,0 +1,31 @@
/**
* Rubicon contract
*
* Author: Peter Harpending <peterharpending@qpq.swiss>
* Date: 2026-09-04
*/
contract Rubicon =
// this could/should be a record, but records aren't really
// portable across contracts/languages/APIs
//
// 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 : option(bytes)} // noise prologue (empty = no prologue)
// (ip, port, protocol, noise, pubkey, prologue)
type rbx_tuple = string * int * string * string * address * option(bytes)
type state = list(rbx_tuple)
entrypoint init(tuples: list(rbx_tuple)): state =
tuples
stateful entrypoint set(tuples: list(rbx_tuple)): unit =
require(Call.caller == Contract.creator, "Not allowed")
put(tuples)
entrypoint lookup(): list(rbx_tuple) =
state