Synthetic demo datademo
Every block, transaction, address and hash on this chain is generated from a fixed seed. None of them exists on any network, and none of these values can be looked up anywhere else. The execution trace is real — it is a recorded Noir program — but it is not the execution of the transaction it is published under.
Verified source
0xe4d6…ed46
0xe4d6ba8f07ea6d007200830aabcb2a405eb1ed46
Verification
- Code hash
- 0xabac6139b480b9095d8bd3ab4bc00dc060c10bd5
- Status
- full match
- Provider
- demo-vendored
- Compiler
- nargo 1.0.0-beta.26
- Language
- noir
- Bundle
- sha1:93e7d47c59a8dc9fba2a959e625c26beae5d4ba5
Sources
Nargo.toml7 lines
1[package]
2name = "tour_values"
3type = "bin"
4authors = ["BlockTracer capability tour"]
5
6[dependencies]
7
Prover.toml3 lines
1seed = "5"
2scale = "1000"
3
src/main.nr80 lines
1// TOUR: types and values
2//
3// Every value kind this language has, brought into scope one line at a time so
4// the state pane has something of each to render. Nothing here computes
5// anything interesting on purpose — the subject IS the values, and a reader
6// stepping through should be able to name the type of every row they see.
7
8struct Vec2 {
9 x: Field,
10 y: Field,
11}
12
13struct Body {
14 label: str<6>,
15 position: Vec2,
16 mass: u32,
17 alive: bool,
18}
19
20fn main(seed: Field, scale: pub u32) -> pub Field {
21 // ── the field element, this language's native scalar ──────────────────
22 let field_value: Field = seed + 17;
23
24 // ── unsigned integers, four widths ────────────────────────────────────
25 let small: u8 = 200;
26 let medium: u16 = 40_000;
27 let wide: u32 = scale;
28 let widest: u64 = 9_000_000_000;
29
30 // ── signed integers, which print with a sign and wrap differently ─────
31 let negative: i8 = -42;
32 let signed_wide: i32 = -100_000;
33
34 // ── the boolean, and a string of fixed length ─────────────────────────
35 let flag: bool = small > 100;
36 let name: str<6> = "cosmos";
37
38 // ── a fixed-size array, indexed and read back ─────────────────────────
39 let weights: [u32; 4] = [3, 1, 4, 1];
40 let third = weights[2];
41
42 // ── a tuple, which the state pane renders positionally ────────────────
43 let pair: (Field, bool) = (field_value, flag);
44
45 // ── a struct, and a struct nested inside another struct ───────────────
46 let origin = Vec2 { x: 0, y: 0 };
47 let body = Body { label: name, position: Vec2 { x: 3, y: 4 }, mass: wide, alive: flag };
48
49 // ── a vector, whose length grows at run time rather than being fixed
50 // by the type the way `weights` above is ─────────────────────────────
51 let mut trail: [Field] = [body.position.x].as_vector();
52 trail = trail.push_back(body.position.y);
53 trail = trail.push_back(origin.x);
54
55 // ── a value read back out of each compound, so the step that reads it
56 // has a scalar to show next to the compound it came from ────────────
57 let from_array = weights[0] + third;
58 let from_tuple = pair.1;
59 let from_struct = body.position.y;
60 let from_slice = trail[1];
61
62 assert(from_array == 7);
63 assert(from_tuple == flag);
64
65 // Signed values reach `Field` only through an unsigned width — the
66 // language refuses the direct cast, which is itself worth seeing written
67 // down once.
68 let signed_gap: i32 = negative as i32 - signed_wide;
69 let signed_gap_u: u32 = signed_gap as u32;
70
71 let total = field_value
72 + from_struct
73 + from_slice
74 + medium as Field
75 + widest as Field
76 + signed_gap_u as Field;
77
78 total
79}
80
This is a circuit, not a contract. It declares no ABI and no storage layout, so there is no interface list and no slot mapping to show. The source above is the whole of what it publishes.
Deployments
This code is deployed at one address. Any other address running the same bytecode would appear here too, already verified.