1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
Commit graph

4480 commits

Author SHA1 Message Date
Ahmed Castro
48885d64a4
Update sudoku_checker.zok 2023-03-24 16:37:58 -06:00
Ahmed Castro
30c9d8b8b1
Update sudoku_checker.zok 2023-03-24 16:36:49 -06:00
Ahmed Castro
2e551b3d16
Update sudoku_checker.zok 2023-03-21 11:53:10 -06:00
Ahmed Castro
f84faaae83
Sudoku example fix
**Problem**

the logic behind `countDuplicates` is invalid because it's doing this:
(incorrect)
```
if(duplicates + e11 == e21)
  duplicates = 1;
else
  duplicates = 0;
```

Instead of this:
(correct)
```
if(e11 == e21)
  duplicates = duplicates + 1;
else
  duplicates = duplicates;
```

**Solution**

I'm using an auxiliary variable to fix this

**Alternative solution**

We can also fix it with an array and a loop. But I went for the auxiliary variable for no particular reason.

```
def countDuplicates(field e11, field e12, field e21, field e22) -> u32 {
    u32[6] mut duplicates = [0,0,0,0,0,0];
    duplicates[0] = e11 == e12 ? 1 : 0;
    duplicates[1] = e11 == e21 ? 1 : 0;
    duplicates[2] = e11 == e22 ? 1 : 0;
    duplicates[3] = e12 == e21 ? 1 : 0;
    duplicates[4] = e12 == e22 ? 1 : 0;
    duplicates[5] = e21 == e22 ? 1 : 0;

    u32 mut count = 0;
    for u32 i in 0..5 {
        count = count + duplicates[i];
    }

    return count;
}
```

