mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 02:31:44 +03:00
commit
47c00c30c6
@ -3,5 +3,13 @@ $LEO new foo
|
||||
ls -la
|
||||
cd foo && ls -la
|
||||
|
||||
# Try to run `leo build`.
|
||||
(
|
||||
$LEO build || exit
|
||||
)
|
||||
|
||||
|
||||
# Try to run `leo run`.
|
||||
$LEO run
|
||||
(
|
||||
$LEO run || exit
|
||||
)
|
||||
|
2
examples/import_point/.gitignore
vendored
2
examples/import_point/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
outputs/
|
||||
build/
|
@ -1,14 +0,0 @@
|
||||
# Leo import example
|
||||
An example showing how to import symbols from file `point.leo`.
|
||||
|
||||
## Build Guide
|
||||
|
||||
To compile this program, run:
|
||||
```bash
|
||||
leo build
|
||||
```
|
||||
|
||||
To run this program, run:
|
||||
```bash
|
||||
leo run
|
||||
```
|
@ -1,18 +0,0 @@
|
||||
// A (x, y) coordinate point.
|
||||
circuit Point {
|
||||
x: u32,
|
||||
y: u32,
|
||||
}
|
||||
|
||||
// Returns a new point.
|
||||
function new(x: u32, y: u32) -> Point {
|
||||
return Point {x, y};
|
||||
}
|
||||
|
||||
// Returns the sum of two points.
|
||||
function sum(a: Point, b: Point) -> Point {
|
||||
return Point {
|
||||
x: a.x + b.x,
|
||||
y: a.y + b.y,
|
||||
};
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
// The program input for import_point/src/main.leo
|
||||
[main]
|
||||
public a: u32 = 1u32;
|
||||
b: u32 = 2u32; // Input variable `b` is private by default.
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"program": "import_point.aleo",
|
||||
"version": "0.0.0",
|
||||
"description": "",
|
||||
"development": {
|
||||
"private_key": "APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx",
|
||||
"address": "aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
// Import the circuits and functions from `imports/point.leo`.
|
||||
// In testnet3, Leo imports all symbols from a file by default.
|
||||
import point.leo;
|
||||
|
||||
// The main function.
|
||||
@program
|
||||
function main(public a: u32, b: u32) -> u32 {
|
||||
return a + b;
|
||||
}
|
Loading…
Reference in New Issue
Block a user