Skip to content

Instantly share code, notes, and snippets.

@arkhaminferno
Created April 1, 2022 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arkhaminferno/755957b28ac1b882aefeb783978a9eb7 to your computer and use it in GitHub Desktop.
Save arkhaminferno/755957b28ac1b882aefeb783978a9eb7 to your computer and use it in GitHub Desktop.
Ascent Reach Bootcamp Week - 1 assignment
'reach 0.1'
const Player = {
getChallenge:Fun([],UInt),
seeResult:Fun([UInt],Null)
};
export const main = Reach.App(()=>{
const Pat = Participant('Pat',{...Player});
const Vanna = Participant('Vanna',{...Player});
init();
Pat.only(()=>{
const challengePat = declassify(interact.getChallenge());
});
Pat.publish(challengePat);
commit();
Vanna.only(()=>{
const challengeVanna = declassify(interact.getChallenge());
})
Vanna.publish(challengeVanna);
commit();
})
'reach 0.1'
const User = {
seePrice:Fun([],UInt),
getDescription:Fun([],Bytes(8))
}
export const main= Reach.App(()=>{
const Creator = Participant('Creator',{...User});
const Bidder = Participant('Bidder',{...User});
const Buyer = Participant('Buyer',{...User});
init();
Bidder.only(()=>{
const price = declassify(interact.seePrice());
});
Bidder.publish(price);
commit()
Buyer.only(()=>{
const description = declassify(interact.getDescription());
});
Buyer.publish(description);
commit()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment