Skip to content

Commit

Permalink
Working example in . Run test in and to see it in action
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-schott committed Nov 4, 2023
1 parent b1c9e93 commit 17571c1
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/tmp/nested/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.env
*.avm
*.prover
*.verifier
outputs/
13 changes: 13 additions & 0 deletions utils/tmp/nested/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# nested.aleo

## Build Guide

To compile this Aleo program, run:
```bash
snarkvm build
```

To execute this Aleo program, run:
```bash
snarkvm run hello
```
10 changes: 10 additions & 0 deletions utils/tmp/nested/build/imports/nested_example_layer_0.aleo
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import nested_example_layer_2.aleo;
import nested_example_layer_1.aleo;

program nested_example_layer_0.aleo;

function main:
input r0 as u32.public;
input r1 as u32.private;
call nested_example_layer_1.aleo/external_function r0 r1 into r2;
output r2 as u32.private;
9 changes: 9 additions & 0 deletions utils/tmp/nested/build/imports/nested_example_layer_1.aleo
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import nested_example_layer_2.aleo;

program nested_example_layer_1.aleo;

function external_function:
input r0 as u32.public;
input r1 as u32.private;
call nested_example_layer_2.aleo/external_nested_function r0 r1 into r2;
output r2 as u32.private;
7 changes: 7 additions & 0 deletions utils/tmp/nested/build/imports/nested_example_layer_2.aleo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
program nested_example_layer_2.aleo;

function external_nested_function:
input r0 as u32.public;
input r1 as u32.private;
add r0 r1 into r2;
output r2 as u32.private;
12 changes: 12 additions & 0 deletions utils/tmp/nested/build/main.aleo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import nested_example_layer_2.aleo;
import nested_example_layer_1.aleo;
import nested_example_layer_0.aleo;
program nested.aleo;



function example:
input r0 as u32.public;
input r1 as u32.private;
call nested_example_layer_0.aleo/main r0 r1 into r2;
output r2 as u32.private;
13 changes: 13 additions & 0 deletions utils/tmp/nested/build/program.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"program": "nested.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT",
"dependencies": [
{
"name": "nested_example_layer_0.aleo",
"location": "network",
"network": "testnet3"
}
]
}
4 changes: 4 additions & 0 deletions utils/tmp/nested/inputs/nested.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// The program input for nested/src/main.leo
[main]
public a: u32 = 1u32;
b: u32 = 2u32;
20 changes: 20 additions & 0 deletions utils/tmp/nested/leo.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[[package]]
name = "nested_example_layer_0.aleo"
network = "testnet3"
location = "network"
checksum = "23414151de5687d5daa447533109ee810b7e763c4d0659e2f53562123e639b2c"
dependencies = ["nested_example_layer_2.aleo", "nested_example_layer_1.aleo"]

[[package]]
name = "nested_example_layer_2.aleo"
network = "testnet3"
location = "network"
checksum = "b987b8490b214ad9120a47b218a1c1387c7c2763aaf2aa9c81002a4c7020b3e4"
dependencies = []

[[package]]
name = "nested_example_layer_1.aleo"
network = "testnet3"
location = "network"
checksum = "17701f7369fe6bad74cdfb956bd9d85c6753ffedbf43be9fe5a4bfdc1751617b"
dependencies = ["nested_example_layer_2.aleo"]
6 changes: 6 additions & 0 deletions utils/tmp/nested/program.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"program": "nested.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
7 changes: 7 additions & 0 deletions utils/tmp/nested/src/main.leo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// The 'nested' program.
program nested.aleo {
transition main(public a: u32, b: u32) -> u32 {
let c: u32 = a + b;
return c;
}
}
Binary file not shown.
Binary file not shown.
Binary file added utils/tmp/super_simple/build/build/main.avm
Binary file not shown.
Binary file added utils/tmp/super_simple/build/build/main.prover
Binary file not shown.
Binary file added utils/tmp/super_simple/build/build/main.verifier
Binary file not shown.

0 comments on commit 17571c1

Please sign in to comment.