And btw, I also added an assert to make sure we check for this validation. I've tested this on the playground and on chain on goerli and with this changes it works correctly.
2023-03-18 20:09:28 -06:00
Thibaut Schaeffer
7f698545f6
Merge pull request #1286 from Turupawn/patch-1
Fixed small typo
2023-03-17 10:00:17 +00:00
Ahmed Castro
60ee62d309
Fixed small typo
Found a small typo while testing this.
Cheers!
2023-03-16 19:01:46 -06:00
Thibaut Schaeffer
8ca79372df
Merge pull request #1283 from Zokrates/greedy-reducer
Refactor reducer to reduce memory usage and runtime
2023-02-28 12:02:17 +01:00
Thibaut Schaeffer
1c137ea9fc
Merge pull request #1280 from Zokrates/fix-mpc-init
Fix `radix-path` help message on `mpc init` subcommand
2023-02-28 11:43:52 +01:00
dark64
2a2370efba add changelog 2023-02-28 10:56:18 +01:00
dark64
a4fcdee481 Merge branch 'develop' into fix-mpc-init 2023-02-28 10:55:39 +01:00
Thibaut Schaeffer
a4972670da
Merge pull request #1284 from Zokrates/fix-prettier-action
Fix prettier github action
2023-02-27 23:50:16 +01:00
schaeff
8ccf681f19 upgrade prettier action to 4.3 2023-02-27 13:47:06 +01:00
schaeff
c81cc66fd3 simplify inliner 2023-02-27 13:35:50 +01:00
schaeff
35c1a9686b error out if loops are too large 2023-02-23 11:26:57 +01:00
schaeff
ea74d512bf Merge branch 'develop' of github.com:Zokrates/ZoKrates into greedy-reducer 2023-02-22 21:54:37 +01:00
schaeff
ba7aa6044c clean 2023-02-22 21:51:58 +01:00
schaeff
156ff24306 clean inliner 2023-02-22 21:43:56 +01:00
schaeff
c01cc25c51 changelog, prettier 2023-02-22 21:35:35 +01:00
schaeff
30801c86fa make all tests pass, clean 2023-02-22 21:30:11 +01:00
Thibaut Schaeffer
09bcaa8fe7
Merge pull request #1277 from Zokrates/fix-setup-ffi
Improve setup FFI in zokrates-js
2023-02-22 12:03:41 +01:00
schaeff
1bb524f6a2 clean 2023-02-20 23:17:02 +01:00
dark64
99f145566f fix mpc init message 2023-02-20 19:24:16 +01:00
schaeff
01450c741f fix more tests 2023-02-20 03:39:58 +01:00
schaeff
a2b335cf8e wip 2023-02-19 20:46:24 +01:00
Darko Macesic
fb45889147
add changelog 2023-02-15 19:36:18 +01:00
Thibaut Schaeffer
3a4436068e
Merge pull request #1279 from Zokrates/fix-interpreter-crate-features
Pass `ark` and `bellman` features to `zokrates_analysis`
2023-02-14 16:12:29 +01:00
schaeff
5ecfe5ea0d pass ark and bellman features to zokrates_analysis 2023-02-14 15:36:33 +01:00
Thibaut Schaeffer
0fe82a7d60
Merge pull request #1275 from Zokrates/show-mpc-help
Show help when running `zokrates mpc`
2023-02-14 12:11:13 +01:00
dark64
86d50e79d8 fix setup ffi in zokrates-js 2023-02-08 19:24:50 +01:00
dark64
aca048eda5 fmt 2023-02-06 20:07:58 +01:00
dark64
c77e7ae5c3 show help when running "zokrates mpc" 2023-02-06 20:06:35 +01:00
Thibaut Schaeffer
3f2ca5f5ad
Merge pull request #1273 from Zokrates/deploy
Merge back 0.8.4
2023-02-05 23:34:30 +01:00
Thibaut Schaeffer
b5f2263410
Merge pull request #1272 from Zokrates/rc/0.8.4
Release 0.8.4
2023-01-31 13:20:50 +01:00
schaeff
2bd2ed2927 Merge branch 'develop' of github.com:Zokrates/ZoKrates into rc/0.8.4 2023-01-31 12:54:24 +01:00
Thibaut Schaeffer
640fc4130b
Merge pull request #1271 from Zokrates/disable-wasm-test
Disable wasm_test in CI
2023-01-31 12:53:43 +01:00
schaeff
ddabd724fc add assembly disclaimer 2023-01-31 12:50:51 +01:00
schaeff
9e56e912bd bump versions, update changelog 2023-01-31 12:43:19 +01:00
dark64
66dd4b1c68 disable wasm_test in ci 2023-01-31 12:12:00 +01:00
Thibaut Schaeffer
96160eab4e
Merge pull request #1261 from Zokrates/ark-parallel
Use ark parallel feature
2023-01-31 12:00:00 +01:00
Darko Macesic
431c6bc343
Update 1261-dark64 2023-01-31 11:19:32 +01:00
dark64
6796d00b9f update tests 2023-01-30 19:38:45 +01:00
dark64
37694af016 fix conflicts 2023-01-30 18:54:10 +01:00
Thibaut Schaeffer
3e40945778
Use foundry for integration tests (#1266)
* remove zokrates_solidity_test, use foundry for integration tests

* fix foundry install

* fix foundry install

* use full path for forge

* wip

* wip

* wip

* test

* test

* test

* test

* test

* add message if foundry is missing, add changelog

* move install script to ci config

* Apply suggestions from code review

---------

Co-authored-by: Thibaut <thibaut@Thibauts-MacBook-Pro.local>
2023-01-30 17:50:20 +01:00
Thibaut Schaeffer
059d6edea4
Merge pull request #1269 from Zokrates/fix-array-propagation
Fix array propagation
2023-01-30 16:43:39 +01:00
dark64
a76e14c00b Merge branch 'develop' into ark-parallel 2023-01-30 16:09:25 +01:00
Thibaut Schaeffer
fb60a3d199
Merge pull request #1254 from Zokrates/seedable-setup
Allow user-provided randomness in setup
2023-01-30 16:05:31 +01:00
schaeff
dfcce6b2a7 fmt 2023-01-30 15:59:42 +01:00
dark64
676e6db168 add changelog 2023-01-30 15:48:38 +01:00
schaeff
9932fcaebb add test 2023-01-30 15:44:05 +01:00
dark64
50b8cff32a fix fmt 2023-01-30 15:32:49 +01:00