├── .gitignore ├── LICENSE ├── README.md ├── bun.lockb ├── circuit ├── Nargo.toml ├── src │ └── main.nr └── target │ └── circuit.json ├── index.html ├── index.js ├── package.json └── vite.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vscode 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 noir-lang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tiny NoirJS app 2 | 3 | This repo contains the full code from [this](https://noir-lang.org/docs/tutorials/noirjs_app) Noir docs page. 4 | 5 | ## Noir project 6 | 7 | Uses `nargo` version 0.31.0. 8 | 9 | Recompile with 10 | 11 | ```bash 12 | nargo compile 13 | ``` 14 | 15 | ## Vite project 16 | 17 | ```bash 18 | cd vite-project 19 | ``` 20 | 21 | Install dependencies with 22 | 23 | ```bash 24 | npm install 25 | ``` 26 | 27 | Run app with: 28 | 29 | ```bash 30 | npm run dev 31 | ``` 32 | -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noir-lang/tiny-noirjs-app/6ce5b3cb0539e456c73291dd35b8ea6bde1b3bce/bun.lockb -------------------------------------------------------------------------------- /circuit/Nargo.toml: -------------------------------------------------------------------------------- 1 | 2 | [package] 3 | name = "circuit" 4 | type = "bin" 5 | -------------------------------------------------------------------------------- /circuit/src/main.nr: -------------------------------------------------------------------------------- 1 | 2 | fn main(age: u8) { 3 | assert(age >= 18); 4 | } 5 | -------------------------------------------------------------------------------- /circuit/target/circuit.json: -------------------------------------------------------------------------------- 1 | {"noir_version":"0.31.0+540bef3597bd3e5775c83ec2ee3c0d4463084b4c","hash":4220416898248580058,"abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"public"}],"return_type":null,"error_types":{}},"bytecode":"H4sIAAAAAAAA/7VUSQ7DIAyEhKa99ic2SzC3fqWo5P8vqBopUCHCLWYkZIQlMx4vUhxQ+7mJM+ZsX9kaWK1NXic0+AYdIjmwLq6EhI7cR5MxiSz5EIOHgNYk3FwwGxyoY8E1oGTkNfHxgqKj7OgpGz3hGpCTt2zqfuLPRXqUEPOAuIq5+UfkrfhrBGJg0yrB27Sq4Vnfe0P4f7xnu3R8BY/9TPn+ZRa4bNd685a/VOVfKi6SnwvW+fYm/9nR5wcPIDK6OgYAAA==","debug_symbols":"lZBBCoMwFETvMussaqsUcpVS5KtRAuFHTBQkeHd/FA+Q5Zt5m5mEwXTr1FoefYD+JTjfU7SehRJeVxRm4kwh0hKh60bB8ADdVIfCaJ2R7Hv8Faoy/V2mf8r0ukQX2Gix1DmTh+du5f75QTDu892IewI=","file_map":{"47":{"source":"fn main(x: Field, y: pub Field) {\n assert(x != y);\n}\n\n#[test]\nfn test_main() {\n main(1, 2);\n\n // Uncomment to make test fail\n // main(1, 1);\n}\n","path":"/home/josh/Documents/tiny-noirjs-app/circuit/src/main.nr"}},"names":["main"]} -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 17 | 18 | 19 | 20 |