Skip to content

Instantly share code, notes, and snippets.

@zetsuboii

zetsuboii/.js Secret

Created June 3, 2021 21:25
Show Gist options
  • Save zetsuboii/3e5792bdfeb3970e5a4eeae4ea856404 to your computer and use it in GitHub Desktop.
Save zetsuboii/3e5792bdfeb3970e5a4eeae4ea856404 to your computer and use it in GitHub Desktop.
No loop
'reach 0.1';
export const main = Reach.App(() => {
setOptions({ connectors: [ALGO] });
const Alice = Participant('Alice', {
noticeAlice: Fun([], Null),
});
const Bob = Participant('Bob', {
noticeBob: Fun([], Null),
});
deploy();
const arr = array(UInt, [0, 1, 2, 3, 4]);
Anybody.publish();
const i = 8;
const temp = i < 5 ? arr[i] : i;
commit();
exit();
});
// --------------------------------
/*
❯ ./reach compile
Verifying knowledge assertions
Verifying for generic connector
Verifying when ALL participants are honest
Verifying when NO participants are honest
Verifying when ONLY "Alice" is honest
Verifying when ONLY "Bob" is honest
Checked 10 theorems; No failures!
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment