1// SPDX-License-Identifier: MIT
2pragma solidity ^0.8.24;
3// orgone, live. evaluated against the chain and birdeye
4// about once a second, results rewritten in place. every
5// number is a reading or is computed from readings.
6// empty means not answered yet or no address configured.
7
8contract Live {
9 // chain
10 address box = ;
11 uint64 blockNow = ;
12
13 function layers() view {
14 layer[0] = ;
15 layer[1] = ;
16 layer[2] = ;
17 layer[3] = ;
18 layer[4] = ;
19 layer[5] = ;
20 core = ;
21 held = sum(layer) = ;
22 share = [, , , , , , ] %;
23 }
24
25 function threshold() view {
26 totalSupply = ;
27 threshold = totalSupply >> 9 = ;
28 fill = core / threshold = %;
29 gap = threshold - core = ;
30 armed = core >= threshold = ;
31 }
32
33 function drift() view {
34 flux[5 to core] = layer[5] >> 6 = ;
35 flux[4 to 5] = layer[4] >> 6 = ;
36 flux[3 to 4] = layer[3] >> 6 = ;
37 flux[2 to 3] = layer[2] >> 6 = ;
38 flux[1 to 2] = layer[1] >> 6 = ;
39 flux[0 to 1] = layer[0] >> 6 = ;
40 moving = sum(flux) = ;
41 coreNext = core + flux[5 to core] = ;
42 blocksToFire = ;
43 }
44
45 function decay() view {
46 // layer[0] left alone, 63/64 of itself per block
47 after44 = layer[0] * 0.5001 = ;
48 after128 = layer[0] * 0.1332 = ;
49 after384 = layer[0] * 0.0024 = ;
50 crossing = 64 blocks per boundary, 384 to the core;
51 }
52
53 function stall() view {
54 touched = ;
55 idle = - = ;
56 untilStall = 2048 - idle = ;
57 stalled = ;
58 ventIfWoken = layer[0] >> 3 = ;
59 }
60
61 function memory() view {
62 replay = min(idle, 128) = ;
63 forgotten = max(idle - 128, 0) = ;
64 }
65
66 function projected() view {
67 // what a touch in this block would leave behind
68 core = (now );
69 held = ;