Skip to content

Commit

Permalink
Initial leo project template
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostant-1017 committed Dec 9, 2023
0 parents commit f8d044d
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .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 README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# leo_template.aleo

## Build Guide

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

To execute this Aleo program, run:
```bash
snarkvm run hello
```
9 changes: 9 additions & 0 deletions build/main.aleo
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
program leo_template.aleo;



function main:
input r0 as u32.public;
input r1 as u32.private;
add r0 r1 into r2;
output r2 as u32.private;
6 changes: 6 additions & 0 deletions build/program.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"program": "leo_template.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
8 changes: 8 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source .env

snarkos developer deploy \
--private-key $PRIVATE_KEY \
--query ${API_PREFIX} \
--priority-fee 100 $PROGRAM_NAME \
--broadcast ${API_PREFIX}/testnet3/transaction/broadcast \
--path ./build
11 changes: 11 additions & 0 deletions execute.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source .env

FUNCTION_NAME=main
ARG1=
ARG2=

snarkos developer execute \
--private-key ${PRIVATE_KEY} \
--query ${API_PREFIX} \
--priority-fee 100 $PROGRAM_NAME $FUNCTION_NAME $ARG1 $ARG2 \
--broadcast ${API_PREFIX}/testnet3/transaction/broadcast
4 changes: 4 additions & 0 deletions inputs/leo_template.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// The program input for leo_template/src/main.leo
[main]
public a: u32 = 1u32;
b: u32 = 2u32;
6 changes: 6 additions & 0 deletions program.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"program": "leo_template.aleo",
"version": "0.0.0",
"description": "",
"license": "MIT"
}
7 changes: 7 additions & 0 deletions src/main.leo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// The 'leo_template' program.
program leo_template.aleo {
transition main(public a: u32, b: u32) -> u32 {
let c: u32 = a + b;
return c;
}
}

0 comments on commit f8d044d

Please sign in to comment